« first day (1626 days earlier)      last day (3328 days later) » 

10:02 PM
few of us
 
`var mystr = "firststring" + "secondstring".Reverse().ToString();`
why does that not give "firststringgnirtsdnoces" ?
 
@RyanTernier I've used it. It's gotten a lot better
apparently all the builds are using Node.JS now
I was talking to a MSFT guy yesterday, there's some big stuff they're announcing at BUILD
 
or is it just because dotnetfiddle doesn't have a runtime?
 
try putting it in parens?
 
10:12 PM
function calls should have higher precedence than concats though
try Array.Reverse
 
user862319
This fucking Monday
 
user862319
@RyanTernier @RyanTernier Yes
 
strings are immutable
 
I would think Reverse().ToString() would return a string representation of the ienumerable<char>
 
10:23 PM
negative, its an "IEnumerable<T>" which means it has not concept of how to handle that
a string is an IEnumerable<char> but not the other way around, so you get the name of the type, yay!
 
stupid generics
;)
 
Also since it is a linq expression technically
it hasn't even been evaluated
 
user862319
Why not optimize this further by reducing the string to a Markov chain and returning a base64 string representing the underlying data structure which is likely serialized using JSONx?
 
huh?
I assume there is some amount of sarcasm there :)
 
user862319
Absolutely not.
 
10:28 PM
HOW DARE YOU!
 
is that really optimizing tho?
 
using System;
using System.Linq;

public class Program
{
	public static void Main()
	{
		Console.WriteLine("Hello World" + new string("front".Reverse().ToArray()));
	}
}
 
yeah... that's what ohmusama posted above...
 
:)
sorry, I didn't see. I was doing work for awhile
 
of course you could always make your own string reverse functionlet
probably more efficient than linq
 
10:37 PM
hi
been a hairy few days, doing a java project for college, not my favorite langauge to say the least
 
@ohmusama functionlet? Is that a thing? I'd just call it an extension method
 
why couldn't it be C#
grr
 
@BrianJ my biggest gripe with Java is that it doesn't have LINQ and it doesn't allow unhandled exceptions
@ohmusama LINQ is certainly less efficient than doing an array reverse - enumerators are expensive when you're working with low level stuff
 
@KendallFrey functionlet == small function, 1-2 lines in my vocab
MORE efficient
 
@ohmusama right - I'm agreeing with you ;)
 
10:42 PM
@Pheonixblade9 I'm not disagreeing
 
LINQ is expressive but not always as efficient as just doing arrays
 
@Pheonixblade9 I don't really have any gripes with it, its just that I've been way more exposed to C# from my personal and college projects, Java just feels a bit off I think what attracted me most to C# initially was the GUI editors available in WPF and Win Phone dev, didn't really have any of that in Java classes, just code
 
@KendallFrey in c#6 you will be able to do lambda expression methods like:
public string GetGreeting() => return $"Hello, {this._name}, welcome to the mansion";
 
orly?
still verbose as fuck compared to Haskell :)
 
just use dynamic and enjoy
;)
 
10:46 PM
@BrianJ think of it as a test ;)
 
@Pheonixblade9 yeah I have one week left after this, I'm not too bothered about marks as long as I learn some stuff that I can use again
 
Brian J how is your theory on programming?
 
@BrianJ "[what] I can use again" is dependent on what company you land at.
 
pretty good I'm hesitant to say
@Bonner
going from feedback on interviews anyways
 
I've got a theory question you might be able to help with then lol
 
10:52 PM
oh shit
didn't think you'd call my bluff
lol
go on
remember I'm referring to undergrad college level theory
 
I've got a class called RouteConfig, it is a modification of the RouteConfig class that is defined when you first set up an MVC project in VS
I'm using EF
 
Go on
 
yes I do know these acronyms
 
but in theory terms I'm unsure of the most scalable/best practice way to join the two together
lol it wasn't a test of acronyms I'm genuinely wondering the best way to do this
 
I think this is practical not theoretical
 
10:54 PM
it is theory based too
 
I couldn't comment on that, don't have enough exp points
:P
I've used EF last week for my MVC project, but that's as far as my knowledge on it goes
 
that's more knowledge than I have on it lol
 
its a practical descision. Do I wild west it, or do I use reflection to load up a route path? or something else
 
it is also a case of what should the route be aware of in terms of the database
I have to extend the route class, so that I can populate the virtual path data
so I guess that is where I should be hooking into the database?
but then do I use a provider of some sort?
 
well the routes bind to controllers
 
10:57 PM
because really the route should have no knowledge of the database and visa versa
 
if you have a "model" of say, Users
you can use reflection to build a provider, that will give you some "routes" based on that model
 
routes don't, routes provide data to the route handler which then uses the controller builder to get the controller factory which then creates a controller which then invokes the action
 
you're probably going to have the typical CRUD actions anyway
so, you would expect those, however, you're going to have to deviate from the typical model if you want extra behaviors
 
controllers will use models to store routes in the database
but the models will have no knowledge of routing
unless I'm doing something wrong there
as that doesn't make sense does it?
 
how I would do it
is have \Users\{id} for view (for example)
 
