• Breaking News

    Monday, June 17, 2019

    A very silly hypothetical about programming languages Ask Programming

    A very silly hypothetical about programming languages Ask Programming


    A very silly hypothetical about programming languages

    Posted: 17 Jun 2019 03:43 PM PDT

    There's a bit of a trend nowadays of new programming languages made specifically to improve upon its direct ancestors. Examples: Swift for Objective-C, Kotlin for Java, Elixir for Erlang, TypeScript for JavaScript and Hack for PHP.

    According to the TIOBE index, the most popular languages right now (and historically as well) are C, C++, Java, JavaScript and Python. Other than C, it seems all the mentioned languages have had an 'improved descendant' (that may or may not have failed).

    So lets imagine an unrealistic hypothetical. All the big tech companies got together to create one of these 'improved languages', and Kotlin and TypeScript and the like dont exist in this world. Given your own experience, what language do you think would benefit the most out of getting the improvement treatment? What do you think would end up benefitting the industry the most?

    C++ is a language that is literally everywhere as is often said to be bloated and difficult to work with, and JavaScript is now being thrown indiscriminately at every problem known to man, so I think these two stand out the most

    submitted by /u/revelbytes
    [link] [comments]

    Junior Developer - Company expecting too much? Should I leave or stay?

    Posted: 17 Jun 2019 08:24 AM PDT

    Hi all,

    This is my first post on here as I don't know where else to go for advice/help.

    I graduated in 2018 and have done my placement year as IT support for a big worldwide manufacturer. I was outsourced from there by another company as I saved the company a lot of money during placement with my solutions.

    I worked for that new company for the remainder of the summer until I got back to Uni for my final year. Once I graduated I instantly landed the job here with £24k salary and 2 days working from home(due to travel expenses). I've been told that there would be people to help out and that we can all learn together etc. This turned out to be a big lie as since I started I have been the only one developing software for customers, when I needed any extra help from other engineers they were no use to me since they didn't have a clue about any programming languages, only thing they knew a little bit was SQL, so I had to take all the duties for myself.

    My duties include:

    • Meeting up with customers who presented their problem and I would figure out a solution for them (This would include stock control, reporting and more) .
    • Designing database architecture for the software
    • Front-End and Back-end development
    • Dataflow for reports etc.
    • Creating PDF reports using PHP and SQL/MySQL
    • If a customer doesn't have a wifi infrastructure, I'd have to accommodate this by providing them with one and setting it all up from scratch.
    • Testing
    • Debugging

    So I basically handle the full stack development of an application, from start to finish, nobody but me.

    I'd be fine with all this but right now I am working on new projects and some bugs etc. come up in my previous software and I have to drop everything and go and fix that. My deadlines are basically all delayed as they have been set very unrealistically. I'm trying to move onto another project but the previous ones keep coming back to me as my manager would say to just get them out the door and then see what comes up, just to keep the customer happy instead of telling him/her it'll take an extra week.

    I don't have enough time for testing applications as I have to move onto the next ones and there always will be bugs as I can't dedicate a full day to testing an application, instead it's like an hour max, whatever I find in that hour I fix and then it goes to the customer. I also have to do the full installation so my development time gets shorter since I have to do so many other things.

    I feel like I am learning nothing as at first I started programming in C# and Java and then when the manager seen the progress he thought it was too slow(it was normal but he seems to lack technical knowledge), so instead I was given a license for 'Kalipso Mobile Application Generator' he told me to train myself up within this software and to create software within that as it'll be much quicker. Great it has made the work for me a lot faster but I don't get the flexibility that I get with using proper programming languages.

    The only thing I feel I got better at is problem solving, PHP, SQL and MySQL but I'd like to get better at C# and Java too.

    Now I am stuck because I have so much work here it's overwhelming, ridiculous, I do full stack dev yet my job title is Software Developer, I am using some software that makes me feel like I'm cheating myself, I am passionate about programming and I want to progress but now I feel like for almost a year, all these applications I've made are worthless because I didn't actually use anything else to create them than 'Kalipso' and some SQL. Currently I only enjoy making the reports as I actually get to be hands on with code like PHP.

    I've been here for 9 months on Contract as a Software Developer and altogether not including the contract 1,5 years including the summer time before uni etc.

    So since I haven't been learning much in work I decided to pick up Python, Java and C# in my free time at home, but I feel like this isn't good since I haven't made anything impressive and also this isn't professional experience which I could be getting right now in my job.

    I rambled on a little there, and thanks for reading if you did....

    Now I don't know what to do, whether I should demand more money (even if I got 30k I don't think I'd be happy here) or look somewhere else and tell the new future employer the truth that for a year I have made software in this application called 'Kalipso' and wherever I could I used my coding experience in order to develop things outside of that software.

    Again thanks for reading and for any advice in advance.

    submitted by /u/bulion96
    [link] [comments]

    How to determine the ideal keyboard layout for the Tibetan language?

    Posted: 17 Jun 2019 02:40 PM PDT

    Hey /r/AskProgramming,

    Caveat: I have 0 programming knowledge.

    I'm trying to figure out how to determine the ideal layout for a Tibetan-language keyboard. Tibetan script has 34 main glyphs, and I want to arrange these on a 12x3 key keyboard.

    To do this, I figure I need a database of text, which I would then want to convert to keystrokes, and then I could use this data to calculate how to map those keystrokes onto the keyboard in order to optimize the layout based on key frequency (common letters near the centre of the keyboard) and ergonomics (specifically avoiding having many subsequent key strokes on a single hand). However, I am at a loss of where to start with this. There are databases of Tibetan text online, but after that, I don't know what to do. Are there programs or apps that can help with this process, or is the task just totally above my capabilities?

    One relevant note -- Tibetan writing uses both stacked letters and adjacent letters; stacked letters are very common and are formed using the shift key. So, I would want to convert e.g. an "s" stacked on a "t" (which is called s+t in Tibetan transcription conventions) into the keystrokes "s shift t", because those are the keys that would be pressed to make it. However, normal "t" and stacked "t" seem to be different letters as far as keyboard programs are concerned. So, I want to make sure that s+t is read as "s shift t" and not as "s stacked-t". In other words, I want to make sure that shift is counted as a key in itself, and that stacked forms of letters are not differentiated from non-stacked forms when compiling the keystroke data. That is the main complication that I can foresee.

    Anyway, let me know what you think. Please tell me if there is a better sub for this. I considered /r/mechanicalkeyboards, but I think I need programming advice specifically to get started.

    Thanks!

    submitted by /u/Temicco
    [link] [comments]

    C++ Parallel Programming: Task farm is using all 4 CPU cores, but only at ~25% each.

    Posted: 17 Jun 2019 10:38 AM PDT

    Hi. I am trying to write a parallelised mandlebrot renderer for the CPU, and am planning on having only as many worker threads as there are CPU threads, with each thread pulling tasks from a collection of tasks. My problem is, this code below is not fully utilising the CPU is running approximately 3x slower than some older code which managed to utitlise 100% of the CPU cores by simply dividing the set into 16 equal chunks, and creating a new worker thread for each chunk.

    MandlebrotTask class

    class MandlebrotTask : public Task { public: MandlebrotTask(double& left, double& right, double& top, double& bottom, int& line) : left_(left), right_(right), top_(top), bottom_(bottom), line_(line) {} void run() { for (int x = 0; x < WIDTH; ++x) { complex<double> c(left_ + (x * (right_ - left_) / WIDTH), top_ + (line_ * (bottom_ - top_) / HEIGHT)); complex<double> z(0.0, 0.0); int iterations = 0; while (abs(z) <= 2.0 && iterations < MAX_ITERATIONS) { z = (z*z) + c; ++iterations; } if (iterations == MAX_ITERATIONS) { image[line_][x] = 0x000000; } else { int r = iterations % 255; int g = 0; int b = 0; image[line_][x] = (r << 16) | (g << 8) | b; } } } private: double& left_; double& right_; double& top_; double& bottom_; int line_; }; 

    Farm class body

    void Farm::add_task(Task *task) { task_queue_.push(task); // = std::queue<Task*> } void Farm::run() { //const uint8_t CPU_threads = std::thread::hardware_concurrency(); const uint8_t worker_threads = 4; vector<thread*> my_threads; cout << "no of worker threads: " << std::to_string(worker_threads) << "\n"; cout << "no of tasks: " << std::to_string(task_queue_.size()) << "\n\n"; for (int i = 0; i < worker_threads; ++i) { my_threads.push_back(new thread([&] { while (true) { if (task_queue_.empty()) return; task_queue_mutex_.lock(); Task *t = task_queue_.front(); task_queue_.pop(); task_queue_mutex_.unlock(); t->run(); delete t; } })); my_threads[i]->join(); } } 

    Main

    int main(int argc, char *argv[]) { double left = -2.0; double right = 1.0; double top = 1.125; double bottom = -1.125; Farm f; for (int y = 0; y < HEIGHT; ++y) { f.add_task(new MandlebrotTask(left, right, top, bottom, y)); } the_clock::time_point start = the_clock::now(); f.run(); the_clock::time_point end = the_clock::now(); auto time_taken = duration_cast<milliseconds>(end - start).count(); cout << "Computing the mandlebrot set took " << time_taken << " ms." << endl; cout << "Writing tga... "; write_tga("output.tga", image); cout << "Done!\n"; return 0; } 
    submitted by /u/WilliamWallace2K14
    [link] [comments]

    Tumblr-like custom html/css web editor/parser for custom themes

    Posted: 17 Jun 2019 08:15 PM PDT

    Hey, I know this is probably pretty specific, and from all the research I've been doing, no one in the public knows, but maybe asking here can at least get me pointed to something similar that I could hack away at.

    I'm working on making a tumblr-like platform, mostly out a desire to learn and grow rather than making a competing platform (but hey, if it goes somewhere all the better imo). Anyway, I'm trying to figure out what technology tumblr uses to handle their themes. They let users add custom html and css. And I believe custom Javascript as well.

    I'm just at a complete loss for what technology I could use to even come close to emulating something like that without making my own system from the ground up. I can't find any open source/FOSS web-editors what would integrate well. And even once I find that, I still don't know how I would logically (and safely/securely) handle that content and load it and everything.

    TL/DR: Need help in finding technology to emulate the tumblr theme editor for my own custom platform.

    Really, I'm just trying to find people to help point me in the right direction. Thanks for the help.

    submitted by /u/NovaFoxy161
    [link] [comments]

    I want to write a 75000x10000 matrix with float values effectively into a database. Help

    Posted: 17 Jun 2019 07:32 AM PDT

    Hi folks, thanks for hearing me out.

    I have a dataset that is of size 75000x10000 filled with float values. Think of it like heatmap/correlation matrix. I want to store this in a SQLite database (SQLite because I am modifying an existing Django project). The source data file is 8 GB in size and I am trying to use python to carry out my task.

    I have tried to use pandas chunking to read the file into python and transform it into unstacked pairwise indexed data and write it out onto a json file. But this method is eating up my computational cost. For a chunk of size 100x10000 it generates a 200 MB json file.

    This json file will be used as a fixture to form the SQLite database in Django backend.

    Is there a better way to do this? Faster/Smarter way. I don't think a 90 GB odd json file written out taking a full day is the way to go. Not even sure if Django databases can take this load.

    Any help is appreciated!

    submitted by /u/snorermadlysnored
    [link] [comments]

    Which is better to learn for monitoring and scraping media from webpages: Node or Python?

    Posted: 17 Jun 2019 12:36 PM PDT

    How does keygens pull off having a custom UI & embedded music in them?

    Posted: 17 Jun 2019 01:57 PM PDT

    Whenever I've seen one of those keygens that have a non-native UI (no windows border/funky animations) and no visible music file, I've wondered how they manage to do so,

    My guess with embedded music file is that they either do some EXE file standard trickery (like add the file in an area of the exe file it won't startle Windows and have the program read it's own exe file at that location) but other than that, how do they do it?

    submitted by /u/monkeynator
    [link] [comments]

    It's there an event calendar for coding competitions better than hackerrank calendar?

    Posted: 17 Jun 2019 05:23 PM PDT

    This is the only place I regularly check for news on upcoming coding contests. As a result, i missed Facebook's qualification round.

    Is there a better alternative?

    submitted by /u/objectively_an_owl
    [link] [comments]

    [Swift] - What are possible reasons for the error: Value of type "x" has no subscripts?

    Posted: 17 Jun 2019 12:18 PM PDT

    This is my code. I have gone through it but can't seem to fix the error.

    class homepage:UITableViewController, CLLocationManagerDelegate{ var people = [Userx]() public override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return people.count } public override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! ViewControllerTableViewCell let people: Userx people = people[indexPath.row] cell.lblName.text = people.Education cell.lblgenre.text = people.WhatIamConsideringBuying return cell } @IBOutlet weak var table: UITableView! var locationManager = CLLocationManager() override func viewDidLoad() { navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Sign Out", style: .plain, target: self, action: #selector(signOut)) super.viewDidLoad() let databaseRef = Database.database().reference() databaseRef.child("Education").observe(DataEventType.value, with: {snapshot in if snapshot.childrenCount>0{ self.people.removeAll() for people in snapshot.children.allObjects as! [DataSnapshot] { let peopleObject = people.value as? [String: AnyObject] let peopleEducation = peopleObject?["Education"] let peopleWhatIamConsideringBuying = peopleObject?["WhatIamConsideringBuying"] let peoplePhotoPosts = peopleObject?["PhotoPosts"] let people = Userx(Education: peopleEducation as! String?, WhatIamConsideringBuying: peopleWhatIamConsideringBuying as! String?, PhotoPosts: peoplePhotoPosts as AnyObject) self.people.append(people) } self.table.reloadData() } }) 

    This is Userx in a different file:

    class Userx { var Education: String? var WhatIamConsideringBuying: String? var PhotoPosts: AnyObject? init(Education: String?, WhatIamConsideringBuying: String?, PhotoPosts: AnyObject? ){ self.Education = Education self.WhatIamConsideringBuying = WhatIamConsideringBuying self.PhotoPosts = PhotoPosts } 
    submitted by /u/bee4534
    [link] [comments]

    Trying to debug a deadlocked python daemon, at a loss on how to get more debugging information

    Posted: 17 Jun 2019 02:44 PM PDT

    I've got a daemon running on a RHEL 7.6 running on Python 2.7.x that uses several C and a few CUDA libraries exposed modules in a production system that occasionally deadlocks. As far as I can tell it's a complete deadlock; SIGTERM is ignored and restart requires SIGKILL.

    We cannot debug the daemon in place as there is a requirement to keep uptime as high as possible and it often. The workaround we have is to detect the deadlock and restart the daemon. While it works, it's not ideal and has side effects which I fear will be detrimental in the future.

    Ideal solution for this situation is to use the deadlock detection to first call gcore and dump the memory of the daemon to disk prior to restart to debug the daemon offline using gdb. However testing this technique has revealed a problem, as GDB shows nothing when py-bt is calle on the core file, I suspect due to the fact that the daemon loads the modules dynamically. I don't know how to load those by hand though.

    My question is, given these circumstances, how one would capture the complete python stack for offline analysis? I think we can get at least a much clearer idea of where to look for the problem with just python stack trace, but right now I'm at a loss on how to get it under these circumstances. Any help would be appreciated

    submitted by /u/tossableaccount123
    [link] [comments]

    How to start private servers in modified APK files of android games?

    Posted: 17 Jun 2019 01:08 PM PDT

    Let's begin like this: I have no idea about this or coding, but I will learn to code in month or more.

    So, as you see, my question is how to make private servers in android games. What I mean is that certain games (like Clash of Clans) when played, user has to be connected to the server over network which does not allow you to cheat in any way such as having ulimited resources of as example gems, coins, elixir. If you somehow manage to change the server your game connects to (a server that I would be in control) it means you could change those rules about cheating or change your account settings. By settings I mean the amount of certain resources or levels.

    I'd appreciate if someone could explain me this process, or if possible teach me how to do it myself. Oh and by the way, I'm not thinking about modding Clash of Clans, but PUBG mobile because I had idea about playing with my friends alone and because we like customising characters and other things.

    You can tell I dont really care about is it legal or not, because there is worse things in this world than having a little fun while playing games.

    submitted by /u/Dragan_Pavlovic
    [link] [comments]

    Batch Processing HTML files based on Excel

    Posted: 17 Jun 2019 09:02 AM PDT

    I'm looking for a way to replace content in a few specific lines of an HTML template based on information entered into an Excel sheet, and then save each version of the edited HTML as a unique file.

    I've formatted the Excel file so that each row is the information that goes into one line in the code (e.g. the content in Row 2 is supposed to replace Line 144 in the HTML) and each column is all of the lines that need to be replaced for one version of the HTML. I can format the Excel sheet further to be the entire line of code instead of just part if that is necessary.

    I've tried VBA and TextScraper and they can get close, but not to the point of batch processing I need for this project. I'd also like to be able to save each HTML file as a specific name based on a different row in the Excel sheet

    submitted by /u/KeyCaterpillar3
    [link] [comments]

    Old style traffic game

    Posted: 17 Jun 2019 12:51 AM PDT

    Hello. I need some help because I m stuck . I m creating an old style 2D traffic game (kinda like old atari pole position) , but with the premise of the game modified. In my game the player is moving straight, without road curvatures, and from time to time, a crossroad appears and the player has to avoid crashing into other cars. And here my question comes : How can I make the crossroad " come to me" like, viewing it from far away, and getting gradually bigger. I don't know how to change the perspective in such way and I m stuck since the last Friday on it. So ,does anybody have any idea? Any kind of help is appreciated, thanks in advance. Have a nice day:D

    submitted by /u/andutzu7
    [link] [comments]

    No comments:

    Post a Comment