[JS] Is there a smarter (read less verbose, but still readable and obvious) way to do this object destructuring and comparison? Ask Programming |
- [JS] Is there a smarter (read less verbose, but still readable and obvious) way to do this object destructuring and comparison?
- Questions about structuring a Minecraft-like world in javascript/three.js
- Need to find an app developer
- When I user .map to mmap over a populated array in this.state, why does it return undefined?
- [JS] A comprehensive library to convert "two point two million" into `2200000`
- How do databases utilize the WHERE function so efficiently (Finding all objects in an array that meet certain criteria)
- How does full-text searching work in SQL?
- Would you use NodeJS to write the coomunications sub-module of an enterprise application? Is it a safe choice?
- What code language should I use and how can I learn it?
- Cloned repo onto new machine, Python modules can't be found.
- python, html: reading and parsing emojis
- Good laptop/processor for programming?
- Code hygiene around the globe?
- Remember the name of this data structure?
- Beginner question random.choice
- CSS content property glitch
- What language should I attempt to mess around with and theoretically how would something like this be created
- Is anyone able to help me with Lunar to Solar calendar conversion and vice versa?
Posted: 29 Jul 2018 04:49 PM PDT Here's the code in question. I need to rip out old and new values from my state and compare to see if their equal. A simpler solution would be tracking changes with a flag but I prefer this. Any thoughts? [link] [comments] |
Questions about structuring a Minecraft-like world in javascript/three.js Posted: 29 Jul 2018 09:34 PM PDT The world is made up of chunks, which in turn are made of blocks (cubelets). Chunks will be stored in a database and loaded at runtime as needed. I'm having a hard time deciding on a good way to model chunks and blocks. As of now the chunk data looks like this: After the chunk data is loaded, the chunk mesh is generated by iterating through the blocks and getting the appropriate vertices and positions for each one, finally adding them to a single chunk mesh. I lack the programming vocabulary to properly explain the problem, so bear with me if I use the wrong term here. Problem is that the block DATA and the block MESH are not coupled. If I want to pick a particular block, I cast a ray which hits the monolithic chunk mesh and the only useful information I get is the chunk object that I hit and the location of intersection, which I can use to index into the chunk's block data, but it doesn't feel right at all and I want to nail down the foundational structure before I go any further. What's a better way to design this? Would it be feasible to store every block as a THREE.Mesh object and to just send the block type when serializing it? [link] [comments] |
Posted: 29 Jul 2018 09:14 PM PDT I'm looking for an app developer to build an app from my existing website [link] [comments] |
When I user .map to mmap over a populated array in this.state, why does it return undefined? Posted: 29 Jul 2018 08:48 PM PDT In my app I have a home component that is rendered after a user logins. In this home component's componentDidMount I fetch the documents associated with the logged in user. The fetch call works and the response is populated with the correct data. I take this data and make a this.setState call, setting the fetched data to this.state. In the home components render function I insert JSX that calls a function to map over this.state.docs and display that data. Even though the data in this.state can be logged successfully in the Home component's render function, the result of mapping over the data always returns undefined. If i create a new document it does get inserted and displays correctly, but the older documents never display. Here's my home component: [link] [comments] |
[JS] A comprehensive library to convert "two point two million" into `2200000` Posted: 29 Jul 2018 08:36 PM PDT I am looking for an NPM package or any code that would convert as many variations of English numbers in words into proper numbers. For example:
The last part (converting entire strings with multiple numbers) I can do on my own, and I can also replace "grand" with "thousand". But at least I need a library that supports things like "two point sixty-five". So far the best one I've found on NPM is Any recommendation please? Or maybe I am asking for too much? [link] [comments] |
Posted: 29 Jul 2018 08:23 AM PDT I am really curious how the WHERE function manages to be so efficient. I have doubts that it is as simple as this: (Python)
Explanation: In this example, there is a result_array, which we want to store all of the items from "Google" in. We loop through the fictional "database" object and if the "company" property of the item is "Google" we add it to the result_array. We're left with an array, result_array, full of our desired objects. What type of programming concepts should I look up to learn how things such as SQL's WHERE function searches for objects so efficiently? [link] [comments] |
How does full-text searching work in SQL? Posted: 29 Jul 2018 07:15 PM PDT My company has a document management system that allows users to search the text of a document. I will try to provide all the details that I can here - I'm not a systems expert so hopefully what I say makes sense. The doc management system is SQL based - all metadata about documents is stored in SQL. Images, electronic files, thumbnails, etc. are stored in a Windows directory, including the .txt files for each document that contain the searchable text. This directory also contains .idx files, and it sounds like these are used to speed up searching in SQL, but I'm missing something here with how this text in the .txt files ends up SQL (if it does) and how the text is queried. I apologize if this isn't enough information to answer the question. I can try to answer any questions about our doc management environment if that will help answer my question. [link] [comments] |
Posted: 29 Jul 2018 06:23 AM PDT I'm in a unique position. I'm the chief tech lead in my company (small software house) and I'm currently designing the architecture of an enterprise application for an important multinational client. One of the things the application has to do is manage the upload of huge files via browser and store them on disk, so my first go-to, for this specific task, was NodeJS. Other modules will be written in .NET or Java. One of my team members, however, pushed pretty hard to stop me from using NodeJS at all. He put forward several objections ranging from:
He comes from a Java/C++ background which make him despise everything that's not "as formal" as those ecosystems. I shut him down quickly when I saw he was being biased, but I took the last two points (security and enterpise-level) seriously. I'm still benchmarking based on our needs in order to choose the best tech among .NET, Java or NodeJS (which he would have done if I haden't told him to), and because this is my project, I'll decide what we use. However, the technical objections put forward are still looming in my head. The decision may be mine but I always consider my team's opinion, and he put a lot of self-doubt on my original assessment, making me doubt of myself to a point. What do you think? Should I have not considered NodeJS for an enterprise solution, even though it'll be used for just one module? [link] [comments] |
What code language should I use and how can I learn it? Posted: 29 Jul 2018 03:27 PM PDT I want to make a game, but I have little experience with coding. If I ever publish it, it would be a Steam game (I don't know if that would affect which I should use). What language should I use to make it and where could I learn it (preferably online)? [link] [comments] |
Cloned repo onto new machine, Python modules can't be found. Posted: 29 Jul 2018 03:20 PM PDT I've cloned my entire repo down onto a new Windows machine (from mac) and when I open up my project in Pycharm, I see this: errors I'm also getting "module not found" errors when attempting to run my tests with Pytest. I've set up a virtual environment and installed python, npm ,pytest, selenium ,etc. Why can't python see the modules even though they exist in the repo? [link] [comments] |
python, html: reading and parsing emojis Posted: 29 Jul 2018 03:11 PM PDT when I open up HTML files with emojis in Firefox, it renders emojis as something like: 𾌥 (chrome shows a blank square). when I parse the html files using utf-8 encoding it seems to stay in that format. Is it possible to read those characters in as something like thanks [link] [comments] |
Good laptop/processor for programming? Posted: 29 Jul 2018 01:27 PM PDT I'm relatively new to programming (about 1.5 years) and still in high school. I'm just programming for fun and have some mini projects. My question is what would be a good laptop to program on? What processor? Cores? RAM? What should I be looking out for? I'm primarily going to be using it to make and run neural networks. I've hit a wall with my asus i7-4710, 8 gigs RAM as it takes me a while to run more epochs with more complex dataframes. Any help would be appreciated. (Sorry if this doesn't belong on here but I though this would be the best place to post it) [link] [comments] |
Code hygiene around the globe? Posted: 29 Jul 2018 07:25 AM PDT I work as a freelance code monkey moving from company to company. Many of these places outsource to or have offices in places like India, North Africa, the Middle East and China. Software quality varies considerably, some good, some bad, but what seems to be consistently horrible is what i call code hygiene.
When pointing these things out in code review i get blank stares, and comments along the lines of "but the code works". Do other people get the same issues? Any idea what the underlying issue is? Any advice on how to get the point across? BTW, don't take this as a "foreign developers are crap" post, because this often appears unrelated to the quality of the solution. It just seems like there's no value placed on clean code, which is different from teams in the US and EU (not really worked with other parts of the world). [link] [comments] |
Remember the name of this data structure? Posted: 29 Jul 2018 06:33 AM PDT Solved, see bottom I saw this data structure posted to either Reddit or Hacker News a few months ago. It was something like a vector of fixed-sized chunks, and the author had used some of his other classes like a generic stack to build it. If you removed an item from it, instead of shifting all the following items like an std::vector does, it would mark it deleted in a bitmask (I think) and this allowed the user to keep stable pointers / iterators to individual elements. I'm quite sure it was C++. The author's page had this structure, and his stack class that was used to build it, and some other class (maybe a list). He had a bunch of benchmarks and graphs showing that it was faster than the STL classes at various tasks. I think it may have been intended for gamedev. The classes were all under the author's namespace, so it was like pfh::list, pfh::stack, pfh::(whatever the vector was called) but I can't remember the namespace either. Edit: One more thing, since it was structured sort of like a rope, it didn't copy anything when it reached capacity - It just linked in a new chunk and kept writing. So its push_back performance for large vectors was better than std::vector by miles. Edit: GOT IT! [link] [comments] |
Beginner question random.choice Posted: 29 Jul 2018 04:30 AM PDT Hey guys, I just started to learn how to program. I'm trying to create something that chooses random letters to create a fake word. This is what I got, and it works :)! import random letters1 = ['A', 'E', 'O', 'U', 'I'] letters2 = ['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z'] Locatie1 = random.choice(letters2) Locatie2 = random.choice(letters1) Locatie3 = random.choice(letters2) Locatie4 = random.choice(letters1) Locatie5 = random.choice(letters2) Locatie6 = random.choice(letters1) print(Locatie1+Locatie2+Locatie3+Locatie4+Locatie5+Locatie6) The only problem is, this program spits out 1 word everytime I run it. How do I get it to spit out lets say 10 words? [link] [comments] |
Posted: 29 Jul 2018 02:26 AM PDT Hello one of my friend's website made using wordpress has some issue. I am a web developer but I do not have experience with wordpress. I thought I could fix it but I could not Basically the website is this. The navbar item 'equipment sales' has a number 3 next 2 to it instead of a downward facing arrow. Now i know where this is coming from in css. The :before selector has a content attribute
If I try to change the number 3 to anything else it automatically changes back to 3. I have no idea why it i doing this. It would be great if you guys could take a look at it. [link] [comments] |
Posted: 28 Jul 2018 10:48 PM PDT Extremely new to any sort of programming, I really only know the basics of Java. I want to attempt to create a program that will be able to access a website through an account and enter information. I have no idea as to how I would even go about this including how the program would contact the site and preform actions under the account. Any direction would be greatly appreciated, thanks! [link] [comments] |
Is anyone able to help me with Lunar to Solar calendar conversion and vice versa? Posted: 28 Jul 2018 10:40 PM PDT Hi, I'm interested in doing up a Lunar to Solar calendar and vice versa conversion but I'm unsure of how to do up a formula. Can someone help me out? [link] [comments] |
You are subscribed to email updates from AskProgramming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment