These are chat archives for FreeCodeCamp/Help

18th
Jan 2019
Jose Pagan
@josepagan
Jan 18 00:02
@kbaig Thanks Yes indeed Im in the middle of it. It is quite interesting technology
idris
@idris12
Jan 18 02:16
@psyperl Thanks for the answer
Kranti Nebhwani
@darkphotonKN
Jan 18 06:50

@helper ModuleHelper(int parent, int self, int increment) 
{
    var modules = Model.Where(x => x.Parent == parent && x.IsEnabled == true).OrderBy(y => y.Order);
    var index = 1;
    var level = increment > 0 ? increment + 1 : 0;

    <ul>
        @foreach (var m in modules)
        {
            <li>
                @{
                    if (m.Parent == 0)
                    {
                        <h5>Top level @(index). @m.Title</h5>
                    }
                    else if (level == 0)
                    {
                        <a href="@(!string.IsNullOrWhiteSpace(m.Link) ? m.Link : Url.Action("Index", "Link", new { id = m.Id }))" title="@m.Title">First level @(level).@(index).@m.Title</a>
                    }
                    else
                    {
                        <a href="@(!string.IsNullOrWhiteSpace(m.Link) ? m.Link : Url.Action("Index", "Link", new { id = m.Id }))" title="@m.Title">else @(increment).@(index).@m.Title</a>
                    }
                }
                @{
                    if (Model.Any(x => x.Parent == m.Id))
                    {
                        @ModuleHelper(m.Id, index, (increment + 1))
                    }
                }
            </li>
            index++;
            self++;

        }

    </ul>

}
Can anyone tell what this razor (C#) in asp.net Code is trying to do, seems like looping out html but not sure about what '@helper ModuleHelper' is (which wraps the whole thing)
Jason
@swoopy_gitlab
Jan 18 08:48
@swoopy_gitlab
hi guys
can anyone help?
[ { "first": "Minimum of 30 characters required" }, { "middle": true }, { "last": true }, { "line1": true }, { "line2": true }, { "barangay": true }, { "city": true }, { "province": true }, { "email": "Minimum of 60 characters required" }, { "mobile": true }, { "nationality": true }, { "description": true } ]
can someone help me access this data to loop in a way i can filter objects based on the value?
abraham anak agung
@padunk
Jan 18 08:49
@swoopy_gitlab you can loop it using Array.filter() since the data is an array
Jason
@swoopy_gitlab
Jan 18 08:52
@padunk yea that what I'm looking to do, but not able to fix it.
Say
let filterNoErrors = arr.filter(props => arr[props] !== true);
abraham anak agung
@padunk
Jan 18 08:55
@swoopy_gitlab you should do props.middle !== true for example. props will return { "first": "Minimum of 30 characters required" } since your data is an object.
Jason
@swoopy_gitlab
Jan 18 08:55
ohh!
okay, so how i would do it for the rests of the objects @padunk
I'm thinking of a nested loop @padunk
abraham anak agung
@padunk
Jan 18 08:58
@swoopy_gitlab what you want the result is?
Jason
@swoopy_gitlab
Jan 18 08:58
I filter all objects that has value of true
@padunk
psyperl
@psyperl
Jan 18 08:58
maybe yourdata.filter( e => Object.values(e).includes(true) )if you want to search for true values
Jason
@swoopy_gitlab
Jan 18 08:59
@psyperl the oppsite actuall, wanted to omit the object that has a value of true
psyperl
@psyperl
Jan 18 08:59
use !
Jason
@swoopy_gitlab
Jan 18 08:59
actually*
psyperl
@psyperl
Jan 18 09:00
yourdata.filter( e => !Object.values(e).includes(true) )
May Kittens Devour Your Soul
@diomed
Jan 18 09:00
! = NO!
psyperl
@psyperl
Jan 18 09:01
you inverted the NO so that's yes @diomed
May Kittens Devour Your Soul
@diomed
Jan 18 09:01
@psyperl !WOMEN !CRY
Jason
@swoopy_gitlab
Jan 18 09:01
@psyperl got it thanks!
abraham anak agung
@padunk
Jan 18 09:02
BOBMARLEY === ! WOMEN ! CRY
Jason
@swoopy_gitlab
Jan 18 09:02
hahahaha
Jason
@swoopy_gitlab
Jan 18 09:09
Thanks man :)
psyperl
@psyperl
Jan 18 09:09
:thumbsup:
matheusdouradobr
@matheusdouradobr
Jan 18 13:30
Hi how are you =)
May Kittens Devour Your Soul
@diomed
Jan 18 15:38
does anyone know a thing or 2 about github pages?
psyperl
@psyperl
Jan 18 15:40
me know 1 and half
May Kittens Devour Your Soul
@diomed
Jan 18 15:41
@psyperl really?
psyperl
@psyperl
Jan 18 15:41
sometimes
May Kittens Devour Your Soul
@diomed
Jan 18 15:42
this happened when I forked and deployed https://github.com/30-seconds/30-seconds-of-css
I'm not sure why it doesn't look like their source
but is all messed up instead
psyperl
@psyperl
Jan 18 15:43
yeah the style seems broken
not sure if this releated but browser complaint about import 'focus-visible' it says...
SyntaxError: Unexpected string literal 'focus-visible'. import call expects exactly one argument.
maybe the - causes problem?
psyperl
@psyperl
Jan 18 15:49
and ic so this should look like https://30-seconds.github.io/30-seconds-of-css/ ?
May Kittens Devour Your Soul
@diomed
Jan 18 15:50
yes
psyperl
@psyperl
Jan 18 15:50
have you tried the other branch?
May Kittens Devour Your Soul
@diomed
Jan 18 15:52
what other branch?
psyperl
@psyperl
Jan 18 15:53
clipboard-autoprefix one
the index.html content is different than the one in master branch
May Kittens Devour Your Soul
@diomed
Jan 18 15:56
hmmm... how to choose to deploy from that branch via github open on web browser?
psyperl
@psyperl
Jan 18 15:57
Settings: Github Pages: Source
wait
that's the one you should use for the page
so choose the master branch /docs folder on the source
May Kittens Devour Your Soul
@diomed
Jan 18 16:03
ooooh!
sweet
thanks @psyperl
psyperl
@psyperl
Jan 18 16:03
:thumbsup:
kamransagheir
@kamransagheir
Jan 18 18:41
can someone help me out with rest api developmen
t
Jason Luboff
@JLuboff
Jan 18 18:44
Do you have a specific question?
Niraj Nandish
@Nirajn2311
Jan 18 19:34
@kamransagheir ??
Levis
@agabyte
Jan 18 23:03
Hi
Jason Luboff
@JLuboff
Jan 18 23:12
Hello
Levis
@agabyte
Jan 18 23:17
Currently learning D3. I'm stuck here. Not sure how to use selection
Is d3.selection a method or an object?
Aditya
@ezioda004
Jan 18 23:21
d3.select() is what they meant
You might wanna check the previous challenges
Jason Luboff
@JLuboff
Jan 18 23:27
@ezioda004 Becuase thats not confusing :joy:
Jose Pagan
@josepagan
Jan 18 23:54
is d3 still important? I read a medium post saying that it is not so much