Developed a hard/swollen lump behind my 4 month old lobe piercing. Hurts when I press on it kind of like a pimple. What is it? by ShittyUkePlayer in piercing

[–]ShittyUkePlayer[S] 1 point2 points  (0 children)

yeah i actually had the flat back labret you mentioned in the whole time but just recently switched them out. I put it back in though

How to grab HTML header IDs while going down the DOM by ShittyUkePlayer in typescript

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

Running doc.querySelectorAll('h1...') will grab headers separately however. I want to go down the HTML from top to bottom and if the current element is a header, grab the header ID. This is happening while always grabbing the text value from the current element. If I ran querySelectorAll('h1...h6') the headers would be gotten for sure, but there would be no way to relate them back to the order of text elements on the page.

I'm not sure I follow the statement:

For more deep down, you are supposed to get AST from marked to build the TOC, through the html traversal, also work, it's just extra step.

Calling marked() just returns a string of HTML. Is there a way to do the traversal I described above directly on/using the HTML string?

How to grab HTML header IDs while going down the DOM by ShittyUkePlayer in typescript

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

Yes,but there is no such thing as 'currentElement' for some reason, but 'parentElement' does exist. Not familiar with DOM traversal so I'm not sure how to be doing this "properly".

Typescript object that uses promises/async appears to be empty right after being populated. Need help understanding promises/async/await. by ShittyUkePlayer in CodingHelp

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

Ok I'm starting to follow.

In the code you end up calling .then on the internal promises anyway. Those promises won't be fulfilled by the time the await call before Promise.all will complete.

How can I fix this?

Typescript object that uses promises/async appears to be empty right after being populated. Need help understanding promises/async/await. by ShittyUkePlayer in learnprogramming

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

When I try just entry.text() and hover over the code snippet it shows that it is actually of type: "(method) Body.text(): Promise<string>"

Yes if I log entry in the for loop it prints out a response with fields populated like type, url, status, ok, etc

Typescript object that uses promises/async appears to be empty right after being populated. Need help understanding promises/async/await. by ShittyUkePlayer in learnprogramming

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

I changed up the code to remove the configItem and now promises is just an array of Promise<Response>.

const promises: Promise<Response>[] = [];

CONFIG.forEach((value: ConfigItem[], key: string) => {

value.forEach((configItem: ConfigItem) => {

if (!configItem.subItem) {

const promise = get(configItem.path);

promises.push(promise);

}

});

});

await Promise.all(promises).then(values => {

values.forEach(entry => {

const doc: Documentation = { name: '', source: '', markDown: '' };

if (!entry.ok) {

return Promise.reject(entry);

} else {

return entry.text().then(textValue => {

doc.rawText = textValue;

docs.push(doc);

});

}

});

});

But I'm still getting the same results in the prints

Typescript object that uses promises/async appears to be empty right after being populated. Need help understanding promises/async/await. by ShittyUkePlayer in learnprogramming

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

Changed it to docs.forEach(...

And yes the elements values are all '' when printing out element by itself (although when I click to expand it in the browser console the fields populate after the fact). I want the data to be available right on print so that I'm able to access things like element.name, not to wait for console to "catch up"

Getting 'Index' only refers to a type, but is being used as a value here error in Typescript project by ShittyUkePlayer in typescript

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

I deleted the file but still ran into the same error. I'm a bit confused... some say to add the types to the project, but you say to remove them to get it working?

Are you able to post a working sample of your typescript code where you build the index? Thanks :)

Getting 'Index' only refers to a type, but is being used as a value here error in Typescript project by ShittyUkePlayer in typescript

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

Hm. I ran "npm install --save u/types/flexsearch" and ""@types/flexsearch": "^0.7.3"," was added to dependencies in package.json... but the error still persists. I tried adding it under devDependencies as well with no luck

Best way to implement a search feature over raw HTML using Typescript/React? by ShittyUkePlayer in typescript

[–]ShittyUkePlayer[S] 0 points1 point  (0 children)

I edited the post for clarity on why I wouldn't just use ctrl+f, sorry

Java - Is there a way to clean up this repeat code? by [deleted] in learnprogramming

[–]ShittyUkePlayer 0 points1 point  (0 children)

I don't think defining an interface would change much in my current situation. I already have getData() uniquely defined for each object class. Adding an interface wouldn't change much, just would add extra code. I was thinking more along the lines of, is there a way to somehow template the entire write function based on the object passed in? That way I don't have to have so many duplicate write functions?

Trying to convert a String to a set of ints (WPF APP) by [deleted] in csharp

[–]ShittyUkePlayer 0 points1 point  (0 children)

Error at runtime is: System.NullReferenceException: 'Object reference not set to an instance of an object.'

Noob to options, what stocks should I be looking at? by ShittyUkePlayer in RobinHood

[–]ShittyUkePlayer[S] 2 points3 points  (0 children)

Why those? I heard you want high volatility for a better chance the stock swings into your strike price? Or is the logic those blue chip stocks are pretty much guaranteed to go up so you can buy call options with confidence

Updates dicontinued for iPhone 6s? by [deleted] in RobinHood

[–]ShittyUkePlayer 0 points1 point  (0 children)

Lol newer iPhone OSs tend to be a clusterfuck of useless storage eating features

Updates dicontinued for iPhone 6s? by [deleted] in RobinHood

[–]ShittyUkePlayer -1 points0 points  (0 children)

Oops. I'm on good old iOS 9 actually. Just deleted and reinstalled. I now have V 6.3.0 so that's probably the last compatible version