Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

devvvy

@devvvy
About
Posts
2.8k
Topics
926
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reflection - from Type to Class (not instance of class)
    D devvvy

    hello guys, How do I write something like this?

            string json = null;
            Type\[\] types = Assembly.GetExecutingAssembly().GetTypes();
            var carTypes = (from type in types
                             where type.IsClass && type == typeof(Car)
                             select type);
            foreach(var carType in carTypes )
            {
                string typeName = carType .Name;
                string jsonFile = typeName + ".json";
                json = File.ReadAllText(jsonFile);
    
                // How can I not hardcode "Porche" here and instead use "carType"? 
                IList cars = Newtonsoft.Json.JsonConvert.DeserializeObject\>(json);
            }
    

    Here, Porche is a sub class of Car - Both "Porche" and "Car" are Class. In additional to Porche, we have Toyata, BMW, Tesla... I want to dynamically retrieve them via Reflection (avoid hardcoding) "cars" is a list of instances of cars. "carType" is Type. How can I use "carType" in JsonConvert.DerserializeObject which take List<$CLASS$> as argument? IList<someReflectionAPI(carType)> cars = Newtonsoft.Json.JsonConvert.DeserializeObjectsomeReflectionAPI(carType)>>(json); Thanks

    dev

    C#

  • Docker on Google Cloud: 'MobyLinuxVM' failed to start.
    D devvvy

    hello, I have installed Docker on fresh image of Windows 2016 Data Center with SQL Express on Google Cloud.

    _Unable to start: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: 'MobyLinuxVM' failed to start.

    Failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is not running.

    'MobyLinuxVM' failed to start. (Virtual machine ID 77BB575B-CD6C-4B54-A38D-9554F89AFAE1)

    The Virtual Machine Management Service failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is not running (Virtual machine ID 77BB575B-CD6C-4B54-A38D-9554F89AFAE1).
    at Start-MobyLinuxVM, : line 296
    at , : line 412
    at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
    at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
    at Docker.Actions.<>c__DisplayClass19_0.b__0() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
    at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59_

    The closest solution I can find is this: [docker - Failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is not running - Stack Overflow](https://stackoverflow.com/questions/48255871/failed-to-start-the-virtual-machine-mobylinuxvm-because-one-of-the-hyper-v-com) I can't find anything similar to "Virtual Machine Settings" from my Google Cloud Console however. I however see from Docker's doc - What's "Nested Virtualization"? Does it mean I can't run Dockers on VMs (In my case, a VM on Google Cloud), that it's not even officially supported? https://docs.docker.com/docker-for-windows/troubleshoot/#running-docker-for-windows-in-nested-virtualization-scenarios

    "Docker for Windows can run inside a Windows 10 virtual machine (VM) running on apps like Parallels or VMware Fusion on a Mac provided that the VM is properly configured. However, problems and intermittent failures may still occur due to the way these apps virtualize the hardware. For these reasons, Docker f

    Hosting and Servers

  • WPF
    D devvvy

    I think problem with WPF is, you need commit a lot of things into memory, things arent intuitive. If they are, you wouldnt be memorizing them

    dev

    The Lounge

  • Looking for a job
    D devvvy

    trading is part of banking

    dev

    The Lounge

  • Looking for a job
    D devvvy

    exactly

    dev

    The Lounge

  • Looking for a job
    D devvvy

    i hear funeral homes pay their people pretty well (but don't think they need developers)

    dev

    The Lounge

  • Looking for a job
    D devvvy

    Banking can be very different these days... ever work in front office trading environment anyone?

    dev

    The Lounge

  • Looking for a job
    D devvvy

    They used to call it "Multi-tasking" or "Many-tasking". Perhaps now that's going away they need something new to *inspire* developers.

    dev

    The Lounge

  • avro - c# to Java, on Flush or Close - “The underlying connection was closed” C# side upon Java HttpExchange.getResponseBody().flush()
    D devvvy

    I am using avro calling Java from c#. Error message "The underlying connection was closed: The connection was closed unexpectedly." C# side upon Java call to flush or close C# side fires off the request from here:

            httpRequest = HttpWebRequest.Create(targetUrl) as HttpWebRequest;
            httpRequest.Method = "POST";
            httpRequest.Accept = "avro/binary";
            httpRequest.ContentType = "avro/binary";
            httpRequest.KeepAlive = false;
    
            SpecificDatumWriter someRequestWriter = new SpecificDatumWriter(SomeRequest.\_SCHEMA);
            ...
            using (var requestStream = httpRequest.GetRequestStream())
            {
                someRequestWriter.Write(someRequest, new Avro.IO.BinaryEncoder(requestStream));
    
                // C# blows up here!!!
                using (var responseStream = httpRequest.GetResponse().GetResponseStream())
                {
                    SpecificDatumReader someResponseReader = new SpecificDatumReader(null, SomeResponse.\_SCHEMA);
                    someResponse = someResponseReader.Read(null, new Avro.IO.BinaryDecoder(responseStream));
                    ...
                }
            }
    

    And java side handles the request, and respond like this: HttpExchange.getResponseBody().flush() or HttpExchange.close()

    public void handle(HttpExchange t) throws IOException {
    final DecoderFactory decoderFactory = DecoderFactory.get();
    final Decoder decoder = decoderFactory.binaryDecoder(t.getRequestBody(), null);
    SpecificDatumReader someRequestReader = new org.apache.avro.specific.SpecificDatumReader(GenericRequest.class) ;
    SomeRequest req = someRequestReader.read(null, decoder);
    ...

        SomeResponse someResponse = new SomeResponse();
        someResponse.setUserId("john.doe");
        someResponse.setResultItemList(results);
    
        DatumWriter someRequestWriter = new org.apache.avro.specific.SpecificDatumWriter(SomeResponse.class);
    
        final EncoderFactory encoderFactory = EncoderFactory.get();
        final Encoder encoder = encoderFactory.binaryEncoder(t.getResponseBody(), null);
    
        someRequestWriter.write(genericResponse, encoder);
    
        \*\*// HERE!!! flush or close will blow up C# side\*\*
        // encoder.flush();
        // t.getResponseBody().flush();
        // t.cl
    
    C#

  • .Net schedulers?
    D devvvy

    appliedalgo.com - scheduler with grid load balancing support jobs can be built in java/c++/VBA/dotnet... run on Windows/Linux...etc

    dev

    The Lounge

  • Dealing with people while cutting weight
    D devvvy

    "ok that will be good, now you can focus on x"... >so can really spin it around like this eh? Recently another dev "I'm wearing hat of tester, so I can't fix these bugs"

    dev

    The Lounge

  • work contract question
    D devvvy

    Such clauses inevitably diminishes incentive of developers to Create.

    dev

    The Lounge

  • Do I need GitHub?
    D devvvy

    Most works for governments and banks is prohibited from Git! Directives from compliance. So *everyone* uses GIT is not even close.

    dev

    The Lounge

  • If you're a small business or an indi....
    D devvvy

    dysfunctional? unless you operate (or work for) a small business, most things are political in nature.

    dev

    The Lounge

  • How can you tell if a SQL Server instance max'ed out bottleneck is Memory?
    D devvvy

    hi - How can you tell if a SQL Server instance max'ed out bottleneck is Memory? It's on a 8GB box with two processors. Seems CPU ok. Memory max out the whole time while this big SELECT-INTO statement is running. Avg Disk Queue lenght ok - avg below 1.0 so doesn't appear disk/paging is causing problem. However, fact from Task Manager memory keeps 7 GB out of 8GB over the whole time doesn't mean memory is the bottleneck? Or is it? The same query runs on another SQL server with double the RAM finishes a few times quicker however. Any advises? Thanks

    dev

    Database

  • Victim of MS experiment
    D devvvy

    I hear you brother, M$ has not been taking care of her developers and those who dwell in M$ ecosystem last couple years.

    dev

    The Lounge

  • Accessing WCF from Excel/VBA
    D devvvy

    every bank has this problem

    dev

    C#

  • Accessing WCF from Excel/VBA
    D devvvy

    yea the server side of things if you have anything to offer

    dev

    C#

  • Is there a way to capture all the page records in jqgrid when exporting to excel
    D devvvy

    Can you not dump data source of the jqgrid and save as csv?[^]

    dev

    ASP.NET

  • Accessing WCF from Excel/VBA
    D devvvy

    VBA is extensively used in Banking industry unfortunately.

    dev

    C#
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups