« first day (3132 days earlier)      last day (1815 days later) » 

1:29 AM
RTL
 
 
4 hours later…
5:07 AM
hye anybody here?
i have a dout about can a session value can be pass to a class.cs file from name.aspx.cs file?
 
5:28 AM
hi
Can anyone collaborate with me in coding ? jdoodle.com/compile-c-sharp-online#&togetherjs=seUHUxpKhf
 
6:15 AM
using System;

class Program
{
public static void Main()
{

}
//what is the minimum possible value of x that doesn't cause an underflow
//what is the minimum possible value of x that doesn't cause an overflow

float f(int x)
{
return 1/(float)(2*x);
}
}
 
Goooood moorniiiiiing CeeeeShaaarp!! Have you done any large refactorings lately?
!!tell karan format
 
@karan Format your code - hit Ctrl+K before sending and see the faq
 
using System;

class Program
{
    public static void Main()
    {

    }
    //what is the minimum possible value of x that doesn't cause an underflow
     //what is the minimum possible value of x that doesn't cause an overflow

   float f(int x)
   {
       return 1/(float)(2*x);
   }
}
 
Rob
\o/
 
@karan This ain't homework service.
\o/
 
6:21 AM
Hey guys!
 
Sorry. It's not homework. I literally don't understand @RoelvanUden
 
what is the minimum possible value of x that doesn't cause an overflow
 
Is it ok if i ask for some hints on a homework I'm doing
 
I guess. if your x is int, then int.MinValue
 
Okay
 
6:29 AM
Is there any chat room for MFC?
 
So I have a .txt file that I'm writing to that contains, in each line, a string of information. Each line has an ID, and some information on it regarding that ID. I need to change in a specific line using the ID, some new information or change a specific information. So if a line is ID: 123456|HasCake: false| and I need to change if that ID 's HasCake, how would I do that?
 
@cybernautmik Read the file in lines, parse each line into an object, swap the object values as applicable, serialize each object into a line, write to file.
 
thanks Roel
but im having trouble differentiating each line
 
nevewr mind
 
6:33 AM
Paste your txt file content here gist.github.com
 
Thank you I'm gonna try it out
 
Alternatively, use a FileStream and a StreamReader with ReadLine (docs.microsoft.com/en-us/dotnet/api/…). It's a bit more involved, but so much faster. Probably not necessary for homework-scope tho.
 
Could someone please help me?
 
Currently I've been using File on all file processes or methods
 
Yeah that's fine for smaller fines. But imagine having to read a 1GB file into memory, you can probably be smarter to deal with that :-P
@G.Alexander MFC, as in, Microsoft Foundation Class? Perhaps the C room?
 
6:37 AM
Yes definitely!
I'm still quite the novice as you can tell
but thank you for the help! I'm gonna try those out
 
Good luck!
 
Hi guys
public string CategoryIds => _categoryIds;
public void Foo()
{
      var parsedCategoryIds = _categoryIds.Split(',').Select(x => int.Parse(x)).ToArray();//error on Select method
}
Error : string[] doesnot contains definition for Select method
Whats the problem here I am not getting
 
Rob
Have you included a reference to System.Linq at the top of your file?
using System.Linq;
 
Oh shit man
I am way too stupid
Yes i forgot to include that
@Rob Thank you so much :)
 
Rob
No problem
 
6:47 AM
There are quick fixes in VS that can detect and fix such issues for you.
 
Actually i was not believing that i could do such stupid/silly mistakes hence i thought its a different error
 
yo
@RoelvanUden C++, I believe.
 
good morning
 
7:02 AM
o/
 
Anyone good at searching here
 
ohayou
 
That's basically part of the job description
 
@Squirrelkiller what searching ? lol
 
yup
Google-Fu is an important skill for software developers
5
 
7:05 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
 
Hey ho!
 
@Squirrelkiller I can support the first message i read in chat today, it'sa good day
 
Here is my problem,

Using any programming language, I want to be able to generate a video from variable number of images and random effects like zoom in and out, fade in and out

but I am not finding a single solid source and I am searching for few weeks now I think
I found videshow nodejs package but it gets stuck
I tried FFMPEG but there is no way to make it work for variable images
 
You wanna make an animated gif?
Maybe use that for search terms
then go from there
 
7:11 AM
no, this is what I want to achieve,

- Create Video using Images
- Add audio to video
- Add some text to each image, using MoviePY in python
more like a images slideshow video generator
its seems easy with Linux, but I have windows
thanks but....

