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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

simpledeveloper

@simpledeveloper
About
Posts
223
Topics
91
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Need a suggestion
    S simpledeveloper

    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.

    C# json tutorial

  • Need a suggestion
    S simpledeveloper

    No I didn't hire him, I neither have authority to hire him my friend

    C# json tutorial

  • Need a suggestion
    S simpledeveloper

    He is asking for converting that into XML I will just create an another table out of this Database and convert and post it over there, simple jSon would have been better but he is saying he doesn't know

    C# json tutorial

  • Need a suggestion
    S simpledeveloper

    Hi I have a table which has 100s of 1000s of records, in it there is a column Blob which is storing a huge json string. We got a new Tableau Reports developer, who is saying he is not able to use that Blob column to read some data from it, because he doesn't know how to handle Json in Tableau. So he wanted me to write a Service to convert that Json string into Excel document, means it would be huge Excel documents in 1000s of numbers, if not in 100s of 1000s, can somebody please suggest me, what solution can I provide him. I already wrote the Service to Convert but writing into 1000s of Excel files is awful, I am looking for any better approach which can be feasible for both of us. Thanks a lot in advance.

    C# json tutorial

  • I am getting the following error while trying to run ./watch for my Ember JS application
    S simpledeveloper

    I changed to a new machine and from Visual Studio 2017 to Visual Studio 2019 I started getting the following errors when I was running watch command as below, which I used to do from the beginning

    PS C:\GitSrsCodes\IMS\IMS.Ember> ./watch
    npm WARN file-loader@4.2.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN less-loader@5.0.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN sass-loader@8.0.0 requires a peer of webpack@^4.36.0 but none is installed. You must install peer dependencies yourself.
    npm WARN style-loader@1.0.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN uglifyjs-webpack-plugin@2.2.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN webpack-cli@3.3.10 requires a peer of webpack@4.x.x but none is installed. You must install peer dependencies yourself.
    npm WARN ims-ember@1.0.0 No description
    npm WARN ims-ember@1.0.0 No repository field.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

    updated 2 packages and audited 2375 packages in 14.249s
    
    18 packages are looking for funding
      run \`npm fund\` for details
    
    found 348 vulnerabilities (17 low, 1 moderate, 330 high)
      run \`npm audit fix\` to fix them, or \`npm audit\` for details
    
    webpack is watching the files…
    
    (node:14388) \[DEP\_WEBPACK\_WATCH\_WITHOUT\_CALLBACK\] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
    (Use \`node --trace-deprecation ...\` to show where the warning was created)
    assets by chunk 1.37 MiB (auxiliary name: app)
      assets by path \*.png 4.17 KiB 5 assets
      assets by path \*.svg 540 KiB 2 assets
      assets by path \*.eot 182 KiB 2 assets
      assets by path \*.ttf 206 KiB 2 assets
      assets by path \*.woff 119 KiB 2 assets
      assets by path \*.woff2 93 KiB 2 assets
      asset login-bg.jpg 248 KiB \[compared for emit\] (auxiliary name: app)
      asset loading.gif 8.28 KiB \[compared f
    
    JavaScript javascript css help csharp visual-studio

  • Trying to read a value that is coming from html() function from Table Cell Id
    S simpledeveloper

    No actually when I am printing as below:

    console.log('$(t).html()');
    console.log($(t).html());
    let a = parseFloat($(t).html());
    console.log('a');
    console.log(a);

    console.log($(t).html()); is printing 1000 but after doing this, it is printing a value as NaN, any help please?

    JavaScript javascript html help question

  • Trying to read a value that is coming from html() function from Table Cell Id
    S simpledeveloper

    No totalRemaining is also printing as 5000.00, but when I am trying to add them its retuning NaN My total function as below:

            saveTotalPenalty: function (paramdata, id, indx) {
                var m = this.get('model');
    
                let totalRemaining = m.PaymentPlan.TotalAmount;               
    
                this.penaltyPerUnit = $(this.boxId).val() / paramdata.Cnt;
                this.penaltyPerUnit = this.penaltyPerUnit.toFixed(2);
    
                if ((m.PaymentPlan.ViolationsUniquePenaltyApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyApplied != 'undefined'))
                    for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyApplied.length; i++) {
                        let t = '#' + 'td0' + i;
                        let a = parseFloat($(t).html().valueOf());
                       
                        console.log('a');
                        console.log(a);
                        totalRemaining = parseFloat(totalRemaining) - a;
                        console.log('totalRemaining');
                        console.log(totalRemaining);
                    }
    
                if ((m.PaymentPlan.ViolationsUniquePenaltyNotApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyNotApplied != 'undefined'))
                    for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyNotApplied.length; i++) {
                        let t = '#' + 'txt' + i;
                        totalRemaining = totalRemaining - $(t).val();
                    }
    
                totalRemaining = totalRemaining.toFixed(2);
                $('#thTotalRemaining').html(totalRemaining)                
    
                if ((paramdata.PenaltyAssessed == null) || (paramdata.PenaltyAssessed == 0) || (paramdata.PenaltyAssessed == 'undefined') || isNaN(paramdata.PenaltyAssessed))
                    return;
    
                $('#td' + indx).html(this.penaltyPerUnit);
                var scope = this;
                var data = {
                    violationPenaltyAdjustment: paramdata,
                    CaseId: id,
                    PenaltyAssessed: paramdata.PenaltyAssessed
                };              
    
                scope.api('Paymentxxxn/AddTotalxxxx').post(data).then(function (response) {
                    //scope.set('model', response.Data.plan);
                    toastr.success("Payment added");
                }, function (error) {
                    Ember.set(payment, "isLoading", false);
                    toastr.erro
    
    JavaScript javascript html help question

  • Trying to read a value that is coming from html() function from Table Cell Id
    S simpledeveloper

    1000.00

    JavaScript javascript html help question

  • Trying to read a value that is coming from html() function from Table Cell Id
    S simpledeveloper

    Hi, I am trying to read a value from Table Cell, but even if I am using parseFloat, Number or any function its always returning me null value, hence total is coming as null from the below code of JavaScript, any help please?

    if ((m.PaymentPlan.ViolationsUniquePenaltyApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyApplied != 'undefined'))
    for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyApplied.length; i++) {
    let t = '#' + 'td0' + i;
    let a = parseFloat($(t).html());
    let b = Number($(t).html());
    console.log('a');
    console.log(a);
    console.log(b);
    totalRemaining = parseFloat(totalRemaining) - a;
    console.log('totalRemaining');
    console.log(totalRemaining);
    }

    JavaScript javascript html help question

  • Trying to limit a input type=text only decimal values with 2 digits after decimal
    S simpledeveloper

    But it didn't work Here is what I have put

    ${{input type="number" id=p.ViolationTypeId value=p.PenaltyAssessed maxlength="5" scale="0.01" pattern="^\d+(\.\d{0,2})?$" focusOut=(action 'saveTotalPenalty' p model.id p.PenaltyAssessed)}}

    I tried both individually and by putting both, still it didn't work, is Ember different, I don't know.

    JavaScript javascript help

  • Trying to limit a input type=text only decimal values with 2 digits after decimal
    S simpledeveloper

    I am working on an Ember application, I have a following JavaScript Code written to limit the entry of digits after decimal, this function is called in Key-Down event. Its working but what it is doing it, it allowing 3 digits after decimal but when I am posting its value on the Service, that is taking correctly 2 digits after decimal but what it is showing in the Textbox is 3 digits after decimal. And another request if possible is, can I do the same without using id attribute on the Textbox. Any help please, thanks in advance.

    allowOnly2Decimals: function (e1, event) {
    var boxId = '#' + event.path[0].id;

                if ((event.keyCode == 190) || (event.keyCode == 110)) {
                    this.decimalPressed = true;
                }
    
                if (this.decimalPressed) {
                    var t = e1.toString().split('.');
    
                    if (t\[1\] != null) {
                        if (t\[1\].length == 2) {
                            this.limitDecimal = e1;                           
                            $(boxId).val(e1);
                        }
    
                        if (t\[1\].length >= 2) {
                            e1 = this.limitDecimal;
                            $(boxId).val(e1);
    
                            return false;
                        }
                    }
                }                          
            }
    
    JavaScript javascript help

  • Trying to use and condition in Linq Query with join and on C#
    S simpledeveloper

    Hi I have a linq Query as below

    Query A:
    from a in violations
    join b in programs on a.ViolationTypeId equals b.ViolationTypeId
    join d in branches on b.BranchId equals d.BranchId
    join e in subprograms on a.ViolationSubtypeId equals e.ViolationTypeId into es
    from e in es.DefaultIfEmpty()
    join f in nonUniquePenalties on a.ViolationSubtypeId equals f.ViolationTypeId && f.ParentViolationTypeId==a.ViolationTypeId
    where a.ApplyUniquePenalty == true

    And I have an another Collection with name: nonUniquePenalties, which has ViolationTypeId and ParentViolationTypeId. the problem that I have is: violations has two fields, ViolationSubtypeId which can be null and ViolationTypeId can not null. Now I want to left join nonUniquePenalties such a way that, if violations doesn't have ViolationSubtypeId , it has to check only for ViolationTypeId of violations and ParentViolationTypeId of nonUniquePenalties, if violations has ViolationSubtypeId and ViolationTypeId, linq has to check for ViolationSubtypeId of violations with ViolationTypeId and ViolationTypeId of violations with ParentViolationTypeId of nonUniquePenalties. Any help please? And it has to be left outer join with other collections, since if there is no values in nonUniquePenalties, still the lnq should yield records. I tried a little bit, but any help would be very helpful, thanks in advance.

    C# csharp help database linq question

  • alias names for Column in Linq
    S simpledeveloper

    Hi I have a linq query in the following way where two column names from 2 different tables is same, which is giving me error, can somebody please help me in this? How to resolve with alias names if the names are same from 2 different tables and they are used either in select or in group - thank you so much in advance. Here is my linq query:

                    ViolationsUniquePenaltyApplied = (from a in violations
                                                      join b in programs on a.ViolationTypeId equals b.ViolationTypeId
                                                      join d in branches on b.BranchId equals d.BranchId
                                                      join e in programs on a.ViolationSubtypeId equals e.ViolationTypeId into es from e in es.DefaultIfEmpty()
                                                      where a.ApplyUniquePenalty == true
                                                      group new { a.ViolationSubtypeId, e.ViolationTypeName, a?.ViolationTypeId, b?.ViolationTypeName, b?.ParentViolationId, d?.BranchId, d?.Name, a.PenaltyAssessed, a.ViolationId, a.ViolationNumber }
                                                      by new { a?.ViolationTypeId, b?.ViolationTypeName, d?.BranchId, d?.Name, a.ViolationId }
                                        into g
                                                      select new
                                                      {
                                                          ViolationTypeId = g.FirstOrDefault().ViolationTypeId,
                                                          ViolationType = g.FirstOrDefault().ViolationTypeName,
                                                          ParentViolationType = (g.FirstOrDefault()?.ParentViolationId != null) ? (from e in programs where g.FirstOrDefault()?.ViolationTypeId == e.ParentViolationId select e.ViolationTypeName)?.FirstOrDefault() : g.FirstOrDefault().ViolationTypeName,
                                                          BranchId = g.FirstOrDefault().BranchId,
                                                          Branch = g.FirstOrDefault().Name,
                                                          PenaltyAssessed = g.Sum(pc => pc.PenaltyAssessed),
                                                          Cnt = g.Count(),
                                                          ViolationNumber = g.FirstOrDefault().ViolationNumber,
                                                          CountOrId
    
    C# help csharp database linq tutorial

  • Finding the definition of a component from the place of its use
    S simpledeveloper

    Hi we have a beautiful feature in Visual Studio that takes us from the place of its usage to definition if we right click and say go to definition or implementation. Can we do the same for JavaScript frameworks, is there any way to do it? For example I have a component usage as below:

    {{#link-to 'dashboard' tagName='li'}}

    , in EmberJS, can I go to the definition of this component?. Thank you so much

    JavaScript csharp javascript visual-studio tutorial question

  • Finding the definition of a component from the place of its use
    S simpledeveloper

    It doesn't do it

    JavaScript csharp javascript visual-studio tutorial question

  • Need to mask Alphanumeric values with some special characters allowed
    S simpledeveloper

    Yes I tried, its the mask value, which I am setting as mask='********************' is not allowing me to enter any special characters, if I remove it, its allowing all the characters and without limit. Yes my exposure to JavaScript and Frameworks is limited, I am not able to find solution. If I remove mask='********************', its not only allowing me all characters but unlimited number of characters, even if I try to set the max length property to 20 - need some help, thank you.

    JavaScript javascript regex help

  • Setting max length property of masked input control in ember js
    S simpledeveloper

    input component in ember as below:

    {{#each tags as |tag index|~}}
    * {{yield tag}}
    {{#if _isRemoveButtonVisible}}

            {{/if}}
        
    {{~/each~}}
    
    *           {{masked-input
            disabled=readOnly    
            class=(concat 'emberTagInput-input js-ember-tag-input-new' (if readOnly ' is-disabled'))
            maxlength='20'
            textMaxLength='20'
            placeholder=placeholder
            input-format='regex'
            input-filter='\[A-Za-z0-9\\ \\-@#\]{1,20}'
            input-filter-message='Complaint Id is not valid.'
            }}
    

    And I am using it in my hbs files as below:

            Complaint Id
            {{#tag-input
            maxlength=20
            tags=tags
            addTag=(action 'addNewTag')
            removeTagAtIndex=(action 'removeTagAtIndex')
            as |tag|
            }}
            {{tag}}
            {{/tag-input}}
    

    I want to set max length for the input that I enter as text in the textbox that comes with this component, any help please which property sets the max length that one can enter in it? Thanks a lot please.

    JavaScript javascript database regex help question

  • Need to mask Alphanumeric values with some special characters allowed
    S simpledeveloper

    OK I have written a function for onKeyUp, as below, but what I want is to remove those special characters that are not from the 3 in the above list -, @, #. Can you please modify the function how can I remove them automatically? Or suggest me for something. Thanks in advance my friend, JS function:

    forTest(e) {
    e = 'some test';
    },

    Ember Control (html input-tag control):

                            {{#tag-input
                            tags=tags
                            addTag=(action 'addTag')
                            onKeyUp=(action 'forTest')
                            removeTagAtIndex=(action 'removeTagAtIndex')
                            as |tag|
                            }}
                            {{tag}}
                            {{/tag-input}}
    
    JavaScript javascript regex help

  • Need to mask Alphanumeric values with some special characters allowed
    S simpledeveloper

    I have tried by putting the input-filter as below: input-filter='[A-Za-z0-9 \-_@#]{1,20}', it is accepting all the Alpha Numeric values but not allowing the 3 special characters that I want it to allow: -,@,#, can you please help me in this regards. If mouse functions are better, can you please give me an example here - thanks in advance my friend.

    JavaScript javascript regex help

  • I want to rename a table by using EF 6 Code First approach
    S simpledeveloper

    Funny - I don't have nuke weapons :), I did achieve it, I manually wrote up and down methods and ran them against, challenging, scary but did it, thank you both for the help buddies.

    .NET (Core and Framework) database help question
  • Login

  • Don't have an account? Register

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