« first day (1373 days earlier)      last day (3590 days later) » 

12:01 AM
I'm confused. VS and installer files are two totally unrelated things
 
So one can create a my_script.sql file, read from it via C#, and so forth. But the user could just open that file and possibly edit or read the information. What exists to protect against that?
 
how big is this file?
And what does it do?
 
The file won't be that large; I am using it to store table information that will make C# coding easier.
Basically it contains one or more SQL tables.
 
You could store it in the code
That still doesn't stop a determined user from editing it
Are you trying to guard against clumsy or malicious users?
 
Ah, could do that.
 
user1804599
12:05 AM
Kendall dude …
 
If the end-user installs it on their computer via an installer, I shouldn't have to worry about clumsy/malicious users. Right?
 
Why do you think that?
Are you referring to editing the file, or editing the application?
 
user1804599
If they fuck up, it’s their problem, not yours.
 
^ clumsy users
 
The point is that the user does not even need to see the sql file.
 
user1804599
12:08 AM
Just put a statement somewhere that you’re not liable for anything.
 
So I think your suggestion of embedding it in the code is best.
 
Store it in a SQL file. 99.9% of users will never see it
 
OK, I guess it doesn't matter if they see it.
Hmm..although I am thinking of instances now.
(Different topic now)
I may modify the sql file via an inherited class, as it updates information. I suppose I will have to strictly maintain one instance of the class?
 
@rightfold hey dude
 
user1804599
If you don’t design your class for inheritance make it sealed.
 
user1804599
12:11 AM
@Pheonixblade9 hello.
 
still fighting with OWIN. Tons of fun :)
 
OR, I could initially read in the SQL script information, store it in memory, and modify it per instance.
 
user1804599
@Pheonixblade9 I’m fighting with PHP. :D
 
But then if the user closes the application, I wouldn't know which one to save. =P
 
ugh. I don't know who "wins"
 
user1804599
12:12 AM
Porting Noda Time.
 
@ReedCopsey around, by any chance? I bet he knows the OWIN magic sauce.
 
user1804599
I arrived at the point where I have to deal with time zones.
 
user1804599
Luckily time zones is about the only part the PHP standard library does correctly.
 
@rightfold You're porting a port of a Java library to PHP? glhf
 
user1804599
The Java library is worse than the .NET library, so yes.
 
12:13 AM
Well, DUH
 
user1804599
I’ll implement OffsetDateTime and then arithmetic tomorrow.
 
user1804599
And then timezones. ;_;
 
user1804599
q_q
 
12:40 AM
hi all
 
Hi
 
how are you?
 
Uhm...fine?
Braces for the question
 
i have a problem in asp
i want create a image gallery with page number + first_last-pre-next control and 5*5 row and col,
can you help me?
 
@mohsensolhnia have you tried anything?
 
12:43 AM
now but searching in google still
but all result have a some problem
any idea, any link,... any source code (hahahaha) ;D
 
 
2 hours later…
2:27 AM
I was hoping that perhaps some around here could help me, I've been wanting to learn asm for sometime now along with IDA and I was hoping some one could point me to a good starter book with perhaps some advanced stuff on assembly mainly will look into IDA after. Looking at amazon I found www.amazon.com/Assembly-Language-x86-Processors-Edition/dp/0133769402 but the price is so salty and the reviews on the previous Ed isn't that great so something on the 50~70 avg if anyone would mind ;)
 
2:39 AM
@KendallFrey I think I figured it out
I was using Integrated Security. I should have been using username/password auth in my connection string.
Integrated Security was by default since it uses LocalDb by default
 
3:18 AM
Hi all
Is it possible to create a property that provides overloaded versions of set?
Like for example, I want to have a DateTime property that can be set directly from a DateTime object or parsed from a String.
 
@Code-Apprentice not with auto properties, but if you use java style mutators, you can
7
Q: Overloading properties in C#

end-userOk, I know that property overloading is not supported in C# - most of the references explain it by citing the single-method-different-returntype problem. However, what about setters? I'd like to directly assign a value as either a string or object, but only return as a string. Like this: ...

 
okay, that's what I was wondering
 
