« first day (2459 days earlier)      last day (2504 days later) » 

2:32 AM
Bottas definitely jumped that start
 
mr5
3:20 AM
o/
my scalp hurts when I wear hats for a long time
does anyone experiencing the same?
I think I have cancer or something
 
 
3 hours later…
5:58 AM
@mr5 maybe you don't drink enough water, and your head is dry?
hello
 
6:35 AM
Morning.
 
6:46 AM
Hello hello.
 
6:59 AM
ohayou
 
7:11 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String fullFilePath = @"C:\Karthik\Test\BIRTXML\ReportXML.XML";
this returns 415 unsupported media type
can someone guide me what is wrong
 
7:31 AM
well that doesnt help i dealt with 415 issue since ihad to use multipart/form-data now i get 400 bad response
>.>
 
@AtharvaPandey First order of business is to only send the relevant parts of your code. Not the entire Using list. Not the constructor and random button click handlers.
Why are you specifying HTTP/1.0 explicitly? It's old and deprecated.
I'd be very surprised if your API doesn't support HTTP 1.1. It's been a standard since 1997. There should be no reason to use 1.0.
Generally speaking, 415 means that your application/xml content type wasn't expected or supported.
Also, you can wrap your entire method in 2-3 lines if you use the modern HttpClient class, rather than the 2001-style WebREquest class.
The fact that it's 2017 and people are still writing web access code using WebRequest/WebResponse because of all the crappy code samples out there is depressing.
 
mr5
Does the link I sent implements the deprecated way?
 
@AvnerShahar-Kashtan well I am a java developer so I just copy pasted that code i figured out that application/xml thing is wrong like i need to pass file so i have to use multipart/form-data
 
mr5
I'm not that familiar with C#'s Http client libraries, but I haven't seen one yet of a high abstraction
 
well I saw one but for some reason i was looking at several errors when using http client libraries
 
mr5
7:47 AM
yes, it sucks when you're new in the language/framework and you can't figure out yet how to use the new features so you resort into old way.
 
    :38041005
var http = new HttpClient();
    var response = await http.PostAsJsonAsync("http://my-server/endpoint", myObject);
    var result = await response.Content.ReadAs<MyResponseObject>();
@mr5 Abstract enough?
It automatically serializes your object into JSON. It automatically deserializes the response's content. No messing about.
 
welll I just need a upload client code basic one so that i can build upon that the one you sent is very complicated for me to get hold of when i dont even know C#
 
@AtharvaPandey Try adding a reference to System.Net.Http and System.Net.HttpFormatting.
Then you can use code like I posted (just replace PostAsJsonAsync with PostAsXmlAsync).
Or like this:
22
Q: How to send XML content with HttpClient.PostAsync?

basI am trying to fulfill this rest api: public async Task<bool> AddTimetracking(Issue issue, int spentTime) { // POST /rest/issue/{issue}/timetracking/workitem var workItem = new WorkItem(spentTime, DateTime.Now); var httpContent = new StringContent(workItem.XDocument.ToString()); ...

 
mr5
8:05 AM
It really pisses me of when developers design their UI using code instead of the supported xml.
I've been google searching for about some minutes how to center this view and all the provided examples I see are code
 
Thats because many people come from winforms
also
tell pls
Ill try to help
 
what?!
 
mr5
@KamilSolecki It's a Xamarin question. I am trying to center this view inside RelativeLayout. Here's my work so far gist.github.com/anonymous/4f0cc1402bfe8efa0c6180b04ed05eed
 
@mr5 There are a lot of WPF questions that get code-behind answers. I don't like it either.
 
8:35 AM
@mr5 did you check docs? I'm no Xamarin dev, but it seems to answer your question
         RelativeLayout.XConstraint=
             "{ConstraintExpression Type=RelativeToParent,
                                    Property=Width,
                                    Factor=0.4}"
Sry for formatting I'm on phone
seems like you can use relative to parent and relative to view
And then use the factor to set the distance
 
mr5
@KamilSolecki okay. no worries :) I'll try that out
 
9:11 AM
hya
pls tell me there is a C# guru over here
(or whatever)
 
@Wietlol this chatroom only consists of the best c# devs in the world
actually, no. Universe.
 
ow, wrong room for me then
thats too bad
but maybe you can answer my quick question before i will go back to the noob chat
 
just tell whats your problem
and if anybody knows / can help, they will :)
 
i have an Asp.net solution that contains several projects
it was built on "Any Cpu"
but because I recently added Liphsoft Argon2 library, it wont work as "Any Cpu"
so, I tried to set all the platform targets to x64
but i still get the badimageformatexception
only one project requires the library
and that one just doesnt want to be built on x64
to ensure it is not the library, the library is not yet added to the dependencies
I set project X to x64 and i get the BadImageFormatException
I set project Y to x64 and that one works
all dependencies that project X has, project Y has as well
so im lost
 
mr5
time to recreate that library your own from scratch
 
9:16 AM
i would
if it was Java
but with C#, im not that confident
 
is the DLL x64?
cause that might happen if the used DLL is x32 and you are building for x64
 
how can i check?
 
probably docs
 
at least, which dll do you mean?
 
the one that is failing
 
9:21 AM
of the project itself?
 
i mean DLL as in the library
containing the content that is failing
 
i dont think there is a dll that contains the project X dll
 
wait wait. The project X is throwing a specific error, right?
 
its dutch but the message should be clear
 
If your application uses 32-bit components, make sure that it always runs as a 32-bit application.

If the Platform target property for your application project is set to AnyCPU, the compiled application can be run in either 64-bit or 32-bit mode. When it runs as a 64-bit application, the just-in-time (JIT) compiler produces 64-bit native code. If the application depends on a 32-bit managed or unmanaged component, that component will fail to load in 64-bit mode. To correct this problem, set the project's Platform target property to x86 and recompile.
From MS ^
 
9:25 AM
hmm
 
!!mondays
 
@satibel That didn't make much sense. Maybe you meant: monday
 
i think it is one of the references but there are about 40
 
dammit, caprica forgot.
(hello)
 
or maybe I cannot run any Asp.net project in x64
could that be the problem?
 
mr5
9:27 AM
@KamilSolecki afaik, all binaries built on 32-bit architecture are compatible with 64-bit
but not the other way around
 
it would make sense
but that contradicts my error
 
@mr5 yes, but you can not have the libraries.
 
!!daysoftheweek
 
@KamilSolecki That didn't make much sense. Use the !!/help command to learn more.
 
this one is lost too.
welp I'll just do backup, so that rlemon won't be the only one doing it.
!!backup
 
9:32 AM
@KamilSolecki You do not have permission to use the command backup
 
welp.
@rlemon Think you can resolve this issue somehow?
 
why Am I unable to import httpclient and httpformatting stuff for C# is it because may be I am using old version of C# ?
 
2
Q: Unable to run ASP.NET projects in 64 bit mode on Windows 10 install with VS 2015

user5779986We have recently (yesterday) upgraded to Windows 10 and Visual Studio 2015. Our ASP.NET project will run absolutely fine if we compile to "Any CPU". We've now tested it on 2 different machines, compiling to x64 produces the error Exception Details: System.BadImageFormatException: Could not lo...

that option was turned off
i assume that was the problem
well... yep that was it
@AtharvaPandey which version of C# and .net do you use?
 
user8098743
any idea how to get more attention? I think I described my problem and the steps I took very long and good, all these edits with new information should have bumped my question too, also changed title (wasnt sure if people just disliked the title), but nobody cares ~ stackoverflow.com/questions/44929656/…
 
make the title a question title?
 
9:37 AM
!!mondays
 
no idea?
 
on the top of the thread you should specify the problem in simple terms
aka, there is a horizontal scrollbar, how can i remove it?
 
if its a more complicate question you won't get that easily an answer
 
(if that is the question, at least that is what I thought it was after a quick look)
 
user8098743
9:39 AM
basically/almost, yes. Thanks, I will change title again and try to include a little summary on the top
 
visually split the parts "desciption of the problem", "what have I done to fix it", etc so that even a retard can read it
and if the thread is longer than the size of your screen (or if you just have a large screen), add a tldr at the bottom
even I have to scroll for this one... I have a 1440 height screen
:D
(not that large but larger than the average user)
 
user8098743
ok, gonna reformat. My questions somewhat grow to a diary sometimes, including ideas I can proof wrong in a later edit etc. gonna paste edits into question etc, thanks
 
on a side note, what is "Suspending"?
is it like "fill empty space"?
 
@Wietlol I think it's do not render for now.
 
user8098743
SuspendLayout() makes the control stop doing layout, in case you change its properties. like pausing
 
9:43 AM
ah
 
@Kartoffel have you tried making the first column a bit less large?
 
is it normal that the query generated from the IQueryable has parameters like "p__linq__0" -no values?!
 
@Wietlol I think its old but may be 3.5 or 4
.net framework
someone suggested me here one program but that doesnot seem to be working i get a lot of errors and i believe that is because those keywords are not availble i guess in 4 and 3.5
 
41
Q: HttpClient does not exist in .net 4.0: what can I do?

user1352869Ok i edited my code i dont get errors but the messageBox.Show return nothing empty box. Maybe i need to add something in the referrer string ? I didnt understand what is the referrer and what should i put there. And i have a key already im using it in my code. The key is a long string and im usin...

 
@Wietlol Are you using .NET 4.0? Visual Studio 2010?
 
9:49 AM
me?
no
.net 4.6.1 i think
 
user8098743
@satibel "tried to change the first column's size (as the later two ones have absolute values) from 100% to a lower percent value, autosize and a similar absolute value -> led to the last column begin oversized, still visible scrollbar" (is there some formatting to display quotes)
 
So HttpClient exists. :)
 
on VS 2015
i know
but he uses 3.5 or 4.0
 
When convert it ToList , I got an error in the debugger : Could not evaluate expression!
 
i am on VS 2010
its like provided by the company
 
9:51 AM
not such a good company
i doubt you have a proper license
 
It's 7 years old. The hours you've lost due to lack of access to new tools is probably worth way more than a license to VS2017.
 
well we have proper license but this project is kind of old
on .net side
 
still no reason to use VS 10
 
obviously if it were me I wont even choose to work on C# i ll go with java :) completely over me
 
maybe use Rider :D
 
9:53 AM
just imagine they were using java 5 just two years ago in one of there projects
 
I have to say VS isn't always smart enough to keep backwards compatibility with older VS versions.
 
when we are on version 9 almost
 
Our project is VS2013, but I use VS2015 on the same solutions. It causes unnecessary changes/merges to the SLN file (terrible format!), and occasionally VS forgets that it should stay with C# 5 only.
 
well I dont know microsoft stack so I cant comment on it but I absolutely love VSCODE
 
well java is a bit special about versioning
first of all, java 5 vs java 9 is not like .net 5 vs .net 9
its java 1.5 and java 1.9
 
9:55 AM
Yeah, that's true. Java 5 is more like .NET 1.1.
Did Java even have generics in 1.5?
 
and java versions are coupled
 
java 8 and java 9 are a couple
 
lol java was the first i guess to inroduce generics
 
10 and 11 will be as well
 
9:56 AM
@AtharvaPandey Java was the first what?
 
java was late with generics
initially it didnt have them at all
 
ehh may be I wasnt mature enough to programm then
 
hence why rawtype backwards compatibility exists
 
the day i learnt java generics were already there
 
but now, java generics are way more powerful than C# generics
 
9:57 AM
and I am not interested in history and geography of the language i just want the ease to use it
 
apart from that they are lost in runtime
 
Java introduced them in 1.5, it seems.
@Wietlol I would disagree. Type erasure alone makes them extremely confusing and limited.
They have some advantage with covariance and type wildcards, but weighed against the lack of runtime support, I still think .NET wins.
 
well to be honest what i have read is linq makes C# a pretty modern language as compared to java but i think with 8 and 9 java has picked the pace up
 
however, if you want the runtime support, just dont use the javac compiler :D
 
user8098743
I still miss a generic arraylist in c#, java does have it
 
9:58 AM
what about the type erasure?
(im too lazy to google it so i dont really know what it means)
 
@Kartoffel What do you miss? You have the old ArrayList, and the new List<object>.
 
C# has List<T>
which is similar to Java ArrayList<T>
 
user8098743
yes, coming from java that's the most confusing structure ever
 
@Wietlol Type erasure is the loss of generic information in runtime. Your ArrayList<string> during compilation is just an untyped ArrayList at runtime.
 
Hi guys
 
user8098743
10:00 AM
you learn "List equals no index" for 3 years straight and c# just messes with it
 
ah
 
Wait what?
 
well then there is no negative point at all
 
Java ArrayList doesnt have an index?
 
except that javac is the standard compiler
 
10:01 AM
I am having an excel sheet which contains subject wise records.Now each subject have records like 9700000 and columns are 1800.
I am looking for a fast way to insert all this records in my database tables
 
@Kartoffel I'm pretty sure Java's List interface is index-based.
 
I wrote my own compiler and it does support runtime generics
@TomW why do you think so?
 
Declare it as ICollection<T> if it bothers you that much. There, no index
@Wietlol it was a question
 
where does the question come from?
 
As of now i am thinking for sqlbulk copy but as bulk copy works with only datatable and datareader so data reader wont come in this case.
But problem is datatable cant hold more than 655 columns.So i am now confuse so as to what to do
Can anybody please give me any kind of suggestion
 
10:03 AM
2 mins ago, by Kartoffel
you learn "List equals no index" for 3 years straight and c# just messes with it
 
ah, it comes from Kartoffel
@Kartoffel what do you mean with "List equals no index"?
 
Why have we got Java enthusiasts in here all of a sudden?
 
user8098743
@TomW I never said java ArrayList would have no index. Just the List implementation I was forced to learn and work with didn't. Then you swap over to c# and instead of using a generic arraylist you now use a simple generic list you access with index
 
ehh because C# was inspired by java :D and outdid it
 
whatever List implementation you use is wrong then
because a List implementation is an ordered collection
 
10:07 AM
Ok I didnt know List and ArrayList were different. It sounded like you were equating List<T> with ArrayList
 
anyways will anyone would be able to help me with the existing old version code to send multipart/form-data
 
and in C# people just prefer a different syntax
nothing special
 
user8098743
@Wietlol that implementation isnt wrong at all, just very very simple and made to learn not to use index
 
-_-
 
user8098743
but that's really unimportant i guess. let's just forget i did bring that up
 
10:08 AM
you mean syntax?
aka list.get(x) vs list[x] ?
 
public static string SendXMLFile(string xmlFilepath, string uri, int timeout)
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);

    request.KeepAlive = false;
    request.ProtocolVersion = HttpVersion.Version10;
    request.ContentType = "multipart/form-data";
    request.Method = "POST";

    StringBuilder sb = new StringBuilder();
    using (StreamReader sr = new StreamReader(xmlFilepath))
    {
        String line;
        while ((line = sr.ReadLine()) != null)
        {
can someone help me with this the new stuff doesnt work
this gives 400 error
 
if it gives a server error, the code ussually isnt wrong
it just expects something different than what you provided
 
hmmm it should take xml file i did provide xml file path
okay i get the code this code is passing things in string format but it has to pass the file itself
 
user8098743
@Wietlol gotta leave, but to let you know what I mean: here is what i was forced to learn/work with. sorry for comments, didn't have a comment-less version just now puu.sh/wG4e3/2153aabdbb.txt
 
user8098743
bye
 
10:13 AM
Don't form-data have to be base64 encoded?
 
@Kartoffel that is no List implementation
that is a self made class with the name "List"
cant deal with stuff like that
 
@TomW given that there is already an implementation using typical non-secure Random class of C#, I would like to predict the results of Random.Next(int a, int b). You would say in this case I am the "attacker"
 
@TomW i dont think so atleast in java its not the case unless you really want to encode it
 
Hello? Who are you and what is this in reference to?
Oh yeah
Jeese dude you can't expect my memory to last that long ;)
 
@Kartoffel I can think of a quick fix: do the suspend after the 6th line, so the vertical scrollbar is shown.
 
10:19 AM
@trand ok well I am quite confident that is possible with enough sample data but it would take a much better algorithms expert than me to say how
@AtharvaPandey I'm pretty sure as a rule you can't just dump bytes to an http endpoint
 
This no longer works stackoverflow.com/questions/39093911/… but can the knowledge from it at least partially be used?
 
I assume so
 
@trand
  public virtual int Next(int minValue, int maxValue) {
      if (minValue>maxValue) {
          throw new ArgumentOutOfRangeException("minValue",Environment.GetResourceString("Argument_MinMaxValue", "minValue", "maxValue"));
      }
      Contract.EndContractBlock();

      long range = (long)maxValue-minValue;
      if( range <= (long)Int32.MaxValue) {
          return ((int)(Sample() * range) + minValue);
      }
      else {
          return (int)((long)(GetSampleForLargeRange() * range) + minValue);
source of Random.Next(min,max)
 
@TomW well I implemented the client in java so in java it doesnt ask for suck encoding
so i am more then sure you can say :P
 
 protected virtual double Sample() {
      //Including this division at the end gives us significantly improved
      //random number distribution.
      return (InternalSample()*(1.0/MBIG));
  }
also this is Sample^
  public virtual int Next() {
    return InternalSample();
  }
and this is Next() ^
thus, if you can predict Next(), you can probably predict Next(min,max)
 
10:31 AM
@AtharvaPandey yeah its not that simple stackoverflow.com/questions/219827/…
You can do it but you have to specify what you want
 
@TomW you can, but it doesn't mean you should
 
I'm not sure that remark makes sense in context
Posting a file over http using the format designed for files is a reasonable thing to do
 
@TomW this ^is reasonable, you were talking about simply dumping bytes.
 
Oh I see. Yeah, don't do that.
 
@TomW though you technically can, you also can dump a byte stream as an address.
though it may not be fully HTTP compliant.
 
11:05 AM
morning :)
 
Evening
 
11:30 AM
@satibel is this real code?
or is this the matrix?
 
If I'm making a Parse method, what exception should I use? FormatException?
 
@WilliamMariager Yeah, that seems like the expected one.
Conforms to the Principle of Least Surprise.
 
Yeah
How about the parameter itself? If I pass null. That would still be an ArgumentNullException right?
 
I would do that, yes.
 
Awesome.
 
11:40 AM
@WilliamMariager screw exceptions just throw a segmentationfault :D
 
guys , hello
 
try { ... }
catch { Process.GetCurrrentProcess().Kill() }
 
i face a problem installing Android Studio , i know i am in wrong place but i can't join Andriod room
 
@WilliamMariager seems a safe choice ;)
 
11:41 AM
@WilliamMariager Delete the code that threw the exception. github.com/munificent/vigil
 
@Bassem whats the problem and what OS are you on? (i assume windows)
 
i have windows 7 , i setup andriod studio but when i create a new project , window stuck on gradle resolve dependencies app debug compile
i search over internet but can't find solution
 
@Bassem Why can't you join? Were you kicked?
 
@AvnerShahar-Kashtan no , it says i need 80 rep , don't know what is 80 rep
 
11:43 AM
That's horrible Avner :P Those random languages are getting out of control.
 
Huh. I didn't know specific rooms could enforce specific rep limits.
 
@AvnerShahar-Kashtan nnnnnnnnnnnnnnnnnniiiiiiiiiiiiiiiiiiiiiiccccccccceeeeeee
 
@Bassem Rep is StackOverflow Reputation.
 
how can i increase it
 
@Bassem answer questions on SO
 
11:44 AM
@Bassem Ask good questions. Give good answers.
 
hmmmm , ok thanks , what about my problem , does anyone have an idea
0
Q: Stuck at build ( Gradle: Resolve dependencies ':app:_debugCompile'

BVtpIt suddenly became impossible to build my app. All of a sudden, it got stuck at building.. I tried deleting the .gradle folder, didn't help (actually made of it worse). I uninstalled Android Studio completely, installed it again, opened a sample default project just to see if everything is ok, a...

 
@Bassem didn't you say you were stuck installing android studio?
 
it is installed successfully
when i create a new project , it stuck on this message
 
@Bassem can you build outside of android studio?
 
what do u mean
 
11:50 AM
using gradle
from the commandline
if you can it's a configuration error in android studio, if not it's a gradle error
@Bassem oh and go into your gradle config file and check all the links for maven
if a dependency link is down gradle gets stuck
 
@SebastianL it's the code from microsoft.
 
I guess today is Java day in C# world
 
@satibel Took your advice and moved to the Repository Pattern. Suits the application much better.
Anyone want to go to a 2-day Docker conference?
 

« first day (2459 days earlier)      last day (2504 days later) »