Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ultrafilter
Aug 23, 2007

It's okay if you have any questions.


HappyHippo posted:

What else would you call simulated annealing?

Hill climbing with excursions.

Adbot
ADBOT LOVES YOU

Polio Vax Scene
Apr 5, 2009



Corporate has decided to throw money at me, under the condition that it be spent to educate myself about further language possibilities. If I'm already good with C#/.NET/SQL/JS what other stuff would be good to pick up? What is the popular thing all the kids are hip with these days? I was considering PHP but I hear a lot of horror stories. Same with Ruby.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

ultrafilter posted:

Hill climbing with excursions.

That's a good way to phrase it. Its just Hill Climbing with support for avoiding local minima/maxima.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Manslaughter posted:

Corporate has decided to throw money at me, under the condition that it be spent to educate myself about further language possibilities. If I'm already good with C#/.NET/SQL/JS what other stuff would be good to pick up? What is the popular thing all the kids are hip with these days? I was considering PHP but I hear a lot of horror stories. Same with Ruby.

Forth.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Manslaughter posted:

Corporate has decided to throw money at me, under the condition that it be spent to educate myself about further language possibilities. If I'm already good with C#/.NET/SQL/JS what other stuff would be good to pick up? What is the popular thing all the kids are hip with these days? I was considering PHP but I hear a lot of horror stories. Same with Ruby.

F# - might as well learn functional in what sounds like your home ecosystem.

Peristalsis
Apr 5, 2004
Move along.

Manslaughter posted:

Corporate has decided to throw money at me, under the condition that it be spent to educate myself about further language possibilities. If I'm already good with C#/.NET/SQL/JS what other stuff would be good to pick up? What is the popular thing all the kids are hip with these days? I was considering PHP but I hear a lot of horror stories. Same with Ruby.

I guess it would help to know what direction to go. Does your company want you investigating platforms for some future web app, or do they just want you to go take classes that will expand your mind as a programmer? Is there any mobile programming in your future? And what are your goals for this - to make yourself more employable, to expand your mind, or to learn something on your company's dime that you just want to tinker with at home?

For web development, Ruby on Rails seems to be pretty popular. I'm not sure what you've heard about Ruby, but I found it to be an adequate scripting language, with enough differences from other languages I've used to be interesting. I'm not as familiar with Rails yet, but it seems to be a good skill to have, regardless of whether or not people like it. Python is popular, too, though I haven't used it.

If you're doing any number crunching or other math/engineering type work, Matlab is good to pick up. There are some free knock-offs of it, though I haven't had great luck with them. Similarly, R seems to be very common for stats stuff.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Manslaughter posted:

Corporate has decided to throw money at me, under the condition that it be spent to educate myself about further language possibilities. If I'm already good with C#/.NET/SQL/JS what other stuff would be good to pick up? What is the popular thing all the kids are hip with these days? I was considering PHP but I hear a lot of horror stories. Same with Ruby.
The cool kids program in Go, Node.js, Clojure and Haskell. Everyone else figures out where the nails are before deciding on a kind of hammer.

Seriously, ask what your problems are, and what the best tool is for the job. There's still situations where COBOL is the right answer.

Fly
Nov 3, 2002

moral compass

Manslaughter posted:

Corporate has decided to throw money at me, under the condition that it be spent to educate myself about further language possibilities. If I'm already good with C#/.NET/SQL/JS what other stuff would be good to pick up? What is the popular thing all the kids are hip with these days? I was considering PHP but I hear a lot of horror stories. Same with Ruby.

If you're not already very familiar with functional programming, Munkeymon's F# (or Haskell, or Clojure) would be good for learning. I'd recommend something only-functional like Haskell since you'll otherwise just end up trying to write C-ish/imperative code in that language. If you go that route, be sure to read some good functional programming stuff first. E.g., The Little Schemer or Why Functional Programming Matters.

Heck, I recommend you read those two no matter what if you haven't.

edmund745
Jun 5, 2010
I am writing an employee scheduling program that the company I work at (~5500 people at ~50 locations) may or may not use. They haven't seen it yet, and they didn't ask for it. What they have now (paper and pencils!) sux tho.

There is a separate file for each calendar week. Each file contains all the information on the people that are in it, so that it is 'complete' and doesn't ever need to reference any other file in order to be readable.

The weekly schedule data files started out written as plain text so I could troubleshoot things easier. I was planning on using some other mode later.

At some point I got the bright idea of leaving them plaintext..... That way the weekly files could be written as web pages that show simplified versions of the schedules, and still contain the program's full data hidden as comments in the web page tags. And because of this, anyone could view the schedule file just by using a web browser, if they did not have the full program or did not know how, or simply did not want to bother to use it.

There is a size increase, but it is not prohibitive: a week file with ~125 people is only around 250K, and adding on the HTML stuff only sticks about 30K more onto it. I would suppose that the greater accessibility would be worth it.

Is there a name for this? Do any programs already do it?
If not then this is patented and you all owe me one BEEEEELion dollars.

nielsm
Jun 1, 2009



Sounds vaguely like what MS Word 2003 did when asked to save as HTML: Produce a file that's technically HTML, but is also stuffed with all kinds of additional data intended to make it load (almost) perfectly as the original document back into Word.

csammis
Aug 26, 2003

Mental Institution
Or are you asking if there's a name for the general idea of marking up data with HTML so it can be viewed by a web browser? Because that's "HTML"

Tres Burritos
Sep 3, 2009

So in a phone interview a prospective employer mentioned that they may want to start creating an API for all their in-house poo poo. Where is a good place to start learning about making an API? What languages work for APIs? REST or SOAP? Are there other big questions that need to be answered first?

I mean, I've started googling around, but is there a super awesome resource that I should start with or a paper that I should definitely read or anything like that?

nielsm
Jun 1, 2009



First, figure out if they actually do mean a web service API or if it's supposed to be a regular local call API. The kinds of designs to use need to be different to cater to the strengths and weaknesses of local vs. remote call interfaces.

Now if you have never written a public interface for wide consumption for some application or set of applications, you will probably make a ton of mistakes. Make sure you catch them early, test your poo poo, also before you start writing any code. Run through use cases. Do role-play sessions if necessary.

If the intention is a remote call API (web service), first of all stay away from SOAP, it's a royal mess. It's very rare that two implementations agree on how things are supposed to work, I think I've even heard stories about implementations that couldn't read back the service definitions it had generated itself.

Basic JSON-over-HTTPS is generally a safe bet. You can build some kind of stateful sessions on the server system if you want (making it not RESTful), don't be afraid of doing that if the existing systems are very stateful.
If you use JSON for data representation, make sure you are consistent about your representations of things. It's an easy trap to fall into, to hack things up and end having like things act completely different. People will hate you for that, and your documentation will be hell to write.
Consider whether the application(s) the API is for mostly work with object storage/retrieval, or whether you will actually be doing more complex operations on them. If it's the former, using the HTTP verbs as intended can work fine. If it's the latter, I would restrict things to the GET and POST verbs, and use POST for all non-retrieval operations, storing the actual operation inside the JSON payload. This makes it more like a traditional RPC protocol. (Look into JSON-RPC for this too.)

Read the documentation for a ton of existing APIs for other services. Both for ones similar and dissimilar to what you will be doing. Get a feel for how the different ones are designed, and what kinds of documentation you like and dislike.

Start out by writing a small proof-of-concept prototype implementing a single or two small functions, to get a feel for how working with the stuff actually is.
Then start writing documentation for the entire system you want to build. Document the entire API before implementing it.
When your documentation is finished, begin implementing it. It's okay if the implementation doesn't match the documentation completely because of practical considerations, when that happens change the documentation immediately. (Never let the documentation get out of sync with the actual implementation.)
If you will be interfacing to many different services it might be better to implement one or two immediately after documenting them, to avoid getting caught in a slump, and get some more hands-on experience.


That's how I would recommend approaching the problem. I don't know of any texts you can read on it, most of this is based on my own experience. Hope it's useful.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.
Tres Burritos I think you're me from 6 months in the past. In which case I can say that all of nielsm's advice is sound.

JSON over HTTPS REST service is definitely the way to go. Write it in whatever language you're most comfortable with.

You're gonna make mistakes, test and iterate a lot to improve the design. Document the gently caress out of everything.

There's lots of great libraries out there for rolling a REST service, check a few out. I wrote a basic hello world + JSON serializer using a bunch of different ones until I found what seemed to fit best.

I read some books because I was worried I didn't know what I was doing, but they didn't really help a whole ton.

If its in-house that'll probably help, find out more about what they want the services to handle.
I'm working with a customer but they're pretty new to this too so that gives me tons of leeway, you should be able to talk to the company about their requirements and then just design to spec.

Tres Burritos
Sep 3, 2009

