• Breaking News

    Wednesday, January 3, 2018

    Why was 1080p chosen as a standard?? Ask Programming

    Why was 1080p chosen as a standard?? Ask Programming


    Why was 1080p chosen as a standard??

    Posted: 03 Jan 2018 02:41 PM PST

    My current hobbyist project has brought me to some bare metal frame buffer manipulation, and in thinking through various algorithms to perform the fundamental tasks (drawing a line being the current example) it seems completely unreasonable if not idiotic to me to choose a number that isn't an integer power of 2 as the standard width and height!

    To determine the y-coordinate (and from that the x-coordinate) of a pixel in a bitmap, for example, it is a necessity to use integer division and the mod operator; two processes which at such a low level could only realistically be performed by bit-shifting by log_2(width)- so where does this wonky standard come into play??

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

    My first language was BASIC. Is there any hope for me?

    Posted: 03 Jan 2018 05:41 PM PST

    The common wisdom (or at least a well-worn meme) holds that using BASIC causes irreversible brain damage.[1]

    It's been many years since I went anywhere near it, but it was still my first language, and these things can be formative in deep and subtle ways.

    I'm comfortably north of FizzBuzz level, and I did all of the 2017 Advent of Code problems without too much trouble (though day 23 part 2 was pleasantly challenging), so I don't think I'm entirely broken, but it's possible that I'm damaged in a way I can't see. Is there a way to check for symptoms, and if I do have a problem, is there anything that I might be able to do in the direction of recovery?

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

    Trying to scrape a page but a "GET" request redirects me to the homepage

    Posted: 03 Jan 2018 05:39 PM PST

    So I am trying to scrape this webpage using NodeJS. I am using 'request' to do this but the problem is that doing a "GET" request on that page gets me the HTML source of the website's homepage. I want to be able to get the data of the webpage in the url. I even used Postman on that URL and I get the data from the homepage and not the link specified. I simply need the HTML source of that page, any ideas?

    Edit: Figured it out, added a header to my request which fixed it.

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

    Where can I learn the basics of/and exploit writing?

    Posted: 03 Jan 2018 05:29 PM PST

    The title says it all (I know quite well java, php, html and C#), maybe If you could link some good resources/lectures to get me started properly.

    Thanks.

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

    XML data to html

    Posted: 03 Jan 2018 05:17 PM PST

    Heyoo, Im a little confused about how to get xml data into my website im coding using ATOM. Im trying to get some of the data to be show through html from the following link:

    https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=true&stationString=KRHV

    Thanks in advance!!

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

    What's the best format to write scripts in for a developer to use for a scripting language?

    Posted: 03 Jan 2018 04:31 PM PST

    I'm tasked with writing scripts for a scripting language, but I am not the programmer. I'd like to organize the scripts in such a way that will not be frustrating or slow down a developer. Thanks for any suggestions or advice!

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

    Entering the world of PHP again, should I use a custom framework this time?

    Posted: 03 Jan 2018 03:22 PM PST

    My last php app speaks to my mysql database, and has both android and web interfaces.

    Given my current infrastructure, is it worth continuing my own custom framework? I will have to redo quite a bit since its a different application.

    I will need a new feature to sign in and accept payments. (Although I can always go the dirty route and accept payments offsite)

    My question: Should I use a framework? I would be likely make the web version beautiful and shell it in Android (and maybe iOS)

    Bonus: Any other php suggestions? I was slugging it with netbeans, manual FTP uploading, and a broken debugger.

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

    OOP: How many copies of a method are there at run-time?

    Posted: 03 Jan 2018 03:13 PM PST

    More specifically, for a non-static type with methods, does each object have it's own copy of that class's methods with that object's local variables substituted in? Or is there a single copy of every method with some kind of pointers to substitute the variables from the specific object the method is being called from? Something else entirely? I understand this question may not even apply to some programming languages; I'm thinking of those like Java, C++, C#, Scala, Python(I think?), etc.

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

    I need a team to participate in BattleCode 2018

    Posted: 03 Jan 2018 11:24 AM PST

    What framework to use for a single-load experience?

    Posted: 03 Jan 2018 03:05 PM PST

    Hello everyone.

    I want to create my blog website. I'd like it to work all over AJAX so only the first page has to load, and after that all other content loads almost instantly.

    My layout is already finished. I could start to write a shit-ton of code to handle pagination and everything myself, but I have learned about frameworks like Angular and React now. These seem to exactly what I want, but I just can't start using them.

    Can someone recommend me a framework that suits my needs, with a rather simple example of a basic website?

    I can find some samples on react and angular, but most of the time these are simple applications (classic todo-list or tic-tac-toe game) but almost never a simple website, layout or login system or anything.

    Can someone point me in the right direction please? Thanks

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

    Pathfinding algorithm for variable terrain.

    Posted: 03 Jan 2018 06:48 AM PST

    It's easy to find a pathfinding algorithm for an area where the character either can or can't go through any given coordinate in the playing field. But what if, instead of boolean, any given point in the playing field has a number between 0 (can't pass) and 1 (can pass at top speed), and any number in between would slow the character by the corresponding amount.

    How would you find the fastest path in an environment like that?

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

    Highcharts Data Download

    Posted: 03 Jan 2018 01:55 PM PST

    So I'm trying to extract the data from the three Highcharts Charts on https://coinmarketcap.com/charts/

    The data array that I want is highcharts.charts[0], highcharts.charts[1], highcharts.charts[2] I believe. I tried to add a "downloadxls" option in using the highcharts script but was unsuccesful. Hoping someone can help me to figure out how to extract the data--don't have enough web-based programming knowledge to be successful alone here.

    Really appreciate any help that you can give!

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

    What kind of Programmers needed for this?

    Posted: 03 Jan 2018 09:44 AM PST

    Dear r/AskProgramming

    I would like to know what kind of programmers are needed to develop a site like bitfinex.com it has various apis to drive the order books, trades n tickers. I m trying to figure out if this is a microservice driven architecture with node or something of that sort or built with Python or ROR. Front end is easier to understand react or angularjs could do but i can't figure out back end. What kind of database support such faster database transactions.

    Thank you for help in advance

    submitted by /u/20CharactersLong
    [link] [comments]

    java.Lang.RuntimeException after update

    Posted: 03 Jan 2018 07:43 AM PST

    Hi i need some help. My favorite " recent apps " app just stopped working out of the blue . My phone is a Samsung galaxy s5 (sm-g900r4) on us cellular. Its running Resurrection remix os (RR-N-5.8.5-20171231-klte-final(7.1.2)) with magisk manager and xposed framework installed as well.

    If your familiar with res remix then I'm sure you know of the configurations menu in setting in that menu you will find that you can change the overview or "recent apps" in settings>configuration>recent>recent type. Then there is a slim resents setting menu where you can select to add a side bar. When I click on the add sidebar content I get a pop up saying " Settings has stopped" and takes me back to app drawer. the Slim recent still works but its not allowing me to set up the sidebar which is the main reason i like it. Everything has been running fine for the last 3 days with no problems, and then i updated res remix to this latest version it was fine for the last few days worked fine.

    I cant figure this out but, it's really making my head hurt (lol). The fact that i shut my phone off and made a back up in twrp and then restored it back to before i updated res remix, and it still wont let me go to that menu. I had it set that way for 4 or 5 months prior to this incident. Today I used a xposed module called Cracked to collect uncaught Exceptions when a app crashes and it gave me the run time exception report.

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.rr.SlimRecentAppSidebarActivity}: java.lang.IllegalStateException: Must specify preferenceTheme in theme at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2699) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2766) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1507) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6236) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102) Caused by: java.lang.IllegalStateException: Must specify preferenceTheme in theme at android.support.v14.preference.PreferenceFragment.onCreate(PreferenceFragment.java:221) at com.android.settings.rr.RecentAppSidebarFragment.onCreate(RecentAppSidebarFragment.java:38) at android.app.Fragment.performCreate(Fragment.java:2336) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:949) at android.app.BackStackRecord.setLastIn(BackStackRecord.java:860) at android.app.BackStackRecord.calculateFragments(BackStackRecord.java:900) at android.app.BackStackRecord.run(BackStackRecord.java:728) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578) at android.app.FragmentController.execPendingActions(FragmentController.java:371) at android.app.Activity.performStart(Activity.java:6700) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2662) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2766) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1507) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6236) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)

    I started to learn how to code last October but i haven't really gone over run time exceptions a lot maybe 1 or 2 lectures have talked about it but not in great detail. Can some one please explain to me or help me figure it out? I do see that it was caused by: java.lang.IllegalStateException: Must specify preferenceTheme in theme. I never themed it so I'm not sure where to do it. I'm going to do some googling and see what i can turn up "on the line"

    Thanks

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

    Need help with making a leaderboard in C++ from a .txt file.

    Posted: 03 Jan 2018 06:01 AM PST

    So I'm a junior programmer and I'm making my first C++ program now, a console game, and in it you can get points, and after the game is over I made it ask you for a name. That name, with the points, is stored in a leaderboards.txt like so:

    nameone 10 nametwo 16 namethree 172 

    So basically, string, integer, enter, repeat.

    Now, I need to make it "cout" a leaderboard, for which I have to, I guess take the files, sort them with bubble or any other sort, and print the sorted result. Or it could sort upon putting the name and points into the .txt... Anyhow I have no clue as to how to do this...

    I've been reading that it's the easiest to do with vectors but we haven't studied that so I have no idea what they are or how to use them, so I probably shouldn't.

    Or to take them to an array, apply the sort, and then print it out. No idea how though again.

    please help im desperate

    The code I have so far:

    ofstream file ("leaderboards.txt", ios::app); if(file.is_open()){ file<<name<<" "<<pts<<"\n"; file.close(); mainmenu(); } else cout<<"Error"; } void sortLeaderboards(){ // ???? help } 
    submitted by /u/Iron_Fury
    [link] [comments]

    Where is the error in my text-to-speech (TTS) with google API on Java?

    Posted: 03 Jan 2018 09:27 AM PST

    Where can I get cryptocurrency prices with Python?

    Posted: 03 Jan 2018 09:17 AM PST

    I'm not sure if this question belongs here and I'm sorry if it doesn't. I'm having trouble finding a way to get cryptocurrency prices(that update regularly) for Python. I only need them for comparison as this project is just a learning experience for me. Again, sorry if this is not the appropriate subreddit.

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

    Library for image processing in java (JavaFX)

    Posted: 03 Jan 2018 06:48 AM PST

    I'm woriking on JavaFX application that "merges" selected images. What I mean by "merging":

    There are three modes, in each i compare one by one pixels in the images and chooses one of them based on the mode specification.

    Modes:

    • AND (0 and 1 = 0, 0.8 and 0.2 = 0.2, ...)

    • OR (0 or 1 = 1, 0.8 or 0.2 = 0.8, ...)

    • XOR (0 xor 1 = |0-1| = 1, 0.8 xor 0.2 = |0.8-0.2| = 0.6, ...)

    (color of pixels normalized to [0,1] to make the example simpler)

    I have to be able to load in and save as .png, .jpg, .jpeg, .tiff, .tif, .bmp, compressed and not, with various color depths.

    And I was wandering whether there is any library I could use to easly do the image operations

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

    Best practices for a system that catches a stream, caches it, and runs analysis?

    Posted: 03 Jan 2018 12:09 AM PST

    Hello /r/askprogramming,

    I have a best practices question for a python project I'm working on. I know my way around threads pretty well, but I want to make sure I'm thinking about this right.

    I have a thread that's catching data from a socket in realtime and updating a cache class. At some points I need to run analysis on the data in the cache, and I want to do it without adding latency to the cache. Also, I want to be able to watch the stream for keywords and trigger an analysis.

    I could just manually take control of the interpretor and do this all without threading (since python threading is emulated anyway) but I'd like to learn the proper way to do this as well.

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

    No comments:

    Post a Comment