Windows Build Notes
Don't do it. It's not supported. Instead you have to cross-compile for Windows from a Linux box. Sorry.
I don't understand why windows don't support such a basic functionality
 
@Mathematics It's not Windows. It's this particular software package which was written for linux.
 
hmm...
 
Trust me I am searching for a while now, but nothing solid is coming up
I thought it was such a basic task
 
Is it? It seems like a relatively specific, niche task.
 
2
Q: Creating an FFmpeg image slideshow with zoompan and fade in/out

KostasI've been trying FFmpeg through whatever tutorials I can find over the internet and I'm a bit puzzled as to how to combine a zoompan effect with fade in and fade out of a series of images. A got to the following after combining bits and pieces of examples I found but it looks like the result I g...

 
7:14 AM
I'm not saying it's impossible in Windows. Pretty sure there are plenty of packages that can do it.
 
FFmpeg can get it done but everything is hard coded
 
ffmpeg works fine on windows.
We use it as part of a UWP-based video player control.
The problem with ffmpeg is that it exposes a C++ API which can be a pain to interop with from .NET, but not impossible.
 
@AvnerShahar-Kashtan there are few wrappers in .net, JS, python but are not either as simple or work at all
To be honest, I think I am not using correct keywords to search for what I want
 
How about something like "c# build movie out of images"?
Brought me this:
54
Q: Image sequence to video stream?

Hauns TMLike many people already seem to have (there are several threads on this subject here) I am looking for ways to create video from a sequence of images. I want to implement my functionality in C#! Here is what I wan't to do: /*Pseudo code*/ void CreateVideo(List<Image> imageSequence, long durat...

 
0
Q: How to add zoom transition effects using FFmpeg to a variable number of images?

MathematicsHow can I add add zoom transition effects using FFmpeg to a variable number of images? I am able to create video from a variable number of images but I am not sure how to add zoom in and out transition effects between images: ffmpeg -framerate 1/5 -i img%03d.jpeg -c:v libx264 -r 30 -pix_fmt yu...

 
7:22 AM
An alternative to complex binding to ffmpeg's libraries is to use C# (or JS, or Python) to get the image files, the music file, the text files, everything, arranged nicely in a folder pattern, then build the complicated ffmpeg command-line and execute it.
 
I can create video using this ffmpeg command

ffmpeg -framerate 1/5 -i img%03d.jpeg -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
what I want next is to add transition effects, but I don't want to hard code like in another example I showed above
 
So write code to build the command-line dynamically.
ffmpeg probably supports getting its input from an file, rather than on the command line itself. Write code to build that input parameter file and feed that to ffmpeg.exe
 
Guess I am getting there...

https://github.com/transitive-bullshit/ffmpeg-concat

only thing is that it takes in video files
@AvnerShahar-Kashtan good point, I considered it, but yet to find format that works with windows
 
if someone says "I only accept dates in the format 'YYYY-MM-DD', is that a silly statement?"
I was thinking, if I paste this format to a formatter for DateTime, it gives me YYYY-04-DD
(04 is the month)
but I guess that other libraries or in other languages, this format might be perfectly fine
however, then the question is "do you want a 2 digit month and a 2 digit day even if the value is below 10?"
and other stuff
 
Maybe just a human pseudo, not a format for machine.
 
7:37 AM
now my question is, is there some standard in which formats should work?
I know of ISO, but I dont think it gives much self-composed formats
 
Hi guys
I have a code like this :
public sealed class VariantProcessor : IVariantProcessor
{
    private readonly Action _transform;
    private readonly Action _deleteStep1Data;

    public Variant(Action transform, Action deleteStep1Data)
    {
        _transform = transform;
        _deleteStep1Data = deleteStep1Data;
    }
}


public class AggregateCalculator : IVariantProcessor
{
    public void Process(Variant model)
        => new VariantProcessor(Transform(model), DeleteStep1Data).Process();