Good stuff.

Yeah it was described to me in vague terms but it sounds like they want an API to sort of pull all of their software together. They've got client facing stuff with RoR and in house stuff using .Net and C#.

cletus42o
Apr 11, 2003

Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.
College Slice
Ugh, I'm trying to make a SOAP request to First Data (payment processor, https://www.firstdata.com/en_us/home.html) with ColdFusion 8, and I cannot for the life of me get this HMAC signature working.

quote:

The HMAC is calculated with the SHA-1 algorithm on the following:

Request Method + \n
+ Content-type + \n
+ Content Digest (SHA-1) + \n
+ Sending Time + \n
+ Request URL

The sending time is expressed in ISO 8601 format, e.g: 2012-09-21T00:50:09Z.
I have the SHA-1 correct (they have an HMAC calculator in their login area that will auto-generate it when you fill the rest of the fields out, and it matches what I'm getting). I have the Sending Time correct (it tells you if that is wrong before anything else, you pass it separately as well). The other items I believe I have correct as they're all represented in their calculator. ("POST" for request method and "text/xml" for Content-type)

I'm using Java to generate -

code:
<cffunction name="HMAC_SHA1" returntype="binary" access="public" output="false">

	<cfargument name="signKey" type="string" required="true" /> 
	<cfargument name="signMessage" type="string" required="true" />

	<cfset var jMsg = JavaCast("string", arguments.signMessage).getBytes("UTF-8") /> 
	<cfset var jKey = JavaCast("string", arguments.signKey).getBytes("UTF-8") />

	<cfset var key = createObject("java", "javax.crypto.spec.SecretKeySpec") /> 
	<cfset var mac = createObject("java", "javax.crypto.Mac") />

	<cfset key = key.init(jKey, "HmacSHA1") />

	<cfset mac = mac.getInstance(key.getAlgorithm()) /> 
	<cfset mac.init(key) /> 
	<cfset mac.update(jMsg) />

	<cfreturn mac.doFinal() /> 

</cffunction>
But it always tells me something like:

Expected signature 'nHl+GYd9fCe4P/Me798WdUem0Dk=', received signature 'bHXNs+qIguatBsE+1SLNIUisMmg='.

Here's more of the code that puts everything together:
code:
<!--- assuming the "\n" will map to this, tried 13, 13+10, 10, and 
CreateObject("java", "java.lang.System").getProperty("line.separator") --->
<cfset nl = chr(10) /> 

<cfset gge4Date = '#DateFormat(DateAdd("s", GetTimeZoneInfo().UTCTotalOffset, Now()), 
'YYYY-MM-DD')#T#TimeFormat(DateAdd("s", GetTimeZoneInfo().UTCTotalOffset, Now()), 'HH:mm:ss')#Z' />

<cfset sha1Text = LCase(Hash(soapBody, "SHA-1", "UTF-8")) />

<cfset hmacText = 'POST#nl#text/xml#nl##sha1Text##nl##gge4Date##nl#/transaction/v12' />

<cfset hmac = HMAC_SHA1('my HMAC key', hmacText) />
If anyone has any suggestions, I'm all ears!

JawnV6
Jul 4, 2004

So hot ...
Does an iPhone video contain location data over the whole span or is it just tagged where you started? Is there a way I could correlate fine grained location data to each frame?

The Insect Court
Nov 22, 2012

by FactsAreUseless
What's the best/least bad way to use an iPad(with a decent bluetooth keyboard) as a development machine. Something like Cloud9 would be fantastic, but it doesn't seem to play well with a touch interface. There are jailbroken utilities that let you use a BT mouse, but it just emulates touches. Any decent IDE apps with at least basic stuff like syntax high-lighting and auto-indent?

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

The Insect Court posted:

What's the best/least bad way to use an iPad(with a decent bluetooth keyboard) as a development machine. Something like Cloud9 would be fantastic, but it doesn't seem to play well with a touch interface. There are jailbroken utilities that let you use a BT mouse, but it just emulates touches. Any decent IDE apps with at least basic stuff like syntax high-lighting and auto-indent?

Is this a joke? Why would you ever want to use an iPad for this?

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!
Probably a rather dumb question but I'm kind of a computer graphics idiot: is there a standard way of faking two point perspective for a 2D surface? Basically all I need is a function to approximate the mapping from points on the "flat" original plane to points on a plane of the same dimensions which is viewing the flat surface with some angle between an edge share between the planes, and a function to go in the opposite direction. I pencil and notebooked this last night and couldn't come up with any reasonable approximation, and the proper 3D solution to this problem is overkill and scares the hell out of me. Note: I don't actually want to use this to draw textures projected in this fashion because that would look terrible, I just want to be able to approximate where grid cells "should" go on the screen, and in the opposite direction approximate where mouse clicks "should" go on the underlying flat surface.

e: for example, this is what my current approximation of two point perspective would look like if you drew a 200x100 rectangle (at 0.5 fixed scaling)... not totally happy with it. It seems to be curving away from the viewer rather than projecting out at an angle.

Seashell Salesman fucked around with this message at 01:34 on Aug 4, 2013

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
What do you mean by two-point perspective? The number of points of perspective in a scene is based on the composition of the scene rather than anything to do with how it's rendered.

To give an example, when you draw a cube looking straight onto an edge, it's in two-point perspective because there are two sets of parallel lines that head to two distinct vanishing points. The rectangle you're trying to draw does not have two-point perspective.

Jabor fucked around with this message at 02:25 on Aug 4, 2013

nielsm
Jun 1, 2009



A really basic, proper 3D projection is literally just dividing two of the 3D coordinates by the last. Xproj=X3D/Z3D and Yproj=Y3D/Z3D. When all your points lie on a single plane and the camera won't be moving, you can choose an appropriate coordinate system for your viewport and be done with it, pretty much.

Here the camera would be located at (0,0,0), and if we assume the Z axis goes into the display (positive Z is in front of the viewer), and X and Y map to X and Y on the viewport, you could for instance have 2D X map to 3D X, 2D Y map to 3D Z, and have 3D Y be a constant different from zero. The 3D Y would determine the location of the plane in 3D space.

The hard part is figuring out your coordinate system system from 2D plane to 3D plane, and viewport for the projection. It should be easy enough to work out if you decide on some extreme values in each input range and how you would like those to map in the output coordinate system.

nielsm fucked around with this message at 02:52 on Aug 4, 2013

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!

Jabor posted:

What do you mean by two-point perspective? The number of points of perspective in a scene is based on the composition of the scene rather than anything to do with how it's rendered.

To give an example, when you draw a cube looking straight onto an edge, it's in two-point perspective because there are two sets of parallel lines that head to two distinct vanishing points. The rectangle you're trying to draw does not have two-point perspective.

Apologies for abuse of terminology. I did get my approximation working the way I wanted, and maybe a less crappy test image from that approximation will explain what I meant.

A texture:

Approximation of texture as if viewed from an angle:


nielsm posted:

A really basic, proper 3D projection is literally just dividing two of the 3D coordinates by the last. Xproj=X3D/Z3D and Yproj=Y3D/Z3D. When all your points lie on a single plane and the camera won't be moving, you can choose an appropriate coordinate system for your viewport and be done with it, pretty much.

Here the camera would be located at (0,0,0), and if we assume the Z axis goes into the display (positive Z is in front of the viewer), and X and Y map to X and Y on the viewport, you could for instance have 2D X map to 3D X, 2D Y map to 3D Z, and have 3D Y be a constant different from zero. The 3D Y would determine the location of the plane in 3D space.

The hard part is figuring out your coordinate system system from 2D plane to 3D plane, and viewport for the projection. It should be easy enough to work out if you decide on some extreme values in each input range and how you would like those to map in the output coordinate system.

I will try this! I got scared off by the Wikipedia page for a camera projection mostly because I haven't even thought about matrices since University.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
For reference, if you're just looking to project a texture onto a flat plane at an angle to the viewer, the Super NES had a pretty good approximation.

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!

Jabor posted:

For reference, if you're just looking to project a texture onto a flat plane at an angle to the viewer, the Super NES had a pretty good approximation.

That is basically what I want to do, and I guess it should be simple enough to do that in software using the formula from that page. I'm not actually using this to project textures, though. The example was using a texture because it shows what's going on visually (and that's how I tested the function). The app I'm working on would have flat background textures that were drawn at the 'perspective' that is intended. I want to use the approximation of projection on the underlying grid to figure out how to lay objects out on the screen so that they appear to be following the perspective of the background (think of how you would lay out the pieces on a chessboard background when the chessboard in the background texture was drawn at a 45 degree angle to the viewer). Hopefully I'm making sense!

The Insect Court
Nov 22, 2012

by FactsAreUseless

MeramJert posted:

Is this a joke? Why would you ever want to use an iPad for this?

Because I've got my ipad with me everywhere and being able to use it plus a bt keyboard cover to do at least basic programmers stuff would be a lot more than I can do now with it. I don't expect a full fledged MacBook replacement or anything, just basic competence

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

The Insect Court posted:

Because I've got my ipad with me everywhere and being able to use it plus a bt keyboard cover to do at least basic programmers stuff would be a lot more than I can do now with it. I don't expect a full fledged MacBook replacement or anything, just basic competence

Grab a terminal app (I use Prompt) and ssh in somewhere (maybe your actual computer or some $2 VPS somewhere). Use (or decide on) your text editor of choice.

Doctor w-rw-rw-
Jun 24, 2008

Tres Burritos posted:

So in a phone interview a prospective employer mentioned that they may want to start creating an API for all their in-house poo poo. Where is a good place to start learning about making an API? What languages work for APIs? REST or SOAP? Are there other big questions that need to be answered first?

nielsm posted:

Basic JSON-over-HTTPS is generally a safe bet. You can build some kind of stateful sessions on the server system if you want (making it not RESTful), don't be afraid of doing that if the existing systems are very stateful.

Zaphod42 posted:

Tres Burritos I think you're me from 6 months in the past. In which case I can say that all of nielsm's advice is sound.

JSON over HTTPS REST service is definitely the way to go. Write it in whatever language you're most comfortable with.

Tres Burritos posted:

Yeah it was described to me in vague terms but it sounds like they want an API to sort of pull all of their software together. They've got client facing stuff with RoR and in house stuff using .Net and C#.
Six months is too little time to think about this and come to a fully informed answer IMO. Enough to have a good answer, maybe, but their advice assumes HTTP is part of the answer. It isn't, not necessarily. HTTP doesn't necessarily help in many cases. It's standard *enough* that it's actually quite reasonable for APIs, but I wouldn't actually use it to glue internal systems.

JSON+REST+HTTPS is good for a public client-server API, sure. But it's not necessarily the best. For internal services, you might want to consider Thrift or something like it to build your APIs around, or even go directly and build libraries to wrap a message queue for things that might need to broadcast or claim jobs, etc. - stuff that isn't strictly oriented around point-to-point, client-to-server interactions. I would definitely be inclined to put an HTTPS REST API on something that is fully for public consumption, but whatever I did, I'd have the API "frontend" be a wrapper for internal RPCs to services that actually had to handle stuff. Otherwise, implementation details seep in far more insidiously into your server and make it way less modular.

Any time an API works a little differently to the public, it'll break, so APIs have to be either slow-moving or unstable. If you don't insulate the business logic, *that* will become slow-moving, too, or you'll have a bunch of client API breakage and fires to constantly put out.

tl;dr: Very thin API frontend (JSON, REST, etc.) <--> Thrift or some other RPC mechanism <--> API Backend (i.e. internal systems, business logic). That way, when you make your API backend into a polyglot system that uses different languages to play to their strengths, or turn it into a service-based system, or make some other important implementation decision, the frontend is insulated from those changes, so it gives you a lot of freedom. If some piece of software is the best but written in a particular language, you can use that no problem. If you need to offer a new service publicly you're already wired up to have a many-to-many API server to internal server system, or you can scale them independently depending on demand, reducing risk.

Doctor w-rw-rw- fucked around with this message at 06:36 on Aug 4, 2013

reading
Jul 27, 2013
Matlab question:



What's up with my x axis? It should go from 00:00AM to 23:59PM. Ideally in 2 hour chunks, like "...0400 0600 0800..." but when I try to get fancy with datetick and datenum, it gives me a doubled xaxis that repeats twice, with no graph displayed.

Here's my attempt at using plotyy and datetick in Matlab, which is a disaster:

code:
tempYaxis = [min(temperature)-1,max(temperature)+1];
humYaxis = [min(humidity)-1,max(humidity)+1];
xAxis = datenum('00:00'):datenum('23:59');
[AX,H1,H2] = plotyy(1:1440, humidity, 1:1440, temperature);
%[AX,H1,H2] = plotyy(xAxis, humidity, xAxis, temperature);

set(AX(2),'XTick',[],'XTickLabel',[]);  % clear other axis ticks
datetick(AX(1),'x',16,'keepticks','keeplimits') % the number here refers to the format. See help datetick.
datetick(AX(2),'x',16,'keepticks','keeplimits')
set(get(AX(1),'Ylabel'),'String','Humidity in %RH')
set(get(AX(2),'Ylabel'),'String','Temperature in *C')
%set(H1,'color','b','LineWidth','1.1')
%set(H2,'color','r','LineWidth','1.1')

% set the y axis for temperature to be slightly beyond the measured range
set(AX(2),'ylim',tempYaxis)
set(AX(1),'ylim',humYaxis)
xlabel('Time')
title('Humidity and temperature over 24 hours')

RichardA
Sep 1, 2006
.
Dinosaur Gum
Never used datetick or plotyy myself but here is some code which gives a graph with the correct axis at least.
code:
data = (0:1440).^0.5;
time = datenum(0,0,0,0,(1:length(data))-1,0);
plot(time,data)
timeStep = 60*3
set(gca, 'xtick',time(1:timeStep:end));
set(gca, 'xticklabel',datestr(time(1:timeStep:end),'HH:MM PM'));
One thing wrong in your code that I spotted; datenum is the number of days since 1/1/0 or something like that. Therefore datenum('00:00'):datenum('23:59') is ~ 735235:735235.9999.

RichardA fucked around with this message at 13:42 on Aug 5, 2013

oRenj9
Aug 3, 2004

Who loves oRenj soda?!?
College Slice
What's a good resource to learn about handing fonts? Are there any popular libraries out there that make them easy to work with? I'm planning on making a cool little font utility for my wife and I've never worked with fonts before.

bonds0097
Oct 23, 2010

I would cry but I don't think I can spare the moisture.
Pillbug

cletus42o posted:

Stuff about HMAC's

Shooting from the hip here, but recently a co-worker was having an issue with not being able to replicate a customer's HMAC's and it all came down to using Jave's built-in Base64 encoding. Apparently it was adding in new lines and wrecking the original input string. His solution was to use the Apache Commons Base64 library. Like I said, I'm shooting for the hip here and didn't study your code in depth but hopefully that is helpful.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

oRenj9 posted:

What's a good resource to learn about handing fonts? Are there any popular libraries out there that make them easy to work with? I'm planning on making a cool little font utility for my wife and I've never worked with fonts before.
This is really hard to deal with in a cross-platform way, since each one handles fonts differently and some (Linux) handle fonts in multiple disparate ways. Are you talking about Windows?

oRenj9
Aug 3, 2004

Who loves oRenj soda?!?
College Slice

Misogynist posted:

This is really hard to deal with in a cross-platform way, since each one handles fonts differently and some (Linux) handle fonts in multiple disparate ways. Are you talking about Windows?

OSX. I'm trying to do two things, the first is to build a simple application that she can use to preview some text in every font she has. Right now she prints out all of her fonts and keeps them in a huge binder. She'd rather have her "font binder" be a program instead. I could never find a program similar to character map in OSX, so I'll probably add that functionality as well.

The second thing I'm trying to do is automatically categorize fonts as similar based on characteristics.

it is
Aug 19, 2011

by Smythe
There's no way that doesn't exist already. It's already built in to the font selector in Word; all they'd have to do is port the work they already did to a smaller program

Edit: two seconds on google
https://itunes.apple.com/us/app/font-picker/id507086472

it is fucked around with this message at 05:01 on Aug 6, 2013

oRenj9
Aug 3, 2004

Who loves oRenj soda?!?
College Slice
Good find. We planned on monetizing this app eventually, so it is good to see that there is a market for this.

floWenoL
Oct 23, 2002

it is posted:

There's no way that doesn't exist already. It's already built in to the font selector in Word; all they'd have to do is port the work they already did to a smaller program

Edit: two seconds on google
https://itunes.apple.com/us/app/font-picker/id507086472

There's already a "Font Book" app built into OS X. Does that app add anything more?

Rottbott
Jul 27, 2006
DMC
To answer the original question, FreeType is good and portable. I use it in my game engine.

nielsm
Jun 1, 2009



Rottbott posted:

To answer the original question, FreeType is good and portable. I use it in my game engine.

Only it doesn't solve your problem if you have text in any even slightly complex script. (Don't roll your own text layout code, you will do it wrong no doubt. Freetype won't layout your text for you.)

Adbot
ADBOT LOVES YOU

Rottbott
Jul 27, 2006
DMC
He said fonts, not text formatting, but that's true. I have rolled my own text layout code; it's an absolute nightmare. Shame FT Layout doesn't seem to have gone anywhere, anyone know of any libraries for doing it?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply