« first day (3419 days earlier)      last day (1529 days later) » 

11:00 AM
also, it is bad to have constructors do anything... like... at all
 
Maybe wrap it in a try/catch and find out
 
if you dont know why it failed, you definitely need an exception at your entry point
 
Not if you want to make sure the class is contrcuted in a controlled manner
 
and log the exception
 
otherwise I'd have to open up the props as publically accessible
 
11:01 AM
@DAustin constructors should initialize properties
nothing else
 
exactly
 
> OrderImport unused = new OrderImport(Order);
what does that do?
 
Builds the order object
 
so, it doesnt do anything?
 
so we have like 4 separate tables for different types of orders (not my design)
these get imported to 1 table wit ha different "type" on our backend
 
11:02 AM
but you dont add it to your database context
 
so the Contrcutor takes any 1 of the 4 types, and builds a SystemOrder from it to be loaded into the back end
there are 2 contexts sorry
1 for the web server
1 foir the back end server
I'd have it as 1 context, but I cannot seem to get the Ditributed Transaction Co-ordinator to work through our firewalls
So I worked around that
by using 2 contexts and a bunch of views/synonyms
so its 1 way, get info from the website, pass it to the back end, no need to sync the data there
I know its bonkers
 
I would highly recommend fixing your logging first
> no idea, its failing silently
 
It's what Im doing right now lol
 
this should not happen
 
hence why I was asking if I should be putting exception handling within the OrderImport class as well
 
11:05 AM
find out what could fail and find out for each situation how you want to handle that case
@DAustin not before you know exactly what you want to do with those exceptions
 
yes I agree, am working on it today
 
if your OrderImport handles them silently, you are just further away from having any guarantees of the processing result
 
well you touched on it pal, need to log/email so I know what the problem is
when i run locally on debug after a silent failure, everything is ok
so it looks like a network or FileIO problem
as if it was a data issue I'd get it everytime
 
> after a silent failure, everything is ok
uhm... what?
what is your definition of "failure"?
 
@Wietlol My thoughts lol
Orders stop gettin imported
So I stop the service, boot up the debug version on my local machine and....everything is ok
 
11:11 AM
oh, I thought you meant when you get a silent failure locally
 