I'm pretty sure that's true, anyways
so you can have
private int i;

public virtual SetValue(int i)
{
    this.Value = i;
}
then you can override it in an inherited class
 
I'm doing this all in a single concrete class
and I want to overload, not override
 
oh, I'm sorry. derp
 
3:24 AM
=p
thanks for your help ;-)
 
no, auto properties are automatic - their only parameter can be value
 
 
4 hours later…
6:58 AM
I'm using code based on vivien-chevallier.com/Articles/… that uses ControllerDescriptor.FindAction to check if the current user has access to POST to an action. However, the current request is a GET, which means that FindAction will filter out the POST-action. Can I create a copy of my current HttpContextBase with a new request method, so I can create a new ControllerContext to pass to my ControllerDescriptor?
 
you can do this.ControllerContext inside a controller...
 
Yes, but that current ControllerContext tells me what I have right now, but I'm trying to find out if I have permission to post to another action. Basically, I need to find out if I have access if I had done a post.
 
hm
dunno
 
Hello there
i Want to use DdeClient in my c# code
But can't finds its dll
Can anybody tell me about it?\
 
7:15 AM
@user3346501, "Dynamic Data Exchange was first introduced in 1987 with the release of Windows 2.0 as a method of interprocess communication so that one program could communicate with or control another program" - Wikipedia. That's really old stuff.
"NetDDE was still included with Windows Server 2003 and Windows XP Service Pack 2, although it was disabled by default. It has been removed entirely in Windows Vista."
Are you perhaps looking for DDEClient from Microsoft AX? msdn.microsoft.com/en-us/library/aa884809.aspx
 
hey guys, a little question: how can i generate all the numbers between 0 and 9 , but one number should missing
?
int numbers += random.Next(0, 9) - numbers - 1;
 
7:32 AM
var numbers = new List<int>(10);
for (var i = 0; i < 10; i++) numbers.Add(i);
numbers.RemoveAt(new Random().Next(0, 10));
var numbers = new List<int>(Enumerable.Range(0, 10));
numbers.RemoveAt(new Random().Next(0, 10));
Something like that will work.
 
@KraziiKiiD, as @RoelvanUden does it; consider it as "you have all numbers, and pick one to remove".
 
@SimonSvensson i see but
i asked cus then i needed to use it for chars too
but in a different way
like
DSDHAYUB
so always upper and to be twice a letter
 
Your return key is broken, you keep writing short rows that aren't complete sentences.
 
You might want to make complete sentences, rather than posting 2~5 words in each message. You're cluttering up the entire chat.
 
im sorry, my english isnt not so good..
 
7:35 AM
@KraziiKiiD, I do not see how making random characters matches the idea of "list of items, remove one". Are you talking about generating random passwords?
 
not quitet, just generating a length of 10 characters and there appear twice a character
 
Just generate a character and keep track of what is in the output. If it's already in it, generate something else.
 
Is it allowed to have multiple duplicate characters?
 
var str = string.Empty;
var rng = new Random();
while (str.Length < 10)
{
    var item = ((char)rng.Next(65, 90)).ToString();
    if (str.Contains(item)) continue;
    str += item;
}
 
i think i used this
oh but not from 65 and 90, i use a char array
 
7:41 AM
Writing the actual code is easy once you nail down the algorithm in basic steps. 1) Take character array (alphabet), 2) Shuffle, 3) Take first 9 entries, 4) Pick one random character out of those nine, and insert it at a random location.
 
but however, it doesnt return this code twice a letter (as i've done it before too). and the number generator isnt good, cus i have 17 labels and i need for all of them to generate specific numbers where is missing only 1 from 0 to 9
private static int GenerateNumbers()
        {
            var numbers = new List<int>(Enumerable.Range(0, 10));
            numbers.RemoveAt(new Random().Next(0, 10));
            int nums = 0;
            foreach (var num in numbers) nums += num;
            return nums;
        }
so this code return on all lebel's text: 36, 39, 37
as i said i have 15 labels (not 17) and i need on all of them be random like: 012356789. so is missing here the 4
and so one for the others
and the letters in this function doesnt have a letter twice
 private static string GenerateLetters()
        {
            var str = string.Empty;
            var rng = new Random();
            while (str.Length < 10)
            {
                var item = ((char)rng.Next(65, 90)).ToString();
                if (str.Contains(item)) continue;
                str += item;
            }
            return str;
        }
 
GenerateNumbers will only generate ten different results, since you only have ten different combinations of numbers.
 
yes but i have 15 labels and on each 2nd labels ( i % 2) generates the numbers, and on the others the letters
so it would be like 7 labels with numbers and 8 with letters
 
The sum of 0..9 = 45. That's a fixed value and will never change (I think we can assume that...) So to generate the sum of all values except one would be equal to 45 - randomNumber or 45 - RNG.Next(0, 10)
And the code for GenerateLetters clearly doesn't add a duplicate letter. Read the code.
 
but i dont want the sum of them, i need an output like this: 0123457890, where 6 is missing
 
7:50 AM
@KraziiKiiD, but that's not at all what your code is doing. You're calculating a sum. If you do not want the sum, then why are you calculating it?
 
that += i wanted to use it to add each number into a int
 
Instead of thinking of them as numbers, think of them as characters. Make a character array where you remove one character. "012345679".RemoveAt(startIndex, count)
 
btw @RoelvanUden I think I solved (one) of my problems. I was using integrated security for my connection string. didn't work :)
 
 
9 hours later…
4:35 PM
KoBE wakes everyone up
unsuccessfully
 
Hello
Wakes up, successfully
 
How's your Sunday going?
 
Pretty well, I suppose. Trying to work with a .settingsfile for an application I'm doing.
How 'bout yours?
 
Not bad. I'm delaying working on my WP8 app because I'm at the point where I need to write the SQLite database stuff. And last time I had to mess with it, it was a pain.
 
Good call
 
4:49 PM
Idk why WP8 doesn't have built in database classes. Getting the SQLite classes working and the changes to the project settings isn't the most straightforward thing I've ever came across. But, I've done it once, so this time around shouldn't be as bad.
Btw, I'm having to re-write an app because of HDD failure.. which further causes lack of motivation.
 
HDD failure, really?
That is unfortunate
Hi @SimonSvensson
 
@KoBE, now you have forever and eternal argumentation material to use distributed source control systems!
I'm got an MVC 5 application with tasty hot areas. I'm looking to add a few json apis to it, nothing that should be publicly consumed, and was looking into the Web API stuff. Can it work with areas as good as normal controllers do? Or should I just write normal controllers returning Json(model)?
 
Argh, why doesn't this work! I have a Band.settings file and can access parameters via Band.Default._name in one project, but not in another VS project!
 
@Biff, open the file in Visual Studio and save it again to generate the proxy class.
 
@SimonSvensson What's funny, is I have my own cloud server that I do auto-backups too.. well that only works so well if I'm connected to WiFi.. which I wasn't for then entire week I slaved over this app.
*for the
 
5:00 PM
No wifi for a week? Where were you? Gulag?
 
@SimonSvensson Haha, I was back home from college for the summer, and the cable company couldn't get my hooked up for a week.
 
I take it you actually use the hardware the cable company provide? I never trust those dsl modems, it's something about the design of the web interfaces that thinks that they plot to kill all humans...
 
Typically I do. But, the cable company had to come out and actually turn the line on. So, even with my own hardware I was stuck.
 
Ah, my brain is still doing some bootup checks. I was thinking that you had your Time Capsule standing on a shelf somewhere when you said "cloud server". That's how I refer to mine. ;)
 
Ah.. haha no. I have a VPN that I use.
*VPS
 
 
1 hour later…
6:23 PM
chirp
 
chirp
 
 
1 hour later…
7:47 PM
How can I set a list as an ItemSource of a listview
 
Gui
.DataSource
 
@Gui do you know anything about WP8.1 development?
 
Gui
no sorry
 
List<Music> source = new List<Music>();
source.Add(new Music("Michael Jackson", "Thriller", "Billie Jean"));
this.contentList.ItemsSource = source;
It shows Beta.Music in the listview control when running that code.
<ListView Margin="0, 125, 0, 0" HorizontalAlignment="Stretch">
    <ListView x:Name="contentList" HorizontalAlignment="Stretch" />
</ListView>
What the heck is wrong here
 
Did you override ToString for Music?
 
7:53 PM
No.
namespace Beta
{
    public class Music
    {
        public string Artist { get; set; }
        public string Album { get; set; }
        public string Title { get; set; }

        public Music(string artist, string title, string album)
        {
            this.Artist = artist;
            this.Album = album;
            this.Title = title;
        }
    }
}
 
...?
 
So will you override ToString for Music now that I asked if you had, and you said no?
 
public void ToString() {

}
 
Oh, oh, now it's my turn!
...?
 
7:57 PM
public override string ToString() {
    return "hi";
}
 
And now what happens, do you see "hi" in your ListView?
 
now it's printing "hi", which makes sense, but what am I doing wrong otherwise?
Yes.
 
I don't know ListView in WPF. It may be that it has some way to specify the property name to print from the objects you give it.
But in Winforms, a "ListView" has only 1 column, and the way to give it a value is to override ToString.
It seems this holds true for WPF as well.
So return whatever it is you wish to display for a single item of type Music, probably a combination of the properties it has.
 
How would I display the item as I like?
 
And how would you like them displayed?
 
8:00 PM
For example, make it multiline, with the title on the first line, the artist on the second one?
 
I have no idea, you need a WPF expert now.
 
All WPF experts, report to duty
 
This is the C# chat room.
You know, the programming language.
 
But many people here know WPF
at least from my past experience here
 
This is not the everything that can be done with C# chat room.
Yep, many people here know WPF, that is true.
 
8:01 PM
I don't give a Java
lol jk
 
But many people are not here right now. Only 3 active people, me, you, and Gui.
 
@Gui do you know WPF?
 
Gui
I dont
 
OK, I know WPF, and I will help (although there is a WPF chatroom just for this stuff)
When you bind an object to a ListView item (or ListBox, or Combobox, etc) you are binding the object itself, not a strig representation
you can define a DataTemplate to say how to display it, or for simpler cases you can use the DisplayMemberPath attribute to proved the property name to display for the object
baring that it defaults to displaying the ToString representation for the object, which is not explicitly defined defaults to the class of the object, as seen from your initial question
 
The problem with defining chat rooms for programming is that a good developer knows a lot of stuff, and grasps how most things work even if it's just about finding the correct api for it.
 
8:12 PM
Most people in here eat food as well, but food questions are not really welcome. The thing is, if you want to ask people that want questions about a certain topic, it's almost always better to go to the chatroom(s) dedicated to that topic.
Though that may just be my opinion.
 
Also, if you are learning WPF, you should immediately learn MVVM and binding. The way you are doing the listview is bad. good WPF needs very little or no code behind and will talk to a view model to get data
my list box would be
`<ListView ItemsSource="{Binding Items}" DisplayMemberPath="Name"/>`
sorry, haven't posted code before and I am trying to figure out how on the fly
 
Indent by 4 spaces, or you should be able to use backticks
 
then in my view model I would have:
public ObservableCollection<ItemType> Items {get; set; }
where ItemType has a Name property
look at Caliburn.micro for a kick-ass MVVM framework for WPF
 
8:50 PM
Here is one
Stackpanel
How the heck do I get it to show in a list? Right now, it shows side by side
 
What do you guys use to store data that your C# application so that it can pull from it and modify it? Perhaps a .settings file?
 
data, database, settings, xml/database
 
9:13 PM
@DemCodeLines Orientation="Vertical"
 
@DreadPiratePeter not working, seems something's wrong with the gridview
 
10:03 PM
gridview? how about showing your code
 
 
1 hour later…
11:13 PM
This is why C# makes me so happy:
public static String WithSign(this int i)
{
if (i >= 0) return "+" + i;
return i.ToString();
}
So I can say `i.WithSign()` to print -1,+0,+1, etc
 
C# is pretty cool
 

« first day (1373 days earlier)      last day (3590 days later) »