|
from the why isn't there a better way department:
var l = GetProperty("videos", (IList<object>)null);
return Tmdb.FromJsonArray(l, (d) => new TmdbVideo(d));
all that lambda is for is to call the appropriate constructor.
internal static T[] FromJsonArray<T>(IList<object> array,Func<IDictionary<string,object>,T> creator)
{
if (null == array)
return null;
var result = new T[array.Count];
for(var i = 0;i<result.Length;i++)
{
var d = array[i] as IDictionary<string,object>;
if (null != d)
result[i] = creator(d);
}
return result;
}
Why?
because I can't have a contract - either an interface, a base class, or a template constraint that specifies a certain constructor signature.
This should have been in with .NET 2.0, 3.5 at the latest. That it wasn't in with 4 just floors me, especially seeing as to what the serializer stuff in the dotnet framework has to go through for its constructor requirement.
Reflection? Really? It might even be faster than using a stupid lambda (but probably not)
*headdesk*
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I agree.
The next big language will resolve all this.
|
|
|
|
|
what gets me is all the "features" they've added to C# 8 that make it unreadable, but i think this feature is still missing (and would require runtime support)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
hey thats ... not bad.
clever. simple. nice.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Yeah.. I have been wanting to post an article on that for at least 2 years... getting lazy!
getting into new hobby at the moment and not having the energy to pursue them all!
But by all mean, enjoy!
|
|
|
|
|
Super Lloyd wrote: getting into new hobby at the moment and not having the energy to pursue them all!
Relatable content. People here think I love parsers, but they're just a hobby horse of mine, and I've flogged them to death so now i'm working on the next thing.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: on the next BIG thing
Fixed that for ya!
Haha, well done otherwise!
|
|
|
|
|
It's just frustrating, and one of the many reasons binary generics are inferior to source based templates.
Maybe when they get done making the language look like trash they can implement templates in C#
Although, i ended up needing to do it this way anyway, it turns out, so i won.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
Determine list with resistance (5)
|
|
|
|
|
Today I took some more pictures of the Huey. I need them because now it's time to order some decals to finally finish the job. Well, almost.
Look what the same model looks like when you order it painted and ready to fly: El Cheapo[^]
The landing gear is all wrong, not very miny details, almost no windows and look what they did with the front window with its mounting brim and very visible screws to hold it in place!
Well, I have not installed any windows yet, but at least i have a complete set. Since my last post I have corrected countless places where the paint ran under the masking tape and painted on the bigger markings with the help of custom paint masks. And most of the parts are now installed.
Take a look![^]
You know what? I still am not happy. Even in sunlight the details are not very visible. The new markings already help, just as the decals will, but it's still a big, mostly green thing.
I have stolen a great idea from the guys who build model tanks. They have the same problem. A tank is a big green thing and the details of the model just disappear. So what do they do? They paint on 'dirt' or fade the paint with strongly thinned oil paint. I gave it a first try by painting dark shadows into the lines of the doors, the rails of the side doors and some air slits. It was not easy to do because it's the exact opposite of what I did up to now. No more masking and working cleanly. Now I'm deliberately messing it up almost randomly.
Takes a little to get used to, but it looks promising. After the decals are on, I'm going to do my best to get rid of that boring pristine look.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
|
Yes, they are. Probably that was stock footage from Vietnam.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
|
Oil paint?
A bit of realism, eh?
Just get some sump oil from your car.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mais non! Monsieur! It's all about les coleurs and la composition!
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Hey, if you need dirt, there's no replacement for dirt!
It'll even give it a realistic smell!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
That's already on the way. Original dirt from Vietnam.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Was it expensive? Or was it dir... No, I can't bring myself to say it.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Even cheaper. It's FREE and being brought to me personally.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Charlie don't surf! , I don't know if it would work, I had success with Hawker Typhoon painted it up glossy & perfect, then went over it with some rusty steel wool in some area around the chin air intake the paint was thin scuffed it off then went to work with a Steel Effect magic marker. Worked quite well...
|
|
|
|
|
No, Charlie don't surf. Especially not with a gunship. I printed a surfboard, but there is not enough room for it between the landing skids and the rocket launchers.
Weathering with oil paints only works if you have used acrylic paint up to then. Acrylics are not affected by the generous amount of thinner you have to apply. With enamels this would turn into a smeared mess. Take a look: [^][^]
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
you don't have to use lots of thinners for weathering effects with oil. I've used oil weathering on oil "top" coat with good effect on railway models. Use a small amount of paint on the brush, and put 99% of it onto a bit of scrap card, so the brush has almost no paint left; then use a stipple technique. Practice, practice, practice first though on anything but Huey!
|
|
|
|
|
A sort of Dry Brush effect?
|
|
|
|