« first day (2424 days earlier)      last day (2539 days later) » 
06:00 - 12:0012:00 - 00:00

6:35 AM
Mornin
 
Morning!
 
Good day gusy :D
guys*
 
So lets start the day of with a performance question: When using input buttons and forms in MVC, you generally have a model that you bind the buttons to. Now, does anyone know which type(s) can be used and which are best to use?

I've earlier used public string Confirm {get; set; } , but i'm starting to wonder if using a boolean would be a better option?
 
I think you can use boolean but just for enabling and disabling the button
but I would prefer string though haha
 
how is it optimization
 
6:45 AM
I dunno.
To be honest no fucking clue.
But i just figured that, if booleans were a option they would "process" faster than a string, plus, you could just do "if(Model.Confirm)" instead of "if(!string.IsNullOrWhiteSpace(Model.Confirm))"
 
does anyone here try to cut the array and place them in a list?
 
mhmm technically you are correct but its so so so minuscule that really at our time it doesn't matter
if this was 1980 then I would say godspeed
 
public class SeriesOfNumber
	{
		public int Number1 { get; set; }
		public int Number2 { get; set; }
		public int Number3 { get; set; }
	}

    class Program
    {
        public static void Main(string[] args)
        {
            string[] arrayString = { "1", "2", "3", "1", "2", "3", "1", "2", "3" };

            List<string> arrayToList = new List<string>(arrayString);

            var listOfSeriesNumber = new List<SeriesOfNumber>();

            foreach (var item in arrayToList)
            {
I'm just wondering how to cut them and designate the arrays in 3
Here's my actual code
 
7:03 AM
@mark333...333...333 Im not sure if I understand what exactly are you trying to achieve. Please tell what should the output look like.
 
The output should be like, the Number1 = 1,1,1 and the Number2 = 2,2,2, and for Number3 should be 3,3,3
 
7:32 AM
ohayou
 
    var firstAttribute = sortedAttributes.FirstOrDefault();
    if (firstAttribute != null)
how can this possibly do a compile error?
operator != null can't be applied to operands of type '(Attributes, Attributes') and <null>
what
literally what
 
8:13 AM
hi
why does this code piece give error?
var x = "phone"+ !string.IsNullOrEmpty(newObject.phone) ? newObject.phone: " empty" + "something"
ok I found
I should use parantheses
 
mr5
0/
 
Morning o/
 
mr5
@mark333...333...333 multi-dimensional array?
So Paul Allen was into something
 
OH FUCK
 
8:31 AM
....Thats a big plane
 
@mr5 ahm, I just want the string of array split into 3 lists
But I don't know how to supply it in the lists.
 
mr5
@mark333...333...333 I can't figure out what you are trying to achieve
 
I accidentally changed 80% of my products names to Malwi
XD
revert fast
gotta go fast
 
So, inside the arrayString, I have 1,2,3,1,2,3,1,2,3. But I want to put all the 1 to the list of Number1, the 2 to the list of Number2, the 3 to the list of Number3 @mr5
That's why I commented it out inside the listofSeriesNumber.Add(new SeriesNumber because I don't know how to do that :/
 
mr5
8:36 AM
@mark333...333...333 what's your goal? why would you want to do that?
you can simply achieve those using switch or if else statement
 
209
A: Why not to upload images of code on SO when asking a question?

Ken WhiteBecause Code in images can't be copied and pasted into an editor and compiled in order to reproduce the problem. Images are large and hard to read on mobile devices, and often cost mobile users valuable data that is limited. Images are often blocked by corporate proxies, and therefore the cod...

 
@KamilSolecki That sounds like a rather big problem
heh, big
God im a child
 
@mr5 I can't do switch because my array would be one and many
 
8 mins ago, by mark333...333...333
So, inside the arrayString, I have 1,2,3,1,2,3,1,2,3. But I want to put all the 1 to the list of Number1, the 2 to the list of Number2, the 3 to the list of Number3 @mr5
            string[] arraystring = { "1", "2", "3", "1", "2", "3", "1", "2", "3", };
            List<string> listof1 = arraystring.Where(x => x == "1").ToList();
            List<string> listof2 = arraystring.Where(x => x == "2").ToList();
            List<string> listof3 = arraystring.Where(x => x == "3").ToList();
 
mr5
@mark333...333...333 ^
 
8:44 AM
@mr5 it is just my sample numbers :) what if the array is 2,3,4,43,53,23,34,2123,334
The split is between 3
2,43,34 = Number1 because they count is under the split of Number1
 
@mark333...333...333 var group = arraystring.GroupBy(x => x).Select(x=>x.ToList()).ToList();
            List<List<string>> group = arraystring.GroupBy(x => x).Select(x=>x.ToList()).ToList();
 
3,53,2123 would be Number2
etc.
 
is someone interested in Dijkstra algorithm i am trying to implement it in python but there is some optimization problem
 
mr5
so each element would contain exactly 3 values only?
 
since example the whole array is compose of 9 numbers, we have to separate the first,second and third count and put them inside the array lists of Number1, Number2, and Number3 @mr5
 
8:48 AM
do i send my code if anyone want to take a look at it
 
@Kieran my script failed me :D
 
@mr5 are you getting what I'm saying? :)
 
Its all fine tho, the backup files are loading now
 
like this, 1,2,3,4,5,6,7,8,9 @mr5
 
mr5
@mark333...333...333 no
 
8:49 AM
Since our split is every 3
so Number1 = 1,4,7
 
mr5
what do you mean by split?
 
Number2 = 2,5,8
Number3 = 3,6,9
 
mr5
oh
 
Yeah :) exactly are you visualizing now? :)
 
mr5
and how do you want it to be stored?
 
8:50 AM
stored in the lists
 
mr5
so multi-dimensional array?
 
Inside my listOfSeriesNumber.Add(new SeriesNumber{//Here });
 
@KamilSolecki Yeah, if that was your intended usage I think i would be more concerned lmao
 
mr5
your proposed solution is of type of int. How are you going to retrieve back those?
 
I got no idea @mr5 :/
 
8:52 AM
what @nyconing works
        List<List<string>> group = arraystring.GroupBy(x => x).Select(x=>x.ToList()).ToList();
whats the problem?
delete everything leave this line
 
@misha130 That is what Im thinking
 
go figure
 
maybe he only accepting mr5 answer
 
mr5
lol
 
no the real reason is this is homework and they didnt cover linq yet
 
mr5
8:54 AM
I'm trying to make an alternative sol'n. @mark333...333...333 maybe you could look at nyconing's answer
@mark333...333...333 is this limited to 3 sets only?
 
probably for now, yes limited for 3. example 9 details inside the array
 
you no need that class
List<List<string>> is all your processed data.
if you still want to filled in class, wait i write for it
 
arraystring.Select((str,  index) => (index % 3) == 0? new SeriesOfNumber { Number1 = arraystring[index]...index+1...index+2 }:null);
I am too lazy for this
 
mr5
me too.
all I could think of is to use modulo operator
 
yeah I already considered using modulo :/
 
9:00 AM
Yay products saved!
we are victorious
 
            List<List<string>> group = arraystring.GroupBy(x => x).Select(x => x.ToList()).ToList();
            List < SeriesOfNumber > classlist = new List<SeriesOfNumber>();
            for (int i=0;i< arraystring.Length / 3; i++)
            {
                classlist.Add(new SeriesOfNumber() { Number1 = arraystring[(i * 3)], Number2 = arraystring[(i * 3)] + 1, Number3 = arraystring[(i * 3) + 2] });
            }
 
@Kieran I think I forgot to sort my arrays, that sounds like it could be the problem
 
ugly but I think that is you can understand
I going, good luck :P
 
@nyconing I got the list either let me show you :)
@nyconing
 
no, you copy it again
 
9:06 AM
...is that osx
 
Morning
 
o/
 
The output should be, like 1,4,7,2,5,8,3,6,9
 
@Kieran \o
 
Yes @Kieran Visual Studio for Mac
 
9:06 AM
HOws it going everybody ? I know it's Monday
 
5 mins ago, by nyconing
            List<List<string>> group = arraystring.GroupBy(x => x).Select(x => x.ToList()).ToList();
            List < SeriesOfNumber > classlist = new List<SeriesOfNumber>();
            for (int i=0;i< arraystring.Length / 3; i++)
            {
                classlist.Add(new SeriesOfNumber() { Number1 = arraystring[(i * 3)], Number2 = arraystring[(i * 3)] + 1, Number3 = arraystring[(i * 3) + 2] });
            }
you copy it again
it is edited.
@Mathematics blue
 
@nyconing mix some yellow, it will become green :)
 
mr5
and by green he means, weed
 
lemon or bananas
@mark333...333...333 it is because you array is a string array
 
mr5
9:09 AM
@mark333...333...333 that's a very simple problem. you go fix it yourself
 
@mr5 @nyconing yeah haha hold on
sorry
 
Receive data and perform operations on it based on it's TYPE, what sort of pattern should we call it
 
@mr5 weed legal in your country?
 
mr5
@Mathematics factory pattern. the factory receive the raw materials, they processed it depending on what factory they are. btw, this is not the real definition factory pattern
 
9:13 AM
@nyconing
 
mr5
@nyconing no. I haven't try to smoke one yet
 
The result should be like, 111,222,333 :)
 
