« first day (2645 days earlier)      last day (2529 days later) » 

14:00
I just found out you can actually look at the most recent chat messages on someones profile - his last messages were on 18th Jan. indeed
> This user has been temporarily suspended by a moderator and cannot chat for 6 days.
Maybe he'll be back
somtimes persian month start from middle of gregorian month.
Oh, he'll be back. Of course he'll be back.
I read it usually starts somewhere around 20th March, +- 2 days
i ddint know now how to store persian date in datetime object to subtract,
and why result was not same in those codes
14:04
rextester sux, thats why
but result same as rextester in my server
Oh damn. He'll be back? Here's to hoping he's matured in that while.
@Wietlol part 1
When I go
Parallel.ForEach(source, new ParallelOptions(){MaxDegreeOfParallelism = 1}, (s) => {doStuffWith(s)});
is it literally just 1 thread?
Well, J.Doe is always watching...
always waiting
does anyone knows which process to connect to for debugging asp.net annonymus pages
14:09
w3wp probably
(If you're using IIS)
not working :(
it's a sharepoint page, if access from web app 1 with app pool 1, attachement works but if try from web app 2 which is annonymos with app pool 2, it won't attach to debug
I don't know too much about IIS, what's an anonymous page?
@Wietlol ,i solved that exception .dotnetfiddle.net/2zfRNP but didnt know why result is not same on computers.
@MehdiRostami Dude why still so complicated?
Like...you make a DateTime object, make it into seperate numbers, put it into another datetime object, and then stringyfy that with Culture.
Why not just make a DateTime obejct and stringyfy it with culture?
@PichiWuana store the banks in arrays, store the arrays in a set, if the array already existed in the set, you have reached the end
so you never have duplicate arrays
14:20
beacause i will fetch a persian datetime from my database and it is string i need to convert and subtract like this
> and it is string
#1 issue
string newDate = DateTime.Parse(dateString, "fa-IR").AddDays(add_days).ToString("fa-IR");
But I'm trying to understand...
You try to add to the set and it throws an exception?
The set checks the values or the address of the reference type? Because **I think** that if you change the value of an item of an array, the address will be the same...
except Wietlol is right, don't store it as string if you can avoid it
@Metallkiller okay i will use like you .
what config is wrong in servers that this result not same
14:27
On rextester? No idea, ask them.
i am going to check this again on my server,waite pls
@PichiWuana dont "try to add"
just check if it contains one already
if not, then add
you clone the array, store the clone in the set
That's what I wondered! I clone it because I want another address
it doesnt check the address
it checks the hashcode and equals
but, if you modify the value already stored in the set, or dictionary, or map, or table, or whatever, things will go wrong
i did it in Jabba though
so, it might require a slightly different setup in C-harp
@Wietlol Why will it go wrong?
14:38
because the stored hashcode will not be valid any more
for algorithm purposes, the dictionary, set, map, etc takes the hashcode of the object
then, based on the hashcode, it stores the object somewhere in an array
by using the hashcode, it can retrieve the value again
When you change a local variable of the object, the hashcode changes?
but, if you change the value, the hashcode will be different, but the dictionary will not change the object's position in the array
@PichiWuana depends on how the hashcode is computed
most classes will take the hashcode of their fields and take the sum, while multiplying by a nice looking prime number with each field
that way, you get quite unique hashcodes
the more unique they are, the better they work
if you exclude some fields of a class in the equals and hashcode, the objects will be considered the same if only those fields are different
you could read up a shit ton of stuff about equals/hashcode and dictionaries, but for the time being, you shouldnt care about it
all you should care about for AoC is that a HashSet<T> will be the fastest way to check if the set contains an object equal to your input using the Contains(input) method
and that you are not allowed to change objects that are added to it using the Add(object) method
So in the end, the program checks the hashcode when you use Equals and not the address of the reference type?
it will first check hashcode
if hashcode fails, equals is supposed to fail to
if hashcode succeeds, it checks equals
So first hashcode, and then address?
14:44
no, Equals() method
Object.Equals()
That's what I meant by address. I learned that it checks their addresses
user5500750
@CapricaSix Are you human?
of the references types
if the type of said object does not override the default implementation of Equals, it will just fall back to the default implementation which does a simple reference check
@PichiWuana it doesnt check by address
this made me crazy why datetimeobj.ToString("yyyy/MM/dd", faIR); result is not same ,i know compiler is same,dot net version is same,windows datetime setting is on iran and same as my local pc.
14:45
i.e. I learned that it checks whether both reference types point to same location in the memory
user5500750
Do you think this code will always find the initial in a name:
Regex regex = new Regex(@"\s[A-Z]{1}[\.]{1}");
Match initalMatch = regex.Match(fullNameAsScraped);
if (!String.IsNullOrEmpty(initalMatch.Value)) {
//Code to run if an initial is found.
}
Uh wtf do you have {1} for
and [\.]
user5500750
For example;
user5500750
Daniel P. ADAMSKY
15:11
Hello,
If i have an Date (not date time) stored in the database in UTC, when i read the value it set the timezone to my local: +1 in the Datetime object. Is to correct that all dates then is yyyy-mm-dd 01:00:00 ?
i think it should be 0 in times params
by defalut if you chang utc yes it will be affected
@Raldo94 dates are unaffected by timezones
you need a time to be able to find out when the next day came
also, Date doesnt exist in C-harp
Date in SQL will be DateTime in C-harp
@Wietlol Ye, does not make it any better that the official API for integration with the software that uses MS SQL uses same method to fetch dates and datetime, but when there is an date to be fetched, it converts it to Julian date and epcoh time for datetime.
@Wietlol coludnt find my problem solution ? ;)i always had errors that no body could solve it...somtimes i colud solve within monthes. but this one seems not to be solved
julian?
is this System.DateTime?
@MehdiRostami im sorry, what problem was that?
15:20
why datetimeobj.ToString("yyyy/MM/dd", faIR); result is not same ,i know compiler is same,dot net version is same,windows datetime setting is on iran and same as my local pc.
https://en.wikipedia.org/wiki/Julian_day
If i use the offical API it will return an integer for the date, then you manually calculate it and convert it to an System.DateTime object
what did your server return with the "invalid" datetime?
dotnetfiddle server defalut culture is in "us",my servers is too.but result not same
@Raldo94 sounds like rubbish
if you dont store a datetime object, you will never really get the true moment
@Wietlol Correct, and slow. takes 1.5s to read an tuple from an set of 500k, with ado.net ~5ms
15:24
500k db entries?
@Wietlol Yes
any proper db index should be able to do that within 20ms
i am back :)
I understand how switch statemetns work (or so I thought) but what is a switch statement which can show the type and value? I'm trying to learn what it is called to research it.