    private void DeleteStep1Data()
But i am getting error here :
new VariantProcessor(Transform(model),
Error : Cannot convert from void to system.Action
 
> Transform(model)
have you considered what this does?
 
Transform is a method and its needs model
 
true
but that does not answer my question
 
Its a pointer to a method
Action is a delegate which is pointer to method
 
7:44 AM
that is partially true, and still doesnt answer my question
 
@Wietlol ISO gives you the ISO format itself. If you're talking about the standard for specifying time formats, than I don't think there's a single format. PHP has a commonly used one (commonly used because so much of the web was built in PHP for so long). .NET has another. They're all similar but not identical.
 
@Wietlol Sorry then what i am missing?
Could you please point out as i allways have hard time with delegates
 
its a function/method invocation
 
@ILoveStackoverflow What @Wietlol is getting at is that when you're specifying Transform(model), you're calling the method, not passing the Action delegate in.
 
you invoke the function Transform by passing the values from model
the result of the invocation is void
per private void Transform(Variant model)
 
7:47 AM
Opps
 
^ true Dev Ops
 
If what you want is to pass in an Action that, when invoked, calls Transform(model), you'll want to pass in an anonymous delegate, () => Transform(model).
 
what you want is either a lambda, where you call the function inside the body
or you want to use a partial application
partial application can be achieved by extension methods on the types Func<> and Action<>
 
Actually i am trying to follow this answer :
2
Q: Way to hide logic behind class for better readability of method and refactor class to follow SRP

ILoveStackoverflowI have an algorithm to create a version for an entity and then I save that version against below 2 entity: 1) Variant 2) Category interface IEntityVersion { string GetVersion(); } public class EntityVersion : IEntityVersion { public string GetVersion() { return null; }...

 
> asked yesterday
i thought it was older
 
7:49 AM
@Wietlol If you remember we had a discussion on this where you suggested that whole IRollback part
 
pretty much
 
@AvnerShahar-Kashtan Isnt there is more appropriate way to just pass action delegate with parameter ?
 
@ILoveStackoverflow As you see, in the answer, he's passing in the AggregateCalculator's Transform method as the Action. I think it makes sense there to store the Model passed to the ctor as an instance field, and have Transform access that.
 
I dont like this syntax : () => Transform(model)
 
Transform.Lp(model)
 
7:51 AM
@ILoveStackoverflow The issue is that your VariantProcessor doesn't know about Models. It just knows that it has to take an Action and perform it. It doesn't take an Action<Model>, just an Action.
 
public static Action Lp<T1>(this Action<T1> func, T1 t1) => func.LeftPartial(t1);
public static Action LeftPartial<T1>(this Action<T1> func, T1 t1) => () => func(t1);
 
Since you're in the context of an instance of AggregateCalculator, you can simply change Transform to not take a parameter and read it from the field.
 
public interface IVariantProcessor
{
    void Process(Variant model);
    StatisticsModel Process(Variant model);
}
 
But if AggregateCalculator is stateless, then yeah, you need to transform your call to Transform(model) to a parameterless Action, which means the () => Transform(model) lambda wrapper, or @Wietlol's ever-more-complex examples of currying and partial function application.
 
Actually I have 2 methods inside IVariantProcessor
 
7:54 AM
@AvnerShahar-Kashtan I still dont understand your definition of "complex"
partial application is pretty simple
 
So when i will create instance of AggregateCalculator/AdditionCalculator those fields inside derived class will hold memory unnecessary right?
@AvnerShahar-Kashtan
 
@Wietlol I think it's very useful, but it's certainly a complex topic.
 
If i take model as instance field in derived class
 
@ILoveStackoverflow I'm not sure what "hold memory" means here. If your AggregateCalculator is stateless, meaning it can processes several models concurrently, than no, you shouldn't keep the model in a field (not because of memory usage but because of correctness)
 
the funny thing of partial application is that it is not always partial
 
7:57 AM
I am confused whether to take Variant model model as instance member of class or not
Should I ?
 
8:26 AM
It's back!
 
8:48 AM
Works on my phone (local 4g connection), not on my computer (work network routed through the UK)
 
What does?
whoaaaaaa
 
Chat.
Whee, we're back!
 
There was like 8 people all came in at once
 
That's because Chat was down for various places around the world (possibly a DNS error) and suddenly reconnected.
14
Q: Chat.se, chat.so and chat.mse seem to be down

Journeyman GeekThere seems to be some kind of trouble with both the main, SO and SE meta chats - All three servers are pathping seems to indicate something's fishy on the NY side of things. Could y'all take a look please? Tracing route to chat.stackexchange.com [198.252.206.29] over a maximum of 30 hops: 1...

 
Oh I hadn't even noticeds
 
9:08 AM
We're back, yay!
 
9:20 AM
@AvnerShahar-Kashtan I checked isitdownrightnow.com and it was down for them aswell
 
9:36 AM
chat was rip?
 
9:59 AM
chat is always rip
 
So this chat room was done
I thought there was something wrong with my internet
Was struggling for quite sometime to open this page
 
i figured it was my proxy
@Proxy damn you!
 
I am getting error on LeftPartial function
 
@Wietlol
public static Action Lp<T1>(this Action<T1> func, T1 t1) => func.LeftPartial(t1);
public static Action LeftPartial<T1>(this Action<T1> func, T1 t1) => () => func(t1);
 
10:14 AM
   var myAnonyClassObject = new[] { new { Name = "Abhimanyu", Age = 21 } };
how do i return this?
public anonymous object? GetTimeDifference()
never mind
public object** is the answer
 
@ILoveStackoverflow cool story
@Adan keep in mind that when you return it, you lose all forms of information of its structure
since there is no identification of the type
 
how do i overcome it?
 public object GetTimeDifference()
        {
            DateTime startTime = DateTime.Parse("05/13/2019 9:23");
            //DateTime.Now.ToString("MM/dd/yyyy hh:mm tt")	05/29/2015 05:50 AM
            //05/29/2015 05:50:06
            DateTime endTime = DateTime.Parse("05/14/2019 18:23");
            //DateTime.Now.AddSeconds(75);

            TimeSpan span = endTime.Subtract(startTime);


            var myAnonyClassObject = new[] { new { HOURS = span.Hours, MINUTES = span.Minutes } };
            return myAnonyClassObject;
 var hours = Model.GetTimeDifference()[0].Hours;
 
mr5
Does Task.Run ever run on main thread (threadId: 1)?
 
not using anonymous objects
also, naming things is case sensitive
HOURS != Hours
 
mr5
10:29 AM
@Wietlol what if someone overrides the !=?
 
what if someone overrides the != operator in English?
 
@Wietlol how do i return HOURS/MINUTES ?
 
a data class
or model class
 
@Adan geez, no need to shout, man
 
what do you mean?
 
10:31 AM
@Adan You really shouldn't be returning anonymous objects out of their scope.
@Adan Instead of an anonymous object, you can return a value tuple.
 
i like that
 
Or, you know, you can return a TimeSpan, an object expressly designed to represent this exact sort of data.
 
perfect:
 return Tuple.Create(span.Hours,span.Minutes);
avner you are a scientist
 
No, no, that's an old Tuple. Use value tuples instead.
 
@Adan HE_MEANS_THAT_WHEN_YOU_WRITE_USING_CAPS_OR_SHIFT_IT_LOOKS_LIKE_YOU_ARE_SHOUTING_ALL_THE_TIME
 
10:33 AM
public (int Hours, int Minutes) GetDifference()
{
   return (span.Hours, span.Minutes);
}
 
 
oh cool
 
I was messing with you though, I knew you weren't "shouting" :)
 
my bad ; )
 
@Adan But, again, why not just return a TimeSpan?
 
10:42 AM
i did, timespan is much easier
i can just pass on the date/time and return the timespan ; ) thanks again
 