........
 
mr5
and what did you get?
 
The Number1 should store the 1,1,1 and Number2 should store 2,2,2 and same with Number3 which is 3,3,3
I know it sounds tricky that's why need some serious help :)
 
mr5
9:15 AM
dictionary[value].Add(value)
 
Why do you actually need o store the original values, rather than just the count?
 
Because in my query, I receive the array of details where I need to breakdown them into set of lists
I'm just working on console app to make the output faster. When I'm done with this, I'll transfer this on my asp.net controller for saving
But right now I'm dealing with this issues. :(
 
arrayString.GroupBy(x=>x).Select(group => string.Join("", group))
 
that was mentioned before
 
9:22 AM
?
I really dunno why you want to do this
you must have some where wrong
 
as I said, my parameter in my controller is array of strings. :)
 
if you want, just adjust it little bit
 
mr5
sam ting wong
 
            List < SeriesOfNumber > classlist = new List<SeriesOfNumber>();
            for (int i=0;i< arraystring.Length / 3; i++)
            {
                classlist.Add(new SeriesOfNumber() {
                    Number1 = arraystring[(i * 3)],
                    Number2 = arraystring[(i * 3) + 3],
                    Number3 = arraystring[(i * 3) + 6] });
            }
 
honestly the method is just fundamentally wrong
why are these just random series of numbers
if this is an asp.net mvc/webapi project then why arent you passing objects that have a clear representation of your numbers
 
