|
But yes I did send him the jSon now we are trying to write a generic SQL Query to read from jSon string instead of conversions, then he wanted me to help him in that I am trying using OpenjSon, do you know any idea how to read through jSon string which has objects embedded within other objects. Any idea you have my friend.
|
|
|
|
|
|
Store the data as a CSV text file; Excel opens it as a single sheet workbook.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Here's a suggestion; tell him to learn. JSON isn't complex; it is textbased, human readable, with plenty of tools.
My first was DBaseIV. Would you convert all to DBaseIV format if I told you JSON is too complicated?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
simpledeveloper wrote: We got a new Tableau Reports developer Send him back, he does not know how to do the job you hired him for! Calling himself a developer is disingenuous.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
No I didn't hire him, I neither have authority to hire him my friend
|
|
|
|
|
simpledeveloper wrote: Hi I have a table which has 100s of 1000s of records
simpledeveloper wrote: huge json string.
Excel limits.
32k maximum size for a cell
1,048,576 maximum rows
16,384 columns
Excel specifications and limits - Excel[^]
If you already have a 200,000 rows then a reasonable growth estimate would mean your solution would need to support 2,000,000 rows. And that is not going happen in excel.
You didn't define 'huge' nor what is in that json has but see the cell size limit and column limit. Again if you are already pushing those then growth would suggest you will exceed it.
simpledeveloper wrote: So he wanted me to write a Service to convert that Json string into Excel document,
Is this a one time job? On demand? Once a day? Once a minute? That will impact what is reasonable in terms of how long you your job can take processing this.
simpledeveloper wrote: convert that Json string into Excel document
Is that the only problem that it is json? Basically the acronym 'ETL' exists for this very thing. So why not do the following
1. Create another database, do not try to do this in the existing one.
2. Create a job that incrementally processes the rows and flattens outs the data into the new database.
3. Then the other person uses that database, with the data nicely parsed out to do what they want.
How to flatten it out? Well if the data is nice and stable then you could just create a table with the columns named appropriately.
If however the json is includes lots of depth and is dynamic then you will need to create a metadata solution such as a table that stores a name, and type, and perhaps another table with values. The types allows you to handle arrays and other embedded types (circular). Keeping in mind that this problem is one you would have needed to deal with an the Excel idea any ways.
This also allows the data to be kept up to date. Then it is up to them, not you, how often to actually pull the data.
|
|
|
|
|
I'm trying to change the language of our application at runtime.
I already have resx files for the different languages.
When I run this at the application startup it works; the translated (German) strings are displayed in the app.
var cultureInfo = CultureInfo.CreateSpecificCulture("de");
Thread.CurrentThread.CurrentCulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo;
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
When I try changing the language later on, the language is not updated.
I call the same code in my view with the different language strings (obviously).
var cultureInfo = CultureInfo.CreateSpecificCulture("fr");
Thread.CurrentThread.CurrentCulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo;
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
From what I can see That should be enough.
Is there something I'm missing ? Is there a call to update the UI I don't know about ?
Thanks.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
How are you displaying the localized strings in your view? And does the problem affect views you haven't displayed yet, or only views that are already open?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
In XAML, something like this :
<Label Content="{x:Static properties:Resources.General_Settings}" ></Label>
as I said, if I manually set the culture when the application starts the language works.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
As far as I can see, that should use the Thread.CurrentThread.CurrentUICulture to identify the resource file to use.
Are you sure you're running the code to change the language on the UI thread? And that the views weren't previously opened?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I decided to create a simple test application, a simple C#/WPF project, just a main window with a couple of controls.
I have resources in English and French. (1 string, English and French translation)
<Window x:Class="TestLayout.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:localization="clr-namespace:TestLayout.Localization"
mc:Ignorable="d"
Title="TestLayout" Height="450" Width="800">
<pre>
<StackPanel>
<Button Margin="10" Padding="5" Click="Button_Click">Click to change language</Button>
<Label Content="{x:Static localization:MyApp.General_Settings}"/>
</StackPanel>
With a simple callback.
<pre lang="C#">private void Button_Click(object sender, RoutedEventArgs e)
{
var cultureInfo = CultureInfo.CreateSpecificCulture("fr");
Thread.CurrentThread.CurrentCulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo;
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
var resourceManager = MyApp.ResourceManager;
var translatedString = resourceManager.GetString("General_Settings");
}</pre>
The strings are OK, Seems the UI is not updated.
Thanks,
will keep keeping on.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
The problem is that you're changing the language, but the view has already been loaded. There is nothing to trigger the {x:Static ...} binding to update. The value is loaded once, when the view loads, and never changes.
You'd need to change your code to use a {Binding ...} to a property on your view-model instead. Then raise the appropriate PropertyChanged event for the localizable properties when the culture changes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks,
I will investigate.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Not languages (yet), but for changing colors I've used "dynamic" resources.
Dynamic Localization In WPF
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hello! I am just curious if it would be good practice to have all of my layers in the same project, or should I create a separate project(Web API) as my data layer, for example, and call it from my MVC application.
I feel I can still create the separate layers in the same project but just use a controller as the middle layer to call a Web API that would handle the database inquiries, then report back to the controller for the View the user is interacting with. Does this sound like good practices for sticking with n-tier architecture?
Thank you!
|
|
|
|
|
I think you mean multiple projects in one solution. A project is (usually) an exe or dll (or both). The data layer is usually a dll. Easier (for one person) to work with multiple projects under development when they're in one solution.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
using Microsoft.ML;
using Microsoft.ML.Data;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
namespace MLModelx_ConsoleApp1
{
public partial class MLModelx
{
#region model input class
public class ModelInput
{
[ColumnName(@"Label")]
public string Label { get; set; }
[ColumnName(@"ImageSource")]
public string ImageSource { get; set; }
}
#endregion
#region model output class
public class ModelOutput
{
[ColumnName("PredictedLabel")]
public string Prediction { get; set; }
public float[] Score { get; set; }
}
#endregion
private static string MLNetModelPath = Path.GetFullPath("MLModelx.zip");
bool disposed = false;
public static ModelOutput Predict(ModelInput input)
{
MLContext mlContext = new MLContext();
ITransformer mlModel = mlContext.Model.Load(MLNetModelPath, out var modelInputSchema);
var predEngine = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(mlModel);
ModelOutput result = predEngine.Predict(input);
return result;
}
public void Dispose()
{
Dispose1(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose1(bool disposing)
{
if (disposed)
return;
if (disposing)
{
}
disposed = true;
}
~MLModelx()
{
Dispose1(false);
}
}
}
|
|
|
|
|
First, what makes you think you have a memory leak?
GC.Collect does not do anything about memory leaks. Calling it useless.
|
|
|
|
|
I see a constant Increase in the Memory Usage of the Server. Even I did try to run the Performance Profiler in VS 2019, and the memory usage patterns where very much similar to the system memory and it kept on increasing, and the system crashes after few minutes.
Any suggestions, where I went wrong.
|
|
|
|
|
The code you posted doesn't show anything that would leak, so no.
|
|
|
|
|
rahulgorai wrote: and the system crashes after few minutes.
That isn't a very clear statement.
In C# AppDomains exit when a OutOfMemory exception (OOM) occurs. So the 'system' in this case would mean you have one AppDomain and you are actually seeing an OOM and not guessing about what the exit is.
There are two general causes for this sort of error.
1. Your general, and complex, processing is very slowly leaking somewhere.
2. You have some very specific code, and when it runs it causes the problem.
3. You are not leaking anything. Your processing is just using more memory than what is available.
4. You have a problem with Large Objects.
For 2 the stack trace of the OOM will often reveal this. However the nature of the cause of the OOM might mean that you need to collect more than a couple of these to see the problem.
Problem 3 occurs because the VM has been limited. This can specifically happen when running in IIS. But can also occur for other reasons including the way the OS is set up.
For 1 you just need to dig in and start looking for incorrect things such as collections that keep adding the same object (duplicates) rather than removing/replacing anything. Note that with a 64 bit system and without limits from other sources this should be a rare occurrance.
For 4 you are going to have a different problem. The Large Object Heap is a problem due to the way that that is specifically implemented. It is impacted in the same way as others by limits placed on the application but can occur sooner. There is no quick, and easy way to explain it but if you are doing work anywhere in your application that uses memory streams and/or large allocations then those are going to be the problem areas. Basically anything over 80k freezes memory and puts large unmovable holes in the heap, which by themselves can lead to OOMs. Fixing it means to stop doing memory streams and/or large memory allocations.
|
|
|
|
|
hi all
i need a source code for reading .tag (DataFlex) file and show its content on datagridview ( File Extension )
Thanks
modified 15-Jul-21 10:11am.
|
|
|
|
|
fat61 wrote: I Used this code, but it is wrong:
Why do you use the "wrong" code rather than to fix it?
|
|
|
|
|
the Message "the code is wrong" isn't a useful information ...
Perhaps, if you still want help, you tell us what happens and what should happen.
But basicly : have you tried to look what really happens with the Debugger ? This would be the best way to get a Solution ...
|
|
|
|