so i restart the service and... everything is ok
ah
well anyways time for a bollocking, if I should only be setting proerties in the contructor you'll porbably have kittens, here's an example of the TradeOrder constructor:
public OrderImport(TradeOrder tradeOrder) {
Customer customer = new Customer().GetCustomer((int)tradeOrder.CustomerId);
//Console.WriteLine(customer.AccountNumber);
DateTime Now = DateTime.Now;
using (var _ctx = new CoreModels())
{

this.SysOrder = new SystemOrder()
{
CustomerId = tradeOrder.CustomerId,
ordItemAdd1 = customer.Address,
ordItemAdd2 = customer.Address2,
ordItemCity = customer.City,
ordItemState = customer.State,
ordItemPostCode = customer.Zip,
ordItemCountry = !String.IsNullOrWhiteSpace(customer.Country) ? customer.Country : "UK",
and yes you read that right:
ItemQty = tradeOrderItem.Qty.ToString()
Because the devs that came before me were amazing, storing ints as strings and ID ints as decimals in the DB
 
ye... this is not my favorite constructor
sounds more like an order importer service
 
yeh that's exactly what it is
so I have 4 diff classes to import into 1 class on the other end: i.e. TradeOrder -> SystemOrder or StoreOrder -> SystemOrder or DropShipOrder -> SystemOrder lol
again, working with what others did before me here lol
I mean I could move the logic out of the contructor, but then I'd just be calling that method from within the contructor anyways?
 
Guys when you talk about C# exclusively this place really gets boring
 
true
!~shiba
 
I could take this out of the class library, but then I couldn't import orders from any new app by just calling OrderImport(OrderType Order), which is really handy
 
like for the API that no one uses :'(
 
@DAustin you call the constructor from that new method
 
11:18 AM
yeh
sorry i'll get off the C# talk in a sec
:P
bare in mind my code is 100% self-taught
though I do have 1 question regarding the constructor
I call .SaveChanges() on the SystemOrder in order to get the ID to use on the SystemOrderItems. This obviously requires 2 saves to the db and the potential for data to get lost
 
@DAustin don't, that's what this room is for
 
Is there another way?
 
though I miss the memes, @Neil riddles, @AvnerShahar-Kashtan stories, etc.
 
this bit:
_ctx.SystemOrder.Add(SysOrder);
_ctx.SaveChanges();
foreach (TradeOrderDetail tradeOrderItem in tradeOrder.Items)
{
SysOrder.SystemOrderItems.Add(
new SystemOrderItem()
{
ordNo = tradeOrder.ID.ToString(),
SystemOrderId = SysOrder.Id,
ItemID = (int)tradeOrderItem.Product_ID,
ItemQty = tradeOrderItem.Qty.ToString(),
ItemPrice = tradeOrderItem.Price,
CustomerId = tradeOrder.CustomerId,
impType = SysOrder.impType,
impDate = SysOrder.impDate
}
);
}
_ctx.SystemOrderItem.AddRange(SysOrder.SystemOrderItems);
 
this is Entity Framework?
 
11:21 AM
yeah, 6.1.3, because the backend db is sql server 2005 :'(
 
usually, you would just have entity mapping
you shouldnt care about the ids
 
@HéctorÁlvarez How about this one:
 
tis what I thought, but no one here to ask lol
so if I rewrote it quickly, can I paste it back here for a quick once over?
 
public class Order
{
	protected Int32 Id { get; protected set; }

	public virtual ICollection<OrderItem> Items { get; protected set; } = new HashSet<OrderItem>();
}

public class OrderItem
{
	protected Int32 Id { get; protected set; }

	protected Int32 OrderId { get; protected set; }
	public virtual Order Order { get; protected set; }
}
like that
 
actually no need, I assume I just take out the first call to savechanges, and the manual ID property set on the Items?
 
11:23 AM
Q1)  What is the first question that has as a correct response the letter c?  a) Q3  b) Q4 c) Q1 or d) Q2?
Q2)  What is the first question that has as a correct response the letter a?  a) Q4 b) Q2 c) Q3 or d) Q1?
Q3) What is the first question that has as a correct response the letter d?  a) Q1 b) Q2 c) Q4 or d) Q3?
Q4) What is the first question that has as a correct response the letter b?  a) Q2 b) Q4 c) Q3 or d) Q1?
 
I've got my mapping Wiet
 
@HéctorÁlvarez
 
you should only set the Order property, not the OrderId
on SaveChanges, it will automagically set the ids correctly
 
11:24 AM
cool
 
this is the relationship on SystemOrder
[ForeignKey("SystemOrderId")]
    public virtual ICollection<SystemOrderItem> SystemOrderItems { get; set; }
and the reverse
public virtual SystemOrder SystemOrder { get; private set; }
 
new SystemOrderItem()
{
	SystemOrderId = SysOrder.Id,
}
your code says otherwise
new SystemOrderItem()
{
	SystemOrder = SysOrder,
}
 
Welcome to the joys of people not using standard naming
 
should be sufficient
@DAustin it is not a naming thing
in your code, you manually set the binding ids
 
11:27 AM
lol if you give me a chance to explain
ah gotcha, was looking at the wrong bit
yeh, I know no need to do that
 
so, you dont need 2 SaveChanges, right?
 
wasn't sure when I wrote it, just wanted something tat worked, but ended up adding an opportunity for data to be out of sync with the 2 saves
yeh we've been through this above lol :P
 
@Neil I see you formatted the question, are spaces relevant?
 
1 call to savechanges at the end would do the trick, and remove the manual id assignment on the child entity
 
@HéctorÁlvarez no, it was just a pain in the ass to type
 
11:29 AM
and wrap in a try catch block?
 
but if it isn't clear, just ask
 
or do I do that only on the caller?
 
Jack, What is the first question that has as a correct response the letter c?
 
damn
 
11:29 AM
it certainly is, but my sharingan told me something was off.
false alarm
 
> Jack: Is that even english?
@DAustin often, you dont want to catch
 
come on, jack. You're supposed to be AI
 
well it's for an automated service, so I don't want it to terminate
 
either your code does not catch, or has very special logic to handle the exception
@DAustin still, your library should not catch
 
guess I gotta go with option 2
 
11:31 AM
your entry point should
 
thanks, that's what I needed to know
 
@Neil he's just running a series of shit if statements
not technically an ai
 
if statements are decision making
 
Well I am not so sure now, I thought everything would click together if I found the right question, but there's no single answer that satisfies everything
 
so... technically an ai
 
11:31 AM
there's nothing intelligent about him
 
so the entry point would pick up the exceptiontype from the constructor?
 
let me get this clear, is the goal to find the correct question?
or is that too simple a guess...
 
i.e. if it was a network/sql connection error or a file write error?
 
@Neil I dont get the questions
I only get a syntax error
 
Because if I follow basic logic, Q2 is the right answer
 
11:34 AM
@DAustin the entry point would catch all exceptions and log them
perhaps just append to a file for the time being
 
but Q1 has no answer, Q2 = a, Q3 = a, Q4 = a
so unless Q1.a is actually Q2 instead of Q3 this doesn't make much sense
that would make the answer
a
 
isnt Q1 correct?
 
I already have an Email and Log Class, so I'll just throw it through them, if I get neither then I know something waaaaay worse is going on lol
 
@Wietlol meh it's probably the wrong logic
 
brb, cheers for the pointers guys, very much appreciated
 
11:37 AM
Q1) What is the first question that has as a correct answer on the letter c?
a) Q3
b) Q4
c) Q1
d) Q2
 
it's just a Q&A, but the answers must be "correct"
 
if it is c, which would be Q1, then it would be correct
 
and the answers you choose for the various questions changes what is correct for the others
 
and Q1 is definitely the first question
oh, all must be correct?
 
well yeah
 
11:38 AM
yes but Q2 must be wrong
 
objectively if you look at each question on its own, you could make them correct by making the right answer be the very same as the letter that it must match.. all except one that is
 
All 4 Qs make it impossible to answer uniquely. So the logic must be something else
 
for example the answer of Q1 could be c.
only Q2 doesn't work that way
so my advice is to focus on Q2 first
 
Oh look, a bird! (spoilers)
2 certainly is a funny one
 
uh none of the questions really seem to be answers
because all 4 questions have one answer they aren't present in
 
11:50 AM
 
@HéctorÁlvarez I promise there is a combination that works
 
OK so let's rubberduck a bit
 
where the answers to all four questions can be correct
 
assuming one Q is right
 
assume all four must be right
 
11:52 AM
Q1 has no answer in b, Q2 has no answer in c, Q3 has no answer in b, Q4 has no answer in d
 
@HéctorÁlvarez why not rubbre duck a byte?
 
29 mins ago, by Neil
Q1)  What is the first question that has as a correct response the letter c?  a) Q3  b) Q4 c) Q1 or d) Q2?
Q2)  What is the first question that has as a correct response the letter a?  a) Q4 b) Q2 c) Q3 or d) Q1?
Q3) What is the first question that has as a correct response the letter d?  a) Q1 b) Q2 c) Q4 or d) Q3?
Q4) What is the first question that has as a correct response the letter b?  a) Q2 b) Q4 c) Q3 or d) Q1?
 
Q1) Question with answer on letter c?  a) Q3 b) Q4 c) Q1 or d) Q2?
Q2) Question with answer on letter a?  a) Q4 b) Q2 c) Q3 or d) Q1?
Q3) Question with answer on letter d?  a) Q1 b) Q2 c) Q4 or d) Q3?
Q4) Question with answer on letter b?  a) Q2 b) Q4 c) Q3 or d) Q1?
 
why couldn't Q1 be b?
 
V.7
@DKDhilip jezzz.
 
11:54 AM
question one is, what is the first question such that the correct response is the letter c..
 
oh fuck I understood
 
if you say b for question one, you're not necessarily wrong
 
I was looking for something else
like seeing this question answer all questions
but it's actually another thing, let me try
 