11:00 PM
I'm not using routes like that
 
which is going to rig eventually to the UsersController, or a generic ModelController<User>
which uses the User model
which links to the User table in the db
but that is because you are using EF
 
I'm using EF to work out the route data
 
that is the typical MVC pattern
 
say I have a url...

/about/council/news/this-is-a-news-article
the URL segment that is of interest to us most is the "this-is-a-news-article"
 
so
 
11:02 PM
that last segment is stored in the routes table in the database
along with the controller for it
 
/about/council/news/{title}
okay, that is rolling more like Drupal
 
so the controller is NewsArticleController
yup you got it
but in the CMS you can add a news article anywhere
so you could have /home/this-is-a-news-article
rather than defining lots of routes, I have 1
 
can we call it a "page"
 
{*url}
 
or "article"
 
11:04 PM
somewhere in the route config, it has to work out what the default controller and action will be, based on the URL segment
 
so, if you have all of your more specific paths before that
this is the fall back, correct?
 
yup
but it is more of a most cases it will be used
 
well, you have to do that parsing yourself
 
that's what I'm doing
 
since you are basically turning off the real routing
 
11:05 PM
that is all fairly easy
the difficult bit is how much exposure of the database or data from the database the route config should have and how
 
maybe this follows the psychology route
how crazy do you want to be in the end?
 
Do Expression objects have structural equality?
 
I just want it to be a case of if EF isn't used, it can be swapped out for something else
route < data provider > data
 
@JustGreg get ILSpy and decompile the binary and check out the .Equals(object) method on Expression
 
@ohmusama I was about to do that, but based on the questions on SO, they don't. So I have to implement it myself.
 
11:10 PM
ah
 
I would say no:
http://referencesource.microsoft.com/#System.Core/Microsoft/Scripting/Ast/Expression.cs
 
Its in System.Core.dll if you care
 
user4180960
hi
 
hey
 
user4180960
I have one question
 
11:13 PM
but not 2?
 
@Bonner your DB should not be in any way tied to your route
 
I know that's what I'm saying
but then how do I code something like that/
I can't get my head around connecting the 2
 
user4180960
I have a question: Is it possible to change name of file from BIOS?
 
your DB is your data store. Your routes are your "functions". It's good DB design to be denormalized and have efficient data access, but they should have several layers in between
@Mathematician171 from BIOS? you mean from command prompt?
 
@Mathematician171 probably not
 
11:15 PM
the BIOS doesn't have any drivers to access anything apart from your MBR on your HDD
 
I have no idea what the question means
 
user4180960
no,not from cmd, I want to change a name of file before system starts, is it possible?
 
@Bonner just make a Routes model, that is your only "link" to the db
 
@Mathematician171 no, why on earth would you want to do that?
 
everything else will be dynamically loaded
@Pheonixblade9 he's trying to make viruses
 
11:15 PM
hahahaha
 
user4180960
 
MyFirstRootkit.cs
 
user4180960
and I still cannot solve it
 
lol
 
when will people realize that viruses are among the most difficult programs to write
 
user4180960
11:16 PM
I have a file with unacceptable file name, I tried EVERYTHING, but I couldn't to rename it
 
if I'm not mistaken you are asking how to read the raw binary data from a hard drive?
what file system are you using?
 
what do you mean unacceptable file name?
 
characters that windows can't recognise
I know what he's talking about I've had this problem myself
 
user4180960
hm, I am begginer, so I didn't know to say it... I have a file with name "::~~?>|} and I cannot rename, move or delete it in any way, I am using windows 7
 
Windows BSODs if you try and do anything with it
you need to boot up with a live linux distro and rename it
 
11:18 PM
^
 
@Mathematician171 if you're going to work within a file system, you need to follow the rules that file system enforces
 
either that or you have to know how to read the raw binary stored on a HD
 
user4180960
I know, I know it can be solved if I boot linux, but I want to delete without installing linux, I want to rename it avoiding filesystem
 
you don't need to install linux
you can use a live distro
 
user4180960
is it possible to red raw binary using c#?
 
user4180960
11:19 PM
read*
 
@Mathematician171 tried loading linux rescue disk?
 
depends on what you mean by "read" I guess
but yes, you can deserialize binary
 
user4180960
@juanvan I know I can rename it using linux cd, but I want to write whole program by myself to do it
 
you can write a bash to look in ever folder and replace the results
 
can you delete the parent folder?
 
@Mathematician171 can I ask why you want to write some software to do this?
 
user4180960
@ohmusama no I cannot, I cannot access this file or it's folder
 
user4180960
@bonne
 
if you have installed windows, it will delete the file allocation table
which means that you will have to write something to recover data
 
user4180960
11:23 PM
@Bonner I want to know to edit rename or delete any file, I do not want to have some undeletable files
 
so you will have to attempt to detect the type of file allocation table that was used on the dirty bites of data marked as deleted
does the file show on Windows?
 
we're still in virus territory here ;)
 
user4180960
@Bonner I do not want to recover my windows, I just want to know hot to rename single file with these features. Also, can I access a file where all filename are stored and manualy change it's name
 
user4180960
?
 
@Pheonixblade9 regarding the routing, do you know of any diagrams I can take a look at which show how to bridge the 2?
@Mathematician171 I'm not on about recovering windows, but when you view your files, does the file you want to rename appear?
 
user4180960
11:26 PM
@Bonner yes, but if I click on it, system restarts
 
it BSODs I know
it is because there is an exception thrown which is never caught
if the file appears, that means there is an entry in your file allocation table
do you know if windows is using NTFS or FAT32, FAT or something else?
 
user4180960
@Bonner. I am begginer, so If you can explain me is it possible to access list of all filenames on hard drive and to manualy change it's name?
 
@Bonner why do you want to bridge the two?
I think you're in the midst of an X/Y problem
!!google x y problem
 
I have URL segments stored in the database and the URL segments contain information on the controller type to use
 
11:29 PM
I've found that the comma first style is actually a lot more handy than the comma last style
 
why would you put your routing logic in the database?
 
so when you visit a URL, the last segment is then looked up in the database
 
because he want's to be Drupal like
 
that makes absolutely no sense
 
because I have a CMS that allows you to create pages in the CMS based on the available controllers
 
11:30 PM
Because you can easily add stuff to the end of the line without the annoying comma
 
or will have, I'm currently coding it
 
user4180960
@Bonner, so can you help me?
 
@Mathematician171 I'm still unclear on why you want to write something in C# when you can boot a live CD and rename the file
@Pheonixblade9 am I making sense?
 
user4180960
@Bonner It isn't problem to rename file, I can rename it if I boot CD, it is obvious, but I want to knwo how it works, I want to do it by myself, I want to better understand how files and it's names are stored...
 
@Bonner no sorry... and I have to work
 
11:33 PM
no problem
@Mathematician171 read up on file allocation tables
!! google file allocation table
 
user4180960
@Bonner I know what is it, I know what a file system is, but this cannot give me an answer: is it possible to write a c# program to rename a file avoiding a filesystem?
 
yes you have to write unmanaged code to do so as far as I'm aware
the .NET framework does not provide classes to read files that Windows can't
if you look at the System.IO namespace, and the source, you will notice there are many checks to ensure that the filename is valid
 
user4180960
oh, I understand, but then can I write a program in anny programming language and then to copy it on cd and then to boot thtat CD and then to rename file?
 
@Mathematician171 you are talking about 2 different things
if that is your wish yes, but you would still have to compile the program for each different system you want to use it on
 
user4180960
11:39 PM
@Bonner Ok, this is what I am asking: What is the easiest way to make a file, to copy it on cd, to boot that cd and rename a file on HDD avoiding filesystem?
 
do you know what a master boot record is?
 
user4180960
@Bonner I said I am a begginer
 
user4180960
no, I don't know
 
I would read up on grub then
grub is a bootloader, it does all the hard work for you
then you can run your program
which you will probably have to write in c or c++
c# is not the language you need
to write this in c# and get what you want, you have to be running the .net platform
 
user4180960
@Bonner If I understood correctly, I have to write a program in C or C++, to complie it and copy exe file on cd, and then boot that cd?
 
11:44 PM
it wouldn't be an exe
but yes
 
user4180960
but why I need grub than?
 
so you can run your code
 
user4180960
"it wouldn't be an exe", but what format it should be in?
 
you have to write a kernal and the kernal can contain all the code you need to mess with the hard drive
 
user4180960
@Bonner Thank you for this help, but can you give me a some tutorial or simple instructions how to manipulate HDD with bootabe cd?
 
11:47 PM
@Mathematician171 wiki.osdev.org/Bare_Bones
scroll down to "Writing a kernel in C"
 
nice one
 
user4180960
@Bonner but this is only for 32-bit system, right?
 
x86 is 16 bit to 64 bit
 
user4180960
@Bonner Oh, ok, thank you very much
 
What parts of reflection actually hurt performance? Is it only the methods that search for members and the members that invoke them, or anything at all?
 
11:52 PM
reflection in general
if you are using reflection, I'd cache as much as you can
 
^
 
Yeah, but some things are probably okay, like PropertyInfo.Name. It would be kind of weird if this made some underlying reflection call.
 
reflection isn't that bad
 
(on an existing PropertyInfo of course)
 
11:54 PM
@Pheonixblade9 thanks
 
basically, in C# the CLR keeps some metadata on compiled code so it is fairly efficient to reflect on it
it's how stuff like routing in MVC/WebAPI works - that's the magic convention stuff
 
even the MVC framework makes a cache of controller types
ControllerTypeCache
 
yeah, in memory, not in the DB
 
yup I know
 
11:58 PM
@JustGreg
this is the source for PropertyInfo.Name
public override String Name
{
[System.Security.SecuritySafeCritical] // auto-generated
get
{
if (m_name == null)
m_name = new Utf8String(m_utf8name).ToString();

return m_name;
}
}
 
so there is lazy loading going on
but not terrible
 
it works differently now with cached expressions
 
@ohmusama thanks
 

« first day (1626 days earlier)      last day (3328 days later) »