9:24 AM
Ahm so, how could save a set of array of string that you need to breakdown into different properties?
 
sry edited again. please copy it again.
 
using objects
as "containers"
also don't forget if you actually create an object called {number2:1, number2:2, number3:3} in your client and pass it to a controller action that has a parameter that receives a class
it will map that object to the class
so all of this is redundant
 
yes, using object as container. not array. +1 or json, or xml, there is many method is reliable than this.
 
Okai 2nd product name update
cross fingers
 
@nyconing
I got that error
 
9:28 AM
I might have missed the train here, but why are you iterating over a third of the array and calculating the indexes of further accesses?
 
also that might cause division by zero
 
mr5
@KamilSolecki are you doing a db update or just an ide refactor?
 
I mean, your loop index will reach arrayLength/3. Then you multiply it by 3, which should arrive pretty close to your array lenfth, and then add 6?
 
@mr5 db update through API
 
hahahaha
 
9:29 AM
as I do not have a direct DB access
 
what the hell
 
wait wat @mark333...333...333
 
For an array of length 6, you'll iterate between 0 and 1 (< 6/3 = 2). Then try to access position (1 * 3 + 6 = 9) in an array of size 6.
 
mr5
I think it should only be [i * 3 + 0], [i * 3 + 1], [i * 3 + 2], ... [i * 3 + N - 1] provided that you iterate only to N-1 of the total length of the array
 
come on guys this is insanity
 
9:31 AM
For an array of length 100, you'll try to access member at index 102.
This makes absolutely no sense.
 
opps
sry
 
Haha my mind is circle with arrays :p
 
[(i)+6]
 
Also, casting to Int16 is totally superfluous.
 
just taking out *3
no , all is redundant when the data is array.
 
9:35 AM
@nyconing it is working but I need to try with different characters or words :)
@nyconing doesn't work if I put the string
:(
 
mr5
@mark333...333...333 you just need to multiply the string to an integer
 
@mr5 and @nyconing I tried to change it to string but I got now the error in my ide as well my console just stopped
 
rofl
youre converting text to int16
since string are the integer inside, sure you can converting it.
but now it has chars inside it
you need to change your class
 
Oh I see haha yeah it's all int in my class :)
@nyconing You saved me :D
I got the right sequence depending on their array every third count :)
@nyconing another thing? can I ask another question? :)
 
9:51 AM
yes? just ask it. someone seen and will help as they can. you just no need to asking 2 question :P
 
mr5
supposed you have too much free time in your office, what would you guys do?
 
Thanks @nyconing :) what if the array is longer than 9 like, 100+?
 
@mr5 wast time on c# chat
 
mr5
@Proxy that's what I'm doing. Anything else?
 
@mr5 stealing resources on web.
 
9:59 AM
@mr5 Personal project of some kind
 
@mark333...333...333 your code is fine with the lenght of divided by 3.
 
Call it "Improving on your pre-existing skillset" when your boss asks
 
in case 3,6,9,12,15,18
 
@mr5 watch anime? or youtube
or if your ambitious read something up
or do some side work
 
Im working on android
so I will stealing animation, drawable, some kind of resources
 
10:01 AM
don't crush the phone
 
from samsung app, or huawei app
theres full of awesome resources from new S8
(excited)
or playing game.
 
mr5
@Proxy are yo guys allowed to do something non work-related on the internet? I would watch movies if they allow me though =P
 
@mr5 who cares? boss doesnt know. :DDD
 
