« first day (905 days earlier)      last day (4269 days later) » 

user1125394
00:06
anyone would like to give me hand in a Linq query?
00:57
@c'c I can try
I have a query.
For XNA...
I wanted to make a... RoomList object thingy, which woul hold rooms. Rooms are sort of like different screens: they have their own draw and update loops. Say, each menu screen, and the gameplay itself, is a room. You could then swith to certain rooms (possibly via enum), and it would call the draw methods on it, etc.
But how can I set this up in that each instance of an object (room) would define different update() and draw() methods?
Sounds simple enough
You can use an interface
public interface IRoomDrawable
{
   void update(float elapsedMilliseconds) ;
   void draw(SpriteBatch spriteBatch);
}
I'm not sure if you can pass SpriteBatch like that.. ask an XNA expert.
Would this mean I need to make a new class for each room, though/
That was what made me wonder.
Unless I somehow make a bunch of static methods for each, and link it up using delegates?
It is almost like, I want to make instances that impliment an interface.
@LewsTherin?
01:23
Don't use static methods
Use different classes, not delegates
hi guys.
So, you think I should have it like RoomMainMenu, RoomMenuControls, RoomGameplay, etc?
@Crowz hi
@LewsTherin can't he have an abstract class or somethign where the base members can stay the same?
In that case yeah
I am thinking like...
user1125394
01:35
@LewsTherin ok so
Say we were using Javascript.
on a given isntance.
user1125394
string[] quotes = orders.Select(f => f.Substring(0,6)).Distinct().ToArray();
string[] convquotes = quotes.Select(f => conv+ f.Substring(3)).Distinct().ToArray();
You could reasign a member that had been assigned to a function to a new function, potentially a lambda.
but that is by instance.
user1125394
it's working, but I'd prefer a simple big array
@c'c you mean you wanna combine those two?
user1125394
01:37
containing both, and I think Aggregate could do that?
Or Union I think
user1125394
@coolguyxp yes and possibly in one query
user1125394
first one is substring'ing and removing dups, second is making converting items by replacing the first half and removing dups after
string[] quotes = orders.Select(f => f.Substring(0,6)).Distinct().ToList().Union(quotes.Select(f => conv+ f.Substring(3)).Distinct().ToList()).Distinct().ToArray();
user1125394
ah nice
user1125394
01:39
Aggregate is not for this kind of stuff ?
user1125394
(never used it yet)
user1125394
@coolguyxp quotes is not valid
Make it work.
GOsh
user1125394
doesn't exist yet
hmm?
what's the error?
user1125394
01:41
.Union(quotes.Select
user1125394
quotes isn't defined at tht point normally
oh right
string[] quotes = orders.Select(f => f.Substring(0,6)).Distinct().ToArray();
string[] convquotes = quotes.Select(f => conv+ f.Substring(3)).Distinct().ToArray();
string[] both = orders.Union(quotes).Distinct().ToArray();
user1125394
orders.Select(f => f.Substring(0,6)).Union(orders.Select(f => conv+ f.Substring(3,6))).Distinct().ToArray();
user1125394
there's possibly repetitions twice, but it does the thing
02:05
Hurray.
user1125394
using (Stream stdout = Console.OpenStandardOutput())
user1125394
what's this?
how can you make custom objects that work with using?
user1125394
user1125394
wow, it does compile
user1125394
02:07
but the syntax using () is really ugly
im awake again for 5 minutes , did i miss anything
in your chair again? :D
lol no i went to bed this time
Good for you :D
02:15
lol
hm...
I wonder what CCinc was doing today.
i think that was in reference to his question
What?
looks like he was asking about linq queries
oh wait
sorry ccinc not c'c
looks like im still waking up lol
Yes :D
Perhaps you should sleep.
02:25
lol you might be right
what time is it in your place?
3:30am
02:42
I have a query.
I want to make, for my game, rooms, as I said above.
I was thinking, I would love it to be able to call something like...
RoomManager.GoToRoom(Room.Rooms.MainMenuRoom)
From within one of the room's code.
But... the room code will be running on top of RoomManager, so I don't know how this is possible.
Whatchya doing @coolguyxp
have a look at the gamestate manager (screens seem to be the same as your rooms) xbox.create.msdn.com/en-US/education/catalog/sample/…
Sounds very similar. I will look into that, thanks.
03:03
Is the storing of mp3 file to ms access possible? programmatically?
if it can store blobs i cant see why not ( although i am not an access user )
 
3 hours later…
05:45
So then I said, dude, that was once, we were drunk, and you were the one that wanted to experiment. Not me. Now I have to block his number.
Oops. wrong window.
 
1 hour later…
06:50
hello
 
2 hours later…
08:20
hello
08:38
hi @CSharper :D
Hi there
I have a little question, its more class design, rather than programming
I have a client class thats connects to the server. The class has a ip address and port property. During the client is connected, how should I prevent the change ot this properties? readonly? or throw an exception
getter but no setter.
Once it's instantiated, it can't be changed.
08:50
@RyanJMcGowan true :D
@RyanJMcGowan ok
@RyanJMcGowan thanks. so its only initialized at the ctr.
Yeah. You have no way to change it after that. Trying to give it a value won't compile.
It will say that property is read-only.
@RyanJMcGowan Interestingly, it is possible with the normal socket. There you can change the RemoteEndpoint after connecting, but it has no effect.
I imagine it would only call the ip address once when the connection is open and keep it as a private property until the connection is closed. But I don't know really. Never used sockets.
09:18
@heron don't think 50 rep is really enough for a "do my job for me" question
@heron If WPF is an option, I think it would be easier for you. You then can use transforms to move your textboxes
This room is actually discussing C#. Weird. I like it.
3
Why would you move text boxes? You should move values.
@RyanJMcGowan I suppose that he may need something other than textboxes at some point
But yeah, I guess you're probably right
All the more reason to decouple the UI from the logic.
09:23
I don't know why I thought about that ._.
Ram
Ram
09:43
0
Q: How to get Header text as required in CSV file in Windows Application?

RamI am using the following code to generate CSV file: private void button1_Click(object sender, EventArgs e) { Stopwatch swra = new Stopwatch(); swra.Start(); string NewconnectionString = connectionString; StreamWriter CsvfileWriter = new StreamWriter(@"D:\test...

please help
ram that one should be obvious
youre callin .tostring on your expression
drop the .ToString() and i think you should be fine
Ram
Ram
@drch please help me to resolve this i am new to winforms
@drch ok let me try
its not winforms its just c# ;)
Ram
Ram
@drch i have tried it then i got this:

Error 1 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<string>' to 'string'
it is not a string
it is an ienumerable<sring>
you are using it in a string.join(string, ienumerable<string>) on the next line
Ram
Ram
09:52
ohh sorry my silly mistake........
change string columnNames to var columnNames
Ram
Ram
@drch thanks dude
or IEnumerable<string> columnNames
Ram
Ram
@drch thanks its working.........
cool
10:04
@drch - What do you think of the wiki?
10:31
neato
10:50
UGH I HATE THIS LANGUAGE
ive been trying to port source over to mono for 2 hours
with no experience
ahhaha ad the only problems are with data types
do you know anything about mono?
@LiverpoolsNumber9
@TrevorRudolph I don't I'm afraid mate. C# yes, Mono no..
Sorry
Mono is C# compiler for corss platforms, so same thing
could you try to tell me whats wrong with my code?
hi @LiverpoolsNumber9 @drch @TrevorRudolph
10:58
Hello
@TrevorRudolph I could try... but I may fail miserably.
@LiverpoolsNumber9 you know more than me
10:59
@TrevorRudolph get a bit 404 on that link..
*big
@LiverpoolsNumber9 @drch @TrevorRudolph u there
?
i dont know any c# period
11:06
@TimKatheteStadler please see my stcak Over flow Problme
@LiverpoolsNumber9 WHat do you think?
i love how the last line in the question is "Please implement this. Thanks"
@drch i have tired Much not able to do so am asking
11:32
@drch: You can't just copy paste all your code on Stackoverflow, ask a very unclear question and expect anyone to help you.
If you have have tried hard to solve this problem, you can at least try a little harder coming up with a good question.
English as a fourth language doesn't help.
@Steven please see My PRoblme
Does your player work as is? — RyanJMcGowan 17 mins ago
@Steven
11:34
@drch: I read your question, but I can't help you. I simply don't understand the question.
@Joan, obviously he's seen it as he's referring to your poorly worded question.
Does your player work as is? — RyanJMcGowan 17 mins ago
I'm sorry, my reponses to @drch are meant for @Joan :-)
am able to Li-sen voice Just we have to apply Next And previous Button for playing Next and previous songs if u want i can send Source code @Steven
@RyanJMcGowan am able to Li-sen voice Just we have to apply Next And previous Button for playing Next and previous songs if u want i can send Source code –
@Joan: Please please please read the articles by Jon Skeet I just referenced. After that take some time to write a proper question. If the question is good, people at Stackoverflow will help you. Refering in the chat to a bad question doesn't help.
11:38
Please check this Application This audio Player drive i want to apply Next and previous songs Button so that if click next song play its should Play next song if we click on previous songs it should play previous song . [ am doing Json parsing and displaying songs Name in One class in list-view and on-item selectaion i m sending its Streaming Url and playing that songs according to item selection i have Play ,pause ,
@Steven
@RyanJMcGowan
Are you asking how to make a button? Your question is way too broad. It's like you're asking for someone to do it for you.
No
how to apply code for Next Button click and previous Button click
how i ll write code for That in class B
coz am playing songs In class b
@RyanJMcGowan
Have you tried? None of your code shows that you even have such a button.
i have tried But not able to Understnd how i ll call all Streaming url in class B and play song s for next and Previous Button
u suggest me i ll Implment
Then post the code that you have in your button click methods.
11:43
private void Next_Click(object sender, EventArgs e)
{

}
private void previous_Click(object sender, EventArgs e)
{
myMediaElement.Stop();
}
NOw i will write funcation for Next and previous
@RyanJMcGowan
u tell oNly for Next previous i ll do it
@RyanJMcGowan
Only for next_click
If you want general guidance, this is it: Your media must be organized so that they can be iterated. And then you must have a way of calling them by that iterator. Check out a tutorial on Lists.
Are you linking me a virus?
no im linking you vb sourcecode that im trying to compile with mono
but i dont know any c# or vb so its hard
my only problem is data types
are you getting a compile error?
11:57
yes, type errors... ill link some...
specific questions are a lot easier to answer.
i know :/
You'll learn more that way anyway. Can't learn how to build a house without learning how to swing a hammer.
yes, i just hate c# with a passion...
sorry
What are you used to?
12:00
i use obj-c
and c
and im open to c++ might sart learning
im big with python and perl
lol most evil creation, obj-c#
Never even heard of obj-c#.
That's def not C#. Those are all VB errors. C# doesn't use an "As" clause.
@RyanJMcGowan can U Provide me AnY Example Url for Iterator
@TrevorRudolph There's mainly only two errors you're getting, but in different places. Post a line of code that is in error. I don't remember much VB, but I might see it.
@TrevorRudolph "Assembly 'System.Deployment' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors."
That kind of thing is one error that can give you hundreds of errors.
Try at the top of your code:
Imports System.Deployment
12:16
I am getting object reference exception in the finally block can anybody help
Just ask the question and cross your fingers. You don't have to ask to ask.
I have a close connection method in the finally block which is called for closing database connection.If the connection was not open then while closing the connection in finally block object reference exception is thrown
Make it close it only if it's open.
12:19
or wrap it in a using
The closemethod is called by another dll so i have no information about connection state.Neither can i modify the code.
finally { if (conn != null) { conn.Dispose(); } }
can i have bool variable to notify the finally block when the openconnection was called
I dont have connection state variable connection is called by other dll which interacts with the database.I can only call clos and open connection.
You know if it's null.
look at drch's reply
Put a try-catch in the finally block.
I'm not joking
Then if it errors, it won't error
12:22
um
lol?
If i had the state of the coonection then it was easy .
can i post code here
?
try
{

if (Utility.Utility.CreatedTable.Contains(tableName.ToLower()))
return true;
else
{
_dataAccess.openconnection();
if (!_dataAccess.isTableExist(tableName))
return false;
Utility.Utility.CreatedTable.Add(tableName.ToLower());
return true;
}
}
catch (Exception ex)
{
Logger.WriteLogFile("QueryBuilder", "IsTableExist", ex.StackTrace + "\n" + ex.Message);
}
finally
{
_dataAccess.closeconnection();
}
return false;
try {
}
catch (IraqiInformationMinistor exception) {
// NO EXCEPTION, EVERYTHING FINE

}
And the exception thats coming my way is :
Object reference not set to an instance of an object.
at DataAccessLayer.DataAccess.closeconnection()
at QueryBuilder.QueryBuilder.IsTableExist(String tableName)
at ObjectFilling.BusinessLogic.GetDataTypeForAllTags(DataTable tagDetails)
the openconnection method is called in the else part
12:23
@lokendrajayaswal debug it and find out what is null. Then let us know.
the exception is coming form the finally block
Is is DataAccessLayer? DataAccess? Something inside the closeconnection method?
@LiverpoolsNu i told you its the _dataAccess object that i am using for connection.I cannot debug dll.It sfrom other project and provided to me to interact with database
MessageBox.Show(_dataAcces.conn.State.ToString()); to check whether connection is open or closed?
@drch if you're gonna be xenephobic, it's "minist**e**r"
12:25
;)
it looks like _dataAccess.IsTableExist is calling close connection
are you sure youre supposed to be calling openconnection?
or does it handle that internally
kind of a weird api
@LiverpoolsNu thats right the DataAccessLayer contains the method openconnection and closeconnection
@lokendrajayaswal Yes, but DataAccessLayer might be null? Is it? Because if it is at that point, you can
't call a method on it.
@LiverpoolsNu it does not handle it internally the database connection state has to be passed from here.That is closing and opening is from callers end.Probably bad coding practice but can't help it
@LiverpoolsNu exactly you got it
Hang on, there's a few mistakes with that code
So how to notify the finally block can i use boool variable or anything like it
12:28
A) You don't want to open a connection, then allow it to return out of the method.
Should i implement return only once using bool variable
Please don't.
OK, and you're opening the connection with a conditional. So if it's false, you won't open it. So then you won't close it either.
Thats right.
So move your open connection out of the conditional or set some state when you open the connection.
12:31
@RyanJMcGow i would have done that but then the openconnection will be always called even when i do not need it.Would not it result in performance penalty..I am just wasking ..?
or move the try/finally into the else block since that's the place youre opening it
but what if openconnection throws... dun dun dunnn
@drch hmmm thats right you pointed the correct scenario what if openconnection throws exception
bool isOpen = false;
try
{
......
_dataAccess.openconnection();
isOpen = true;
......
}
finally
{
if (isOpen)
_dataAccess.closeconnection();
}
And still, you don't want to return with a connection open.
so close connection then return.
@RyanJMcGowan bingo..I think this will work..
Thats perfect
I just came with another doubt ..what if the _dataAccess.closeconnection(); throws exception.Can it be handleed.
@lokendrajayaswal: then isOpen would be false
would you expect to have to close it if open throws?
12:36
@drch no it wouldn't. It could throw for an number of reasons.
If it throws an exception, it won't be the same exception.
@drch i am saying what if i nthe finally block while calling closeconnection i get exception?
er sorry i misread that as openconnection
Hence my original answer...
It's not likely to happen.
12:37
yeah, if that happens, you can't really do anything
@RyanJMcGow.Perfect i got the answer.Thanks for the help and guideline
either let the caller handle it or just log and ignore ;)
You're welcome.
@drch thanks buddy :)
Let the caller handle it. I agree.
12:38
Yeah i do agree with the same thing.
have it email the person who wrote that component
haha perfect.
@drch Long time no see, it seems like.
$f
Wrap it in a foreach too.
12:40
Sure would do that ;)
Should I eat or not eat
Not eat.
Good idea
It was my first time had great time chating with you people.
word up @cc
12:40
Kendall's bot always gives the right answer
what do you mean 'you people'
Should I wake my mom and leave or not leave
Wake my mom and leave.
The first time usually never goes that well.
I mean we people
12:41
=]
sorry i am also part of this community now
@CCInc I usually wake your mom before I leave HEYOO
@ It was pretty good experince for me anyways ;)
@NinjaEcho I love you
@drch lol
You can leave the money on the dresser.
12:44
$h
Oh great, here come spam message to SO Chat.
Make it ask really vague questions and end them with "...and please send the finished code to my email at ..."
hi everyone
I am so confused with authentications we use in ASP.NET, or c# , there are so many types of authentications and try to read about them but never able to understand them properly
for example network authentication
does anyone know any good article or video on just authentication or all modes of it
How has Ninja Echo been behaving?
12:54
$f
nope
bye peeps

« first day (905 days earlier)      last day (4269 days later) »