A normal switch
switch(i)
{
case 1:
return 0;
etc....

And now

switch(e)
{

case MyMainException _:
//code
case MyException abc:
//code
What is the abc bit in the code above
I understand the 'normal' switch
maybe normal should be more traditional
15:31
@Wietlol one server return gregorian date instead of persian date time and an other return persian date time that this one is correct.why that other one not return same date
Thank you @KendallFrey
You've helped me a lot over the years, the link is perfect
@MehdiRostami i asked you what your server returned with the code i posted
hey i told you it in my prev posts.it solved you need to convert it like this
DateTime.Parse("date time string", new CultureInfo("fa-IR"));
but my main problem not solved yet.
what is the main problem
anything different between those 2 servers @MehdiRostami ?
because from c# perspective, it should give you the same output
you using DateTime.Now or are you specifying an input date?
15:43
@Zorkind isnt that always the case with identical code?
that, from their point of view, it should be the same
Input date is a string from DB
@Wietlol Not if you have something localized in there
yes same.i am using DateTime.Now
Imagine a german and a US server and go DateTime.Now.ToString()
@Wietlol why you lose your time typing these kind of pointless phrases?
@Zorkind Because this is a chatroom; exactly the right environment to waste some time.
15:45
@Metallkiller agreed ^_^
well, ignoring Troll replies, try to pass it the same input data, see what happens.
so we can isolate the problem to the input instead of the method itself
your code work in my pc but on server has this error
Debug the server then
or put log output everywhere
Also, in the beginning of the method, set the currentculture
or log the currentculture
and the currentuiculture
and the timezone
log everything
I'm off into the weekend now, cya!
current culture of my server is in us english same as
dotnetfiddle.net server. but on my server not work an trow this error.
Stop comparing it to dotnetfiddle, that wont helü
put a line that reads teh CurrentCulture and CurrentUiCulture during runtime, in that method
In the beginning, after building datetime object, in the end
everywhere
then continue bugging wietlol :P
bye
@Wietlol ?
15:59
@MehdiRostami why don't you just start a room with @Wietlol if you going to ignore @Metallkiller ?
that's kind a rude :-\
i dont ignore him,he went
he said a lot of things to you tho.
that's alright.
i did that things before
ok :)
@MehdiRostami it seems your server still uses the gregorian calendar
if you provide it the cultureinfo, it should take the right culture
16:04
my quesion was this why when i provide this cuture info server not take it.
im not sure how the asp pages deal with localization as im not really a fan of asp.net
it should
i also tried secend param of culture info as true butnot helped
but im not sure what the code is that threw this exception
in any case, im off for now
gonna be online in a few hours
noooo
i am crying...
the entire code is in that dotnet link?
ok the problem is in the ParseExact as the exception says
yes problem is there but on server on my pc works
yes i just test that out
it's a configuration on the webserver
which configuration?
hold up, let me look it up
here
try to put it on top of your page
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("fa-IR");
this is different than creating a variable of said culture.
this sets the current Thread to run using that language/culture as default
see if it works
for example
instead of creating a variable i used the thread on the parse
all in all it's the same but...
perhaps in the web server it's not
16:27
!!HoldThis
@juanvan That didn't make much sense. Use the !!/help command to learn more.
lol
she wants you to tell her what you want her to hold xD
:-p
!!holdme
@Zorkind That didn't make much sense. Use the !!/help command to learn more.
^_^
!!/help
16:29
@Zorkind Information on interacting with me can be found at this page
i have did it with its tag in my webconfig and not helped,if the problem was from this config why it work on fiddle server with english culture? i also added your line in my page load but not helped
because fiddle is not a web server
fiddle don't have IIS context and configurations
fiddle just compiles as Console
it's a different beast
can minor version diffrent occur this in dtnet?
my pc:Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1088.0
my server:Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1590.0
no
this looks like configuration to me, pure and simple
is this what you did?
<configuration>
<system.web>
<globalization culture="en-US" uiCulture="en-US" /> <!-- this only -->
</system.web>
</configuration>
i did it with persian culture,wait to try this
not worked.
16:35
it gives that exception again?
yes ,The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.
it looks like it's forcing the use of Gregorian :-\
there wa a second param in culture info to force
i tried it but not worked again
perhaps it's not liking the 31
try with a different day
just for lols
use like 1396/04/04
so it is inside bounds
;) what if day is 31?
if it dont like it why in server?
16:40
yeah, but, i am just trying to isolate the problem o:
if that is the case we look for solutions in that part.
i like to experiment. that's all :-p
test every possibility
assume nothing ^_^
int[] arr = { 0, 1, 2, 3 };
HashSet<int[]> set = new HashSet<int[]>();
set.Add((int[])arr.Clone());
arr[0] = 99;
set.Add((int[])arr.Clone());
arr[0] = 0;
Console.WriteLine(set.Contains(arr));
;) that server dont like 31
Why does this program prints false?
16:42
you still in this puzzle @PichiWuana ^_^
@MehdiRostami it worked? :D
@Zorkind ^_^ got back to it :D
yes ,but why not 31?
@PichiWuana right :p
because he is still thinking as Gregorian
Feb have only 28 days ^_^
;/ why he want to make me crazy?
that's a step forward. now we know he is nuts :p
16:44
:P hash stuff are still confusing for me lol
well it's quite simple @PichiWuana
I hope it is ;D
every object have in its base that method
that gives out the hash representation of it
all it does is take everything that the object holds.... and hash it up
which means?
lol
so it goes property by property asking "give me your hash value?"
wich means its the most absolute unique identifier possible for an object
it grants it's uniqueness
it's used for comparisons :-)
16:46
But what does mean the hash value of something?
I only read long time ago that hash functions are used to encrypt passwords lol
nuuuuuuuuuuu
that's a different thing
Yeah I supposed that haha
take a loooooooooong read of that article
you will understand
simply put the framework calculates that for you
you really don't need to worry about that, but if you want to know how it works, i am sure you will find in google something about it ^_^
people like to poke under .net hood :p
fuck this server.what can do at this time?
@MehdiRostami ok back at you
let me think ...... thinking
this is something related to how the calendar works
need to find a way to make he you Persian one
16:51
@Zorkind I read that article but always mentions hash value hash value hash value so I get lost ;P
i have an idea !
i am persian one!
let me work on it tho
So it sends me to the hash function
article
16:51
turkish but persian too
in wikipedia
hash value is a number
it says it in the article more down bellow
just know that it will let you know its unique
that has nothing to do with your puzzle
just consume it in .Equals()
xD
hey @milleniumbug o/
@MehdiRostami let me just know something Meh
you will input data as what?
do you need to create the data from Persian?
or from Gregorian?
data is persian but need to converted to work with datetime
the code same as fiddle ,i gave
16:56
ok but you get the input from string like the one you showed, corrent?
ok
i will implement something here lets see if you like it
just don't judge me tho! o.o
i will get upset >.>
almost there....

« first day (2645 days earlier)      last day (2529 days later) »