• Content count

  • Joined

  • Last visited

Community Reputation

2109 Excellent

About Oluseyi

  • Rank

Personal Information


  • Twitter
  • Github
  1. Been good, thanks! How are you? It's an interesting idea, but I recently learned that mere shared use of LLVM does not mean that the languages built with it are inherently link-able. Specifically, Rust and Swift both use LLVM as their back-end, but their object models are different enough that engineering the type transparency, etc is a significant lift. Most efforts at commingling the two, for now, focus on using C FFI as a narrow aperture for invocations. Pity.
  2. Image Processing Server

    For real-time processing, the delivery guarantees of HTTP (delivery receipt, retries) are an overhead you might not want. UDP does, superficially, seem like the way to go.
  3. Languages don't really make you a better programmer, concepts, techniques and algorithms do. Different languages are a proxy for this, as they bundle up opinionated implementations of a selection of concepts, techniques and algorithms. What you want to look for are different languages that espouse complimentary sets of concepts and techniques, and solve challenging problems using similar algorithms in them—so that you get a sense for how different languages (again, as proxies for concepts and techniques) occasion different implementation strategies. Good question, though.
  4. Hey guys, long time no post! Funny sequence of events that led to me checking in today. My take: nothing will ever "replace" C++, because nothing will ever have the same degree of critical mass/hegemony that C had and C++ inherited. The language ecosystem will be more diverse and varied, with individual languages and their code being more generally portable, and practitioners more able to switch toolsets because the norm today is to have high-quality, cost-free, often open sourced implementations. My other (and hotter!) take: JavaScript already "replaced" C++ as the language in which the largest subset of user-facing applications, and even server-side infrastructure, is written in.
  5. Should I drop pygame?

      Stick with PyGame. There is a tremendous amount of value in learning to solve problems in your given environment. There is also a tremendous amount of value in learning how to iteratively prototype and develop in languages like Python that offer a REPL (Read-Evaluate-Print Loop). Thirdly, there is a tremendous amount of value in learning different approaches/techniques embodied by different languages. A language like Python is deeply, trivially introspective, whereas a language like C# requires more elaborate reflection libraries to approximate the same; or Python's structural flexibility and preference for composition over inheritance versus C#'s object orientation orthodoxy. Over the course of your studies and, should you continue to pursue this professionally, career, you will need to work with and learn many different languages. Completing reasonably complex projects in different languages is a great way to build competence. Finish your current project in PyGame, then reevaluate and see if you want to move to Unity or something else for your next project. Good luck!
  6. How to encode h264 video

      I did exactly this using what is now libav for MPEG/H.264 encoding 5+ years ago. What encoder are you using, @amtri, x264?
  7.   Ah, I see what you mean. Is this a 2D strip or a full 3D "tube"? I'll tackle the 2D solution now, and then we can extrapolate to 3D as necessary.   The key is that the red points define a line through the center of your strip, and that at each joint the red point is the center of a cross-cutting line whose adjacent angle is precisely half the deflection between the segments. So, starting from the left of your diagram and numbering the red points p1, p2, p3 and p4: at p1 there is no previous segment, so our strip's ends are perpendicular to the vector <p2 - p1>; at p2 the cross section is at an angle relative to <p2 - p1> that is precisely half the angle between <p2 - p1> and <p2 - p3>; at p3 we have no next segment, so our strip's ends are again perpendicular to the vector, this tome <p3 - p2>. Remember that perpendicular lines have slopes that are the negatives of each other.   Using the above, you should be able to generate the points in your strip. Be careful in your algorithm to maintain the correct vertex order. I'll check back in a couple of days to see how you made out.
  8. Pygame - time and movement issues

    Unfortunately I can't run your demo because PyGame on OS X relies on X11, which I won't install, and my Linux box is temporarily out of commission. Nevertheless, I know what your problem is.     In your main loop, you do two things. You update the player position: player_pos[0] += player_speed player_rect.center = player_pos and you update the frame time, setting an upper bound on refresh frequency: frame_duration = clock.tick(FPS) # 1 frame -> ca. 16 milsecs The former assumes that frame_duration is constant, so it uses a constant increment for player position. The latter obtains the actual duration of the frame, which the PyGame docs tell us: "Note that this function uses SDL_Delay function which is not accurate on every platform…"   Your problem is that you are applying what you think is a constant displacement per constant time, yielding constant velocity, but in actuality your time is variable, making your velocity variable. To smooth it out, normalize your displacement by your actual frame time: FPS = 60 player_speed = 0.8 # pixels per frame basis_frame_time = 1.0 / FPS while 1: # ... frame_duration = clock.tick(FPS) frame_displacement = player_speed * (frame_duration / basis_frame_time) player_pos[0] += frame_displacement #... That should do it.
  9.   The fate of these causes is never "decided," anywhere. Change is individual, aggregated. That's why discussion about them is so important: because it's the vector for that individual change.         The rules are the rules. I shall abide them.
  10. Isn't that what is the accepted answer here?   Yours is a dictionary wrapped in a function, isn't it? If you're writing configuration purely for a Python program, why not make Python itself the configuration language? It's only worthwhile to invest in a different configuration format if you have to share it with other environments.
  11. I'm confused. Per my understanding, a polyline is a series of connected line segments—a polygonal chain. It can exist in 3D space, but it does not intrinsically define any surface, let alone volume. To want to make one out of triangles them strikes me as impossible, nonsensical (in the literal, non-disparaging sense). I'm sure this is a communication breakdown, so can you elaborate some more on what exactly you are trying to say?
  12. He's talking about beta versions of iOS, not beta versions of apps via testflight. And yes, they did remove the ability to rate any apps while running a beta version of iOS, but they only did so about a week back, in response to the wave of one star app reviews Oluseyi mentions.     Yep.
  13. First off, it's generally bad form to embed print statements inside a function that returns a value. What if I want to call it in a non-console context? Given Python's native tuples, you can return both the constructed object and an error string—or, even better, raise an exception on error.       The general use for keyword arguments is cases where some of them are optional. That way you don't have to provide a bunch of None values for parameters you don't care about.
  14. I've never liked these rules, and I've never liked the US-centric tech industry's cowardice about tackling them head on. I'm going to go out on a limb and say that 90% of the time the root reason for locking down discussions on identity issues, on these forums and elsewhere, is simply people's "discomfort" in talking about them. That's really convenient if the status quo doesn't actively harm you, but for those of us who do face constant risk and threat of various kinds, it's not a very impressive reason. I have a three-year old son. Just about every week in America, someone who looks vaguely like my son might when he gets a little older is killed by (sometimes self-appointed) authority figures. I look around my technology organization and virtually no one else who looks vaguely like me is in a position of core technology implementation, decision making or strategy. They're all in sales/marketing, QA or occasionally design. Every time I see a picture of a startup or technology firm's "technical braintrust," I count the number of faces that look vaguely like mine. 95% of the time the answer is zero. You're telling me that all of that is irrelevant, that it doesn't affect the products we create, the games we make? That the homogeneity of perspective in the creators doesn't bleed into the product? That critiquing the oversights in the product is not valid because it makes some people "uncomfortable"?     Let me tell you a story that involves GameDev.Net people—staff—whose names will be withheld. One year I brought my then-girlfriend with me to GDC. At this point I had been involved with GDNet for about 5 years, and attended GDC and met the other staff at least once or twice Sitting at a table with a bunch of GDNet people, one of them, A, started talking about my skin, and how "black" I was, and how you could only see my teeth. Now this is a problematic, often offensive characterization even within the black community, because darkness of skin has been used as a pretext for all kinds of discrimination (see: brown bag parties, for instance). My girlfriend was furious, but it was her first time meeting them so she didn't want to create a scene. Another staffer, B, has some black ancestry, and they were clearly uncomfortable as well, and at the next available opportunity they chipped in their 2 cents about identity and bias.   To insist that we can't talk about these things because they sometimes get uncivil strikes me as choosing the easy way out. Plugging your ears and claiming the silence means nobody is complaining. The ways that people act are often fundamentally uncivil, and we need to be able to point that out and grow, collectively, as a consequence.     I've been talking about race, but it's the exact same thing for gender or sexual orientation (where I am of the dominant class). The furor over Anita Sarkeesian's Feminist Frequency project suggests staggering ignorance not even about feminism and gender issues, but about media criticism. (Seriously. Read Mulvey.) How do we rectify that if we can't talk about it? And saying that, "Well, THIS isn't the place for it" just makes this a refuge for those who don't want to talk about it. The nature of a community is that it creates the familiarities in which people are willing to extend to each other the benefit of the doubt necessary to make contentious conversations potentially profitable. Absent that context, you get Twitter's instant devolution to death threats. This is exactly the place where these topics can be discussed productively.   »shrug«
  15. Parable of the Polygons

      You have to look at distribution per unit area. In this case, what percentage of shapes have more than 50% of their neighbors being the other shape. In the real world it's the high degree of ethnic concentration you see in some cities/neighborhoods, plus the low degree of interaction between adjacent ethnicities.   In any case, the essay/experiment establishes its own criteria for "diversity," and so the question is whether the above board fulfills it.