does c# have simple method or function to compare "api/company/{id}" same as "api/company/12" ?
 
mr5
also doing some side projects is not allowed here. so I just basically stare at the monitor and pretend I am reading something that the company will benefit
@nyconing our internet traffic are being monitored, so there's that
 
10:06 AM
@Taurib "api/company/{id}".Replace("api/company/","")=="id"
@mr5 vpn
or using own networking
(I will)
 
mr5
nah, there are people passing behind me. I wouldn't dare also
 
its the params after .jpg
 
yes isnt that param are token to access jpg?
 
switch the language to csharp and your good to go
 
10:10 AM
in [iOS][Android][ChaosOverFlow], Apr 20 at 10:29, by nyconing
I always imagine I can developing under VR environment
 
Virtual desktop
sorted
 
Oh thanks @nyconing :) I'll tag you if ever I need some questions :)
 
this doesn't seem to exactly do the trick.
If I have incoming request to "api/company/12" and I need to check if that request matches "api/company/{id}"
 
@Kieran AWESOME!
 
10:12 AM
I really want a vive so i can play vr games
but i just know all i will use it for is that
so i can imagine im in a cinema
 
mr5
@Kieran wtf was that?
 
Its reddit
but it looks like its in code
the hint is in the name
 
@Taurib then what the only you need is REGEX RegularExpressions
not simple.
 
mr5
@Kieran aye! so it looks like I'm reading a code while actually reading some non work-related. cool!
 
Pretty much @mr5 c:
 
10:16 AM
alright
I'll look into it, thanks
 
mr5
I think that's the first thing in mind by the author
 
@Kieran although comments arent there :///
 
@KamilSolecki my good sir, that is where you are wrong
 
how
tell plox
 
Hint: Both those are clickable
loadcomments loads them on the entire page
 
10:19 AM
WAA
 
inline does what you think it would
 
so awesome
 
mr5
nah, inline will steal load all the comments
I thought they would use some kind of yield
 
inline loads them within the for loop
 
The tab title tho :D
Budget meeting agenda
 
10:24 AM
ikr
"why is a developer looking at a budget"
lmao
 
"he cares about company's money, he needs a raise"
There must be something focked up in my product updater method
until there all is fine
then suddently BAM
shit goes nuts
 
lmao
 
trust me, I wasn't lmao when Ive seen what has happened for the first time :D
 
instantregret.jpg
 
mr5
@KamilSolecki lmao
what page is that?
uh, which namespace rather?
 
10:33 AM
wait wait wait what are we talking about :D
@mr5
ah
the one kieran sent
main page
mr pirate*
 
mr5
@KamilSolecki this one. the codereddit
 
11:02 AM
!!rogue
 
@KamilSolecki And yet again, the chat has descended into the depths of silence
 
My silence is quite shallow, actually.
 
@mr5 i just started on my new job but i read manga sometime on my old one
 
@Proxy how is it so far?
 
okay i guess
i'm installing stuff
 
11:11 AM
Pillow factory? XD
 
if nothing i was at lunch with some coworkers. It went okay
so i guess that is good
 
@Proxy are you installing google ultron?
and adobe reader
 
can we receive JSON data as multipart request?
 
@KamilSolecki php storm :D
 
11:20 AM
get out
uh
Somehow @Html.Beginform isn't actually making a form
but instead
outputting this System.Web.Mvc.Html.MvcForm { somecodehere }
uh
!!kieran
 
Feb 27 at 16:02, by Kieran
Thank you for confirming im an idiot c:
 
caprica speaks the truth
 
Why nowhere in the docs did they bother to say that all set methods require pagination
And if you don't do it, you don't get an error - just weird stuff happens
 
where is that
 
11:44 AM
@Proxy I'd link you the docs but you need credentials to access them :(
 
Hi there
how can I read a json file from cshtml using VS?
 
Hi Everyone
I have an issue and I need to discuss it here
anyone interested ?
 
@FreedomDeveloper just ask your question. If anyone can / is interested in helping, he will
 
ok that's good
hmmm I am working on an integration testing task , and in that testing module I am trying to test a complicated action methods
in a controller
and one of the task requirements is to make an in memory database and ensure it is alive between the test methods I have writtien
if we assume that we have a controller A which has 4 action methods Insert , Select , Update and Delete
In my first method I checked the iserting process and the item is already saved in the in memory context
and in the next one i feteched it and to ensure that it is already saved
and so on
to keep the track of the Context changes I marked it as a static to be shared for the life time of the testing class
Everything works good and fine except the update process
the context couldnt save the changes happened on an an object
and I dont know why or how !
the next following screenshots will illustrate my issue ,
This is the context in saving changes stack and as it is shown the save changes return is 0
 
06:00 - 12:0012:00 - 00:00

« first day (2424 days earlier)      last day (2539 days later) »