@ABuckau The way I understand it putting a collection in an IEnumerable<Task<int>> means that you don't need to write a for loop, while loop or foreach loop to iterate the collection instead you can just use ToArray(), ToList() which implies (i.e. triggers) a loop. In other words, you iterate an IEnumerable<Type> using the methods ToArray(), ToList() etc., not an explicit for statement, while statement or foreach statement.
 
Q2 is correct
because the other 3 can't be
Q4 c and d are wrong
Q1 d is wrong
Q3 c is wrong
Q2 is the only one where all 4 answers are correct
so
what am I looking for
 
12:03 PM
lol you guys still trying to figure that one out?
not that I have any idea
 
the answer is beer
to all the questions
 
@Neil what are you expecting, a letter, a question number?
or should the answer be obvious
 
"enumerate is a verb/action: to use the collection: to go over each item" so IEnumerable<Type> means a class that goes over each item in a collection.
 
@HéctorÁlvarez letter works fine
 
then the answer is B I think
it's the only one that fits
wait I'm going to test
 
12:12 PM
@MyWrathAcademia It's not always advisable to .ToArray or .ToList an IEnumerable, since it may be something without an end. Most of the time an IEnumerable will be a List or something, but it may aswell be a function. You could for example implement the fibonacci function as an IEnumerable.
 
@HéctorÁlvarez there are four questions, man
I need four right answers
 
ooooh
ok im on it
 
what did you do in school when the teacher gave you a quiz with 10 questions? answer just one?
 
C, B, D, B
@Neil
 
If the last question is "Just answer question 1" then yes, I'll answer only that one.
 
12:20 PM
is there a name for the paper-punched code Hector posted in the starred comments?
 
Punched cards
 
oh, that's it? hm
 
@HéctorÁlvarez eh no
 
no?
 
12:22 PM
@Neil wtf you mean no, the answer is flawless
 
always beware of backstabbers
 
for question 2, you're saying the first question where "a" is the right answer is question two.. but you're answering B
don't think you understand the question yet
 
aw damn you are right
i thought i was there
 
you can't answer "b" where it is written question 2, when the question being asked is "what is the right answer where "a" is the right answer
 
apparently this is also called Hollerith code
 
12:28 PM
"Lochkarten" in german - hole cards.
C B D B DOOOOO
 
@Neil But A points to Q4A, which points to Q2B, it's an infinite loop
Q2 c and d cannot be
 
@Hans1984 damn u mean hans
 
beware!
they smile in your face and laugh behind your back
 
Beware- hans is there
 
so either B has no valid answer or I'm missing something critical
 
12:31 PM
@Squirrelintraining lol
 
@HéctorÁlvarez i'll give you another hint. every letter is used exactly once
it works out that way
 
I think my brain is melting
let me start over
 
aaaand the Xbox One dashboard is getting its fourth major revision....cause ms can never decide what it wants its system UIs to look like
 
you have questions that point to answers that point to more questions, right?
you need to think in terms of what a solution to such a thing might look like if it were a graph
but if that's just more confusing to you, then disregard
or you could just write a program that solves it :)
 
lets see now
Q1 seems to have C as answer
Q2 likes A
Q3 seems to be D
 
Q4 has no possible answers
 
@CaptainSquirrel lerl
Mi like
 
@Squirrelintraining idk why but it just popped into my head
 
because A says answer is answer is at Q2 which points back here
B sayis the answer is the same as Q1
C and D are wrong
 
12:40 PM
wtf is this
 
Goood music
Well the first
and the second
 
I mean, i don't doubt the fact that its nice music
its heavish metal so thats quite gud
 
so to say
 
but the first 5 seconds are rather nsfw
I feel like the first is a deliberate skit of the second video @Squirrelintraining
 
@CaptainSquirrel Ya me to
Don't know why tho
 
12:42 PM
Q4A says the answer is Q2
 
god knows
oh boi
 
If I were to guess the answer would be B on 4
but w/e my brain is hurting
 
This config i added to our project isn't being copied to the output folder when its building and pushing to int
EXCELLENT
 
@HéctorÁlvarez it can't be a for question 4, because that would imply that b is the right answer for Q2, and that's a direct contradiction
 