10:52 AM
i dont get it took c# 7.0 to introduce value tuples haha
 
it took C# 8 to introduce null awareness
it will take C# 10 to finish that concept
 
oh that's a big one
 
@Adan There's an Eric Lippert quote saying that any new feature to be added starts at a score of -100, and has to have sufficient justification in order to be implemented.
 
@AvnerShahar-Kashtan and in Java, new features start at -200 ;)
 
If there was an infinite amount of time I bet C# would have ALL the features. But since they have to add them progressively it's natural to see the least common stuff appearing after so long.
which is good because it means the product is robust
 
10:59 AM
Yup. Each feature, no matter how small, has a cost in spec, design, coding and testing, not to mention intangibles like "does it make the language harder or easier to use". These costs have to be justified.
 
something kotlin has that I like is their switch statement, which can be checked against any object, or a predicate can be run with the value, and an expression can be returned which can be assigned to the entire switch statement
of course you can manage without, but it's really flexible and easy to read
Honestly I didn't think it would have been such a nice addition until I started using it
 
@Neil C# 8 has switch expressions, which is nice and I've been looking forward to it.
I think it's quite similar to Kotlin's.
 
one could argue that "syntactical sugar" like a nice switch statement is useless
I think the deciding factor for me is if it makes the code more readable with or without
generally it does improve code, but certainly not always
 
var area = shape switch
{
    obj is Square square => square.Side * square.Side,
    obj is Circle circle => Math.Pow(circle.Radius, 2) * Math.Pi;
}
@Neil As always, Eric Lipper's blog has interesting things to say: ericlippert.com/2014/04/28/lowering-in-language-design-part-one
About higher level/lower level constructs in languages.
Anyway, I'm off. Gotta pick up the kids early from kindergarden today.
 
\o
 
11:11 AM
Is it possible to access parameters from action delegate?
 
You mean, if you pass in () => Transform(model) to the VariantProcessor, can it access the model?
 
This is my model :
public class Variant
{
    public int VariantId { get; set; }
    public int CategoryId { get; set; }
    public string Name { get; set; }
    public List<Subvariants> Subvariants { get; set; }
}

public class Subvariants
{
    public int Id { get; set; }
    public string Name { get; set; }
}
private void Transform(Variant model)
    {
         for (int counter = 0; counter < model.Subvariants.Count - 1; counter++)
            {
                var left = model.Subvariants[counter];
                var right = model.Subvariants[counter + 1];
                //some sort of transformation process between left and right
            }
    }
public sealed class VariantProcessor
{
    private string _myAppConnectionString { get; set; }
    private readonly Action _transform;
    private readonly Action _deleteStep1Data;

    public Variant(string _myAppConnectionString,Action transform, Action deleteStep1Data)
    {
         _myAppConnectionString = _myAppConnectionString;
        _transform = transform;
        _deleteStep1Data = deleteStep1Data;
    }

    public void Process(Variant model)
    {
        try
        {
            _transform();
Now If there is error in steps after transform then I want to delete data for Left and right subvariants using id
I have posted question here :
1
Q: How to access parameters from action delegate and pass to another method in case of exception?

ILoveStackoverflowI have 2 derived types : 1) AggregateCalculator 2) AdditionCalculator Each of the above derived types have different transformation logic for subvariants and basically there are 2 steps involved in this process : 1) Tranform 2) Create and store version If there is any error in step 2 then...

 
Wait, if the Processor passes the model in, it doesn't need an Action, it needs an Action<T>, and pass the model in itself.
I assumed earlier that your VariantProcessor simply processed a general purpose Transform() method and didn't know about models.
 
Morning!
 
Yes thats true but actually,I only need left and right subvariants Id in case if there is any error so that i can delete data
 
11:18 AM
@Neil keep on working, no distractions allowed.
 
:(
 
VariantProcessor although doesnt needs to know about model but then problem is How does DeleteStep1Data method will receive subvariants id
 
It looks like you're having too much coupling. If the left/right are part of teh AggregateCalculator's logic, the VariantProcessor shouldn't know or care about them.
 
Yes if you see my current logic then VariantProcessor doesnt know anything about Left and Right part of AggregateCalculator's logic
 
Why not have Transform return a new, transformed model, rather than changing the model which would then need to be cleaned up on failure?
 
11:22 AM
Hi Again
 
A simple solution will be something like this :
public class AggregateCalculator : IVariantProcessor
{
  private Subvariants Left { get; set; }
  private Subvariants Right { get; set; }

  private void Transform(Variant model)
    {
         for (int counter = 0; counter < model.Subvariants.Count - 1; counter++)
            {
                Left = model.Subvariants[counter];
                Right = model.Subvariants[counter + 1];
                //some sort of transformation process between left and right
            }
    }
}

public class AdditionCalculator : IVariantProcessor
But as you can see i have duplication in both the derived types
Thats the problem of taking this 2 fields at class level
 
That would mean that for each model, you must have a different instance of AggregateCalculator.
Anyway, I'm out.
 
Sorry I didnt understood this line :
That would mean that for each model, you must have a different instance of AggregateCalculator.
Ok no problem :)
 
How does an IIS AppPool user not have write access to /Framework/v4..../Temporary ASP.NET Files ??
 
Perhaps it doesn't have access to C:\Program Files
 
11:36 AM
IIS_IUSRS and/or IUSRS?
 
Did you change the user that the appool runs as
 
Those 2 entities are trash, first thing you have to do after installing VS is actually unlock all their permissions so you can debug on your local IIS instead of IIS Express.
The apul
 
@Squirrelkiller killerino, I am starting to beat everybody at our kickr table
 
Noice
Hope you're gonna be at the next SKC then
If your new company doesnt know, tell them! Best event to find new, awesome employees!
 
They don't know about it, already spread the word
 
11:50 AM
@ILoveStackoverflow I still think you are overthinking it
which, according to other people in here, is supposed to mean quite a lot
 
I don't like writing documentation
 
I dont like <insert anything here>
 
.this @Wietlol?
 
I dont like .this?
I dont like this. but I dont know what .this is supposed to mean
I cant dislike something I dont know
except Javascript
 

« first day (3132 days earlier)      last day (1815 days later) »