@Squirrelintraining ja mei, g'schungeld wird
 
12:44 PM
@Hans1984 War klar dass so etwas von dir alter Sack kommen muss :D
 
V.7
What about Doom Metal one? https://www.youtube.com/watch?v=l87xf49dZFU
What about strange some? https://www.youtube.com/watch?v=h_TUP2vuaDs
What about cyber one? https://www.youtube.com/watch?v=2ovZgUU9kgM
 
anything that suggests that b is the right answer for Q2 is wrong
 
;)
 
sry I meant Q1
 
and therefore anything that suggests that a is the right answer for Q4 is wrong as well
 
12:45 PM
not realy my type of music though
 
yes
that's OK
 
@HéctorÁlvarez so answer is d for question 4?
 
not likely
 
I mean, any music that is doom is instantly metal
 
C and D can't be
 
12:45 PM
RIP AND TEAR INTENSIFIES
 
hector still trying to solve it?
 
no in fact.. that says that question 4 has answer c if that were true
 
exactly
 
@Neil my guess was corrent, no?
 
i didn't draw lines to see the flow
but I see the pattern
 
12:46 PM
@V.7 eh, they all fall into the "OK" Range
 
V.7
Hope so ;D
 
@Wietlol I have no idea what you meant by that, sorry :P
 
the only doom metal i need in my life is this
 
if it was B, that would be wrong, because the first question where the question is the answer on B is Q1, so it would make sense that D was the answer
but that's not possible
 
@Neil my answer (which I posted a while back) is correct?
 
12:47 PM
@Wietlol I didn't see any answer
 
Unless you mean B is right becuase d (q1) is where the answer actually is
 
@Neil there
(I edit messages to hide spoilers)
 
@Wietlol ah, I didn't see that
yeah, seems you got it right
 
ok
 
that's going to drive @HéctorÁlvarez mad though
 
12:48 PM
HERE COMES THE DOOM
 
oh, I know
 
no fucking way
explain please
 
(removed)
:)
Oh look, a bird!
 
it's important to keep in mind that a question's answer could be wrong because of other answers
that doesn't mean it is always wrong
 
@Wietlol naaaananana now you explain it
 
12:50 PM
it's about finding the right combination
I wouldn't exclude the possibility that he googled the answer
 
well I can tell you CAD work
he most likely did
 
afterall, that's what we're good at
 
-.-
where's the fun
 
@Neil I exclude the possibility that this is a common riddle... you know... the lack of proper english
Q1) What is the first question for which 'c' is the correct answer? a) Q3 b) Q4 c) Q1 or d) Q2 ?
Q2) What is the first question for which 'a' is the correct answer? a) Q4 b) Q2 c) Q3 or d) Q1 ?
Q3) What is the first question for which 'd' is the correct answer? a) Q1 b) Q2 c) Q4 or d) Q3 ?
Q4) What is the first question for which 'b' is the correct answer? a) Q2 b) Q4 c) Q3 or d) Q1 ?
 
@HéctorÁlvarez does this help?
 
12:53 PM
what's not proper about this?
 
in my mind, it was just a syntax error
 
Murmaider, Murmaider, Murmaider, Murmaider, Murmaider
 
> What is the first question that has as a correct response the letter c?
oooh, you are missing commas
What is the first question that has, as a correct response, the letter c?
 
engrish, mf, do you speak it?
 
12:55 PM
y-y-yes
Jack, engrish
 
I don't understand mate
 
ofc you dont
im sorry for disturbing you
still, I would phrase them differently
perhaps just
> What is the first question that has the letter c as a correct response?
 
You england are bery powderful
 
I wonder
if i make j.doe a room owner while he is banned
 
I wonder how, I wonder why
 
12:56 PM
will he actually be able to do anything?
 
banned = banned, no?
 
well sure, he might not be able to talk
 
if admin is banned, he could prolly unban himself, but he still cant talk
 
but can he edit the chat description and kick people and stuff
 
that is how most systems work afaik
he probably can edit room settings and kick people, ye
 
12:59 PM
would care to elaborate why CADB is wrong?
 

« first day (3419 days earlier)      last day (1529 days later) »