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
Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
As a general rule if you aren't willing to invest the time to create a very rough prototype of your application, you probably won't be willing to invest the time to create a rigorous enough specification to be considering outsourcing either.

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...

MJP posted:

I'm not really a coder/developer. It'd be easier for me to just do what I do manually without the app given the time investment it'd run me.

Take a look at AutoHotKey? http://www.autohotkey.com/

It's an automation tool that lets you record actions and replay them. Can your idea be mocked up with that? If it can't (e.g. dependence on server holding information or something) you're looking at a much bigger problem.

Ideas are generally worthless. If you'd like this tool and it's small enough, I thought there was a short/small app request thread bouncing around. If all you have is the idea, and you're not bringing any domain knowledge to the table, you're not going to make free money off someone else's expertise.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

MJP posted:

I'm not really a coder/developer. It'd be easier for me to just do what I do manually without the app given the time investment it'd run me.

The question is not "is it easier to do it manually". A ton of things I've coded were much easier to do manually... once. The question is either "will it be faster the 10,000th time I have to do it" or, more importantly, "are there 10,000 other people doing this manually". Answering the former with a yes is enough to learn to code so you can hack something together that works just good enough to save yourself time in the long run. Answer the latter with a yes, and you have a viable product idea. In which case you should hack something together just good enough to show the benefit to potential investors.

aerique
Jul 16, 2008

MJP posted:

So I guess part of the original question remains - is there anything other than Unity that can be used to develop applications across platforms without much difficulty? Or should I be looking for a Windows app dev, iOS app dev, and Android app dev? Or should I be looking for a specific language/languages that can be easily compiled and done for the major platforms?

Besides what has been mentioned so far there's Haxe which targets all the platforms you've mentioned so far.

Also if you can do PowerPoint you can probably whip up a prototype yourself.

feedmegin
Jul 30, 2008

MJP posted:

So I guess part of the original question remains - is there anything other than Unity that can be used to develop applications across platforms without much difficulty? Or should I be looking for a Windows app dev, iOS app dev, and Android app dev? Or should I be looking for a specific language/languages that can be easily compiled and done for the major platforms?

Assuming you're ok with C++, you might want to investigate Qt, which has recently added Android and iOS support, has supported Linux, Windows and Mac forever, and for extra bonus points even works on a Blackberry. (it's a C++ cross-platform GUI framework with support for a whole bunch of other stuff like networking and threads and whatnot). Though Android and iOS apps would end up larger than 'native' since they'd need the relevant libraries as part of the app/downloaded on the fly at install time.

Edit: OK, this is more useful advice for actual developers, not 'some guy with an idea'. Still, Qt's awesome. :colbert:

feedmegin fucked around with this message at 20:36 on Apr 7, 2014

Eggnogium
Jun 1, 2010

Never give an inch! Hnnnghhhhhh!
Anyone have any online tutorial or book suggestions for learning XSLT version 1? Can assume a basic knowledge of XML and XPath. I've tried going through the W3School and Zvon tutorials but they're pretty sparse and horrendous at explaining things conceptually. The specific scenario I'm trying to get to is turning a list of simple elements like this:

code:
<foo name="name1" lowerLimit="2" upperLimit="13" />
<foo name="name2" lowerLimit="5" upperLimit="8" />
...
into a list of these monster elements:

code:
<dongle>
  <name>name1</name>
  <lowerLimit>2</lowerLimit>
  <upperLimit>13</upperLimit>
  <Property field="property1">SomeConstantString1</Property>
  <Property field="property2">SomeConstantString2</Property>
  ... Many more Properties
</dongle>
<dongle>
  <name>name2</name>
  <lowerLimit>5</lowerLimit>
  <upperLimit>8</upperLimit>
  <Property field="property1">SomeConstantString1</Property>
  <Property field="property2">SomeConstantString2</Property>
  ... Many more Properties
</dongle>
But I've never really worked in a declarative language before and am having a beast of a time extending examples outside of their specific scope.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Internet Janitor posted:

As a general rule if you aren't willing to invest the time to create a very rough prototype of your application, you probably won't be willing to invest the time to create a rigorous enough specification to be considering outsourcing either.

Yeah, this is important. In trying to create the idea you will be more accurately defining the problem space so that when new people come onto the team they have a clear idea of what the vision is and the obstacles that need to be overcome. fwiw I'm working on a project that I originally built over the course of 2 years while being primary carer for my son. Its not great, and the design is poo poo, but I'm in testing on a ship (single customers usually have 10-15 end users so its not unreasonable testing) and as a result of my effort I now have a designer forming a company with me.

If you put in the effort and put yourself out there, people will be willing to believe in you, and that's entirely what you're asking for whenever you say 'equity', belief that its got legs.

Another side note, we've been working with a Business development/product strategy person over the last couple of months and while their input is valuable for steering the product, its not ℅33.3 valuable. The lions share of the equity, if you're talking dollars and time invested, will be reflected in production of the product, as any specialist will be worth what they could've been paid. That's where you put yourself if you want to be the ideas guy, low value work or cash source.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
"Just learn to program and make a demo, programming isn't so hard that it's a specialized field that pays six figures and up to people good at it, so spending two weeks to 'learn to program' is no big deal :v:"

Something to note is that your idea may not be feasible, or it might be very hard to do. You might want to talk to an actual developer and see if the idea is even worth pursuing before trying to bankroll it.
A friend of mine me put in touch with a friend of hers who had a Great Idea, but didn't have the domain specific knowledge to do it. So, what happened was he gave me an NDA, then hired me for an hour to investigate his idea and see if it was feasible (it was not, at least with the technology at that time). If it was feasible, he would hire someone to do it for him. I gave him the lowdown on why it wasn't feasible, when to pursue it in the future, and about how difficult it might be then, along with some things to try if he wanted to do it anyway.

If you want, send me a PM, and I'll give you a brief idea of how feasible and how difficult your idea might be, especially since you're thinking of mobile. If it's trivial, you might be able to hire someone to do it for a few thousand bucks.

Volmarias fucked around with this message at 00:10 on Apr 8, 2014

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Volmarias posted:

"Just learn to program and make a demo, programming isn't so hard that it's a specialized field that pays six figures and up to people good at it, so spending two weeks to 'learn to program' is no big deal :v:"

Instead of beating up your straw man, consider the idiocy of a salary's order of magnitude having anything to do with the difficulty involved in wetting one's feet.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

pokeyman posted:

Instead of beating up your straw man, consider the idiocy of a salary's order of magnitude having anything to do with the difficulty involved in wetting one's feet.

My point is that saying "just learn to program enough to make a demo in two weeks" isn't really realistic advice for most people. I totally agree that if he wants anything to happen he needs more than idea.

Volmarias fucked around with this message at 12:20 on Apr 8, 2014

Secx
Mar 1, 2003


Hippopotamus retardus
XML/XSLT question from someone who has zero experience on the topic. Everything below is what I could find with google.

I have an XSLT sheet that removes accents from all <city> nodes in an XML file.

code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output indent="yes" />
	  
	<xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

	  
	 <xsl:template match=".//city">
      <xsl:copy>
        <xsl:value-of select="translate(., 'éàôûîçÉÀÔÎÛÇ', 'eaouicEAOIUC')"/>
      </xsl:copy>
    </xsl:template>

</xsl:stylesheet>
I'm trying to make it work on any node and not just city nodes. How do I write the match criteria so that it matches any node instead of just city? Because of the identity transform I have in the beginning, Saxon is giving me an error message if I put match="node()"

the
Jul 18, 2004

by Cowcaster
Trying to find a good crash course tutorial on SAS programming. A job I'm applying to requires "exposure" at a very minimal level to the language. Suggestions?

Amberskin
Dec 22, 2013

We come in peace! Legit!

the posted:

Trying to find a good crash course tutorial on SAS programming. A job I'm applying to requires "exposure" at a very minimal level to the language. Suggestions?

The online docs are quite good and have some step-by-step programming examples.

http://support.sas.com/onlinedoc/913/docMainpage.jsp

Go to the "Base SAS" / "Step-by-Step programming with base SAS" and you will probably be running in a short time.

E: If you have experience with procedural languages it is really easy to "get it".

Vulture Culture
Jul 14, 2003

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

the posted:

Trying to find a good crash course tutorial on SAS programming. A job I'm applying to requires "exposure" at a very minimal level to the language. Suggestions?
Additionally, if you have any experience with other statistical programming languages like SPlus or R, those carry over pretty easily (though I'd still recommend familiarity with the SPlus language, of course). R happens to be free:

http://www.r-project.org

Amberskin
Dec 22, 2013

We come in peace! Legit!

Misogynist posted:

Additionally, if you have any experience with other statistical programming languages like SPlus or R, those carry over pretty easily (though I'd still recommend familiarity with the SPlus language, of course). R happens to be free:

http://www.r-project.org

I beg to disagree. SAS is closer to the traditional procedural languages (its syntax is very similar to PL/I) than to SPSS or R. The concepts, of course, are the same, but the way to achieve the results you want is quite different.

raminasi
Jan 25, 2005

a last drink with no ice
There's a SAS/R/MATLAB/whatever thread that gets missed a lot because it's not in CoC.

aerique
Jul 16, 2008
What's with all the XSLT questions suddenly? I've been trying to repress that my previous job was a big part XSLT.

Eggnogium posted:

Anyone have any online tutorial or book suggestions for learning XSLT version 1?

I think my main reference used to be the W3 site: http://www.w3.org/TR/xslt

Some former colleagues had one or two recommended books but I never used them:

To be honest, I'm not sure these are the books. I'm more of a googler than a book user and it's been two years since I worked with XSLT.

Eggnogium posted:

The specific scenario I'm trying to get to is turning a list of simple elements like this:

code:
<foo name="name1" lowerLimit="2" upperLimit="13" />
<foo name="name2" lowerLimit="5" upperLimit="8" />
...
into a list of these monster elements:

code:
<dongle>
  <name>name1</name>
  <lowerLimit>2</lowerLimit>
  <upperLimit>13</upperLimit>
  <Property field="property1">SomeConstantString1</Property>
  <Property field="property2">SomeConstantString2</Property>
  ... Many more Properties
</dongle>
<dongle>
  <name>name2</name>
  <lowerLimit>5</lowerLimit>
  <upperLimit>8</upperLimit>
  <Property field="property1">SomeConstantString1</Property>
  <Property field="property2">SomeConstantString2</Property>
  ... Many more Properties
</dongle>

Here's one solution, but there are many ways to solve this in XSLT.

code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <root>
      <xsl:apply-templates/>
    </root>
  </xsl:template>

  <xsl:template match="foo">
    <dongle>
      <!-- select just foo's attributes and no sub-elements -->
      <xsl:apply-templates select="@*"/>
    </dongle>
  </xsl:template>

  <xsl:template match="@name">
    <name>
      <xsl:apply-templates/>
    </name>
  </xsl:template>

  <xsl:template match="@lowerLimit">
    <lowerLimit>
      <xsl:apply-templates/>
    </lowerLimit>
  </xsl:template>

  <xsl:template match="@upperLimit">
    <upperLimit>
      <xsl:apply-templates/>
    </upperLimit>
  </xsl:template>

</xsl:stylesheet>
I've only tested it with "xsltproc" and if you need pretty-printed output run it through "xmllint --format".

Secx posted:

XML/XSLT question from someone who has zero experience on the topic. Everything below is what I could find with google.

I have an XSLT sheet that removes accents from all <city> nodes in an XML file.

code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output indent="yes" />
	  
	<xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

	  
	 <xsl:template match=".//city">
      <xsl:copy>
        <xsl:value-of select="translate(., 'éàôûîçÉÀÔÎÛÇ', 'eaouicEAOIUC')"/>
      </xsl:copy>
    </xsl:template>

</xsl:stylesheet>
I'm trying to make it work on any node and not just city nodes. How do I write the match criteria so that it matches any node instead of just city? Because of the identity transform I have in the beginning, Saxon is giving me an error message if I put match="node()"

Mayb I'm not understanding something but remove "node()" from the identity transform if you want to do something else with every node? Also check the priority attribute: http://www.w3.org/TR/xslt#conflict

aerique fucked around with this message at 10:28 on Apr 9, 2014

Shaocaholica
Oct 29, 2002

Fig. 5E
Bah I can't figure out what I'm doing wrong. Trying to get ffmpeg to output a log file with a specific name. It defaults to a generic name based on time which is next to useless when you're encoding a million different files in the same place and need the log files to line up with the output files.

code:
[~/ffmpeg_test] 273% which $SHELL
/usr/local/bin/tcsh
[~/ffmpeg_test] 274% ll
total 11M
-rwxr--r-- 1 szhang user 11M Apr 12 22:56 test.tif
[~/ffmpeg_test] 275% set FFREPORT=file=test.mp4.log
[~/ffmpeg_test] 276% ffmpeg -f image2 -r 24.0 -i test.tif -c:v libx264 -pix_fmt yuv420p test.mp4

...a bunch of non relevant output...

[~/ffmpeg_test] 277% ll
total 11M
-rw-rw-r-- 1 szhang user 9.2K Apr 12 22:57 test.mp4
-rwxr--r-- 1 szhang user  11M Apr 12 22:56 test.tif
According to the docs, I should have gotten a log file named 'test.mp4.log'

https://www.ffmpeg.org/ffmpeg.html

quote:

‘-report’
Dump full command line and console output to a file named program-YYYYMMDD-HHMMSS.log in the current directory. This file can be useful for bug reports. It also implies -loglevel verbose.

Setting the environment variable FFREPORT to any value has the same effect. If the value is a ’:’-separated key=value sequence, these options will affect the report; options values must be escaped if they contain special characters or the options delimiter ’:’ (see the “Quoting and escaping” section in the ffmpeg-utils manual). The following option is recognized:

‘file’
set the file name to use for the report; %p is expanded to the name of the program, %t is expanded to a timestamp, %% is expanded to a plain %

Errors in parsing the environment variable are not fatal, and will not appear in the report.

Shaocaholica fucked around with this message at 07:01 on Apr 13, 2014

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING
I'm struggling a bit with regex/nginx. I need to take all requests for */{name}_cache{digits}.js and remove the _cache{digits} and serve the actual file (while telling the browser it's still the cache-busting uri). This is to circumvent lovely caching in browsers that is loving with my javascript libraries.

So a request for:

https://www.domain.com/assets/whatever/js/blah_cache33223587.js
would serve the following real file under that uri:
https://www.domain.com/assets/whatever/js/blah.js

I have:

code:
location ~ (.+?)\/(\w+?)_cache\d+?\.js$ {
    alias $1/$2.js;
    add_header Vary Accept-Encoding;
  }
But it's not actually working. nginx restarts fine and I can access the pages but the file isn't loading when it's linked under the pattern /{name}_cache{randomnumbers}.js.

I think what's happening is that the first regex pattern is just getting the whole URI and so it's loving it up. I want to grab the first section with an exclusion, so it'll stop saving into the variable once it sees:

code:
\/(\w+?)_cache\d+?\.js$
Optimally I'd be able to, as I've written the alias above, grab two values: the location of the requested file, and then the filename itself minus the _cache(\d+?).

I'm trying various combos but I can't figure out a way to get it working. I'm currently working along this tack:

code:
(.+?!\w+?_cache$)\/(\w+?)_cache\d+\.js$
But no success. I'm hoping someone who isn't as poo poo at regex as I am could help me a bit :)

For reference, the incoming uri that it fails on, taken from the error log (with personal data modified):

code:
/home/username/http/hosts/domain.com/js/libraryname/show_cache139738399344.js
e:

Okay this is working in the regex test:
code:
^(.*[\\\/])(\w+?)_cache\d+\.js$
Note I also removed the / in the alias line because the regex takes the trailing slash as well.

code:
location ~ ^(.*[\\\/])(\w+?)_cache\d+\.js$ {
    alias $1$2.js;
    add_header Vary Accept-Encoding;
  }
But it's still failing in nginx with this error:

quote:

2014/04/13 12:37:33 [error] 16189#0: *1 open() "/home/username/http/hosts/domain.com/js/library/show_cache139738545239.js" failed (2: No such file or directory), client:[[my ip]], server: https://www.domain.com request: "GET /js/library/show_cache139738545239.js HTTP/1.1", host: "www.domain.com", referrer: "http://www.domain.com/site"

e2: Okay, looks like I just needed a rewrite. Oops.

This works:

code:
rewrite ^(.*[\\\/])(\w+)_cache\d+\.js$ $1$2.js;
But it hasn't entirely resolved the issue with my javascript caching because I'm using require.js, so, uh.. gently caress.

Sulla Faex fucked around with this message at 11:49 on Apr 13, 2014

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

You probably want the lookahead operator (?=)

As an aside, putting an evening or two into Mastering Regular Expressions is well worth it. If you can't spare the time needed to cover the whole book, just skimming the first 140 pages will serve you well.

coffeetable fucked around with this message at 11:53 on Apr 13, 2014

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING

coffeetable posted:

You probably want the lookahead operator (?=)

As an aside, putting an evening or two into Mastering Regular Expressions is well worth it. If you can't spare the time needed to cover the whole book, just skimming the first 140 pages will serve you well.

Thanks. I got it working the other way but there was an issue with filenames with extra periods to denote version, so this is working now using the lookahead:

code:
rewrite ^(.*[\\\/])(.+(?=_cache))_cache\d+\.js$ $1$2.js;
It's still not working to fix my drat problem but at least it's not caching anymore. That book is on my to-do list but it's unfortunately still a little ways down.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Is there a reason your urls can't just use a meaningless query argument as a cache-buster? It would have to be a really hosed-up browser that would use, for example, a result it's cached from youtube.com/watch?v=123456 when it's asked to look up youtube.com/watch?v=456789.

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING

Jabor posted:

Is there a reason your urls can't just use a meaningless query argument as a cache-buster? It would have to be a really hosed-up browser that would use, for example, a result it's cached from youtube.com/watch?v=123456 when it's asked to look up youtube.com/watch?v=456789.

Yeah I tried that but there were some articles around that said it's not guaranteed for every browser so I wanted to make sure it 100% couldn't be caching the files in some way. It looks like my problem lies somewhere else though.

nielsm
Jun 1, 2009



Sulla-Marius 88 posted:

Yeah I tried that but there were some articles around that said it's not guaranteed for every browser so I wanted to make sure it 100% couldn't be caching the files in some way. It looks like my problem lies somewhere else though.

Tried sending cache-refusal headers?
Or just physically renaming the file every time it changes? (I know for one that qwebirc uses that method to ensure its CSS and JS gets cache-busted.)

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING

nielsm posted:

Tried sending cache-refusal headers?
Or just physically renaming the file every time it changes? (I know for one that qwebirc uses that method to ensure its CSS and JS gets cache-busted.)

Yeah, tried those. My current suspicion is that the problem might lie with my wireless internet trying to aggressively cache stuff to reduce bandwidth costs, which, if true, is out of my reach to fix.

However I found the source of my problem with javascript and it seems to be a problem with knockout itself, or at least with my implementation of knockout's containerless functions and requirejs, so the problem that caused me to look into caching issues is now resolved. So the caching issues will just be a fun little annoyance as I keep working on things.

That rewrite rule did actually work though, in terms of the caching. I just removed it once I realised it wasn't the source of my JS problem, and I can't be bothered to go back and reinstall it right now.

Shaocaholica
Oct 29, 2002

Fig. 5E

Shaocaholica posted:

Bah I can't figure out what I'm doing wrong. Trying to get ffmpeg to output a log file with a specific name. It defaults to a generic name based on time which is next to useless when you're encoding a million different files in the same place and need the log files to line up with the output files.

code:
[~/ffmpeg_test] 273% which $SHELL
/usr/local/bin/tcsh
[~/ffmpeg_test] 274% ll
total 11M
-rwxr--r-- 1 szhang user 11M Apr 12 22:56 test.tif
[~/ffmpeg_test] 275% set FFREPORT=file=test.mp4.log
[~/ffmpeg_test] 276% ffmpeg -f image2 -r 24.0 -i test.tif -c:v libx264 -pix_fmt yuv420p test.mp4

...a bunch of non relevant output...

[~/ffmpeg_test] 277% ll
total 11M
-rw-rw-r-- 1 szhang user 9.2K Apr 12 22:57 test.mp4
-rwxr--r-- 1 szhang user  11M Apr 12 22:56 test.tif
According to the docs, I should have gotten a log file named 'test.mp4.log'

https://www.ffmpeg.org/ffmpeg.html

Found my problem sort of. It worked in bash just not tcsh which is the default at work. Sigh. Something to do with the way env variables are set.

Pollyanna
Mar 5, 2005

Milk's on them.


edit ignore me im an idiot

Pollyanna fucked around with this message at 00:58 on Apr 14, 2014

feedmegin
Jul 30, 2008

Shaocaholica posted:

Found my problem sort of. It worked in bash just not tcsh which is the default at work. Sigh. Something to do with the way env variables are set.

tcsh is crazy bananas with totally different syntax to Bourne-shell derivatives. If bash is available I'd advise using it instead. (What're you on, an old Solaris box or something?)

nielsm
Jun 1, 2009



feedmegin posted:

tcsh is crazy bananas with totally different syntax to Bourne-shell derivatives. If bash is available I'd advise using it instead. (What're you on, an old Solaris box or something?)

I think /bin/sh is meant to always be Bourne-compatible, so if you're writing scripts that need to run on weird machines, try to use that.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

nielsm posted:

I think /bin/sh is meant to always be Bourne-compatible, so if you're writing scripts that need to run on weird machines, try to use that.

No, /bin/sh is sh-compatible. You can't use bashisms and expect it to be portable.

Use /bin/bash if you really need the bourne shell for some reason.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Jabor posted:

No, /bin/sh is sh-compatible. You can't use bashisms and expect it to be portable.

Use /bin/bash if you really need the bourne shell for some reason.

"sh" is the Bourne shell. Bash is Bourne shell plus a lot of extras. /bin/sh should always be a Bourne-compatible shell, such as bash or dash or busybox's shell or original sh.

Boz0r
Sep 7, 2006
The Rocketship in action.
Any recommendations for a book on probability theory in computer science? I'm taking a course on randomized algorithms and the material is a bit lacking.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Boz0r posted:

Any recommendations for a book on probability theory in computer science? I'm taking a course on randomized algorithms and the material is a bit lacking.

Have you had a probability course already?

Dren
Jan 5, 2001

Pillbug
Anyone know anything about gvpr for graphviz? It's supposed to be like awk for graphviz.

I was trying to use gvpr to turn edges off in my graph by setting their style to invis but it totally jacks up my graph structure by adding a bunch of extra node declarations and crap. Is this normal?

I am doing this in gvpr:
code:
E[head.name!="A" && tail.name!="A"] { style="invis" }
An example of how it jacks up my graph is that I've got some edges defined at the top of my graph for the purpose of providing vertical structure:
code:
	// these invisible nodes provide vertical structure to the graph
	{
		node [ style="invis" ];
		edge [ style="invis" ];
		0->1->2->3->4->5;
	}
after gvpr:
code:
	{
		node [style=invis];
		edge [style=invis];
		0		 [style=invis];
		1		 [style=invis];
		0 -> 1		 [style=invis];
		2		 [style=invis];
		1 -> 2		 [style=invis];
		3		 [style=invis];
		2 -> 3		 [style=invis];
		4		 [style=invis];
		3 -> 4		 [style=invis];
		5		 [style=invis];
		4 -> 5		 [style=invis];
	}
I cooked something up in python with pydot that is more flexible and works better than gvpr seems capable of but I didn't want to introduce the dependencies if I could get things done with gvpr.

The pydot stuff does this to my initial declaration, which is fine:
code:
{
node [style="invis"];
edge [style="invis"];
0 -> 1  [style=invis];
1 -> 2  [style=invis];
2 -> 3  [style=invis];
3 -> 4  [style=invis];
4 -> 5  [style=invis];
}

TwoDogs1Cup
May 28, 2008

DOUGIE DOUGIE DOUGIE! MY LOVE, HE MAKES MY EMPTY HEART FULL! DOUGIE! THE BEST FOREVER THE BEST DOUGIEEE! <3 <3 - TwoDougies1Cup
What's the best way to make gifs play when clicked using Wordpress? Right now when they're clicked they open in a new window. Don't want them to play automatically as there's a few on the page

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

TwoDogs1Cup posted:

What's the best way to make gifs play when clicked using Wordpress? Right now when they're clicked they open in a new window. Don't want them to play automatically as there's a few on the page

http://stackoverflow.com/questions/20916166/how-to-play-a-gif-on-click-like-9gag-com-with-wordpress

Tacos Al Pastor
Jun 20, 2003

Python related question (I'm using Python 3). Why does the following set the items out of order?

master_set = set(input("Enter your string: ").split())#Get input
print(master_set)

I enter the string: This is a string and get the following as output:

Enter your string: this is a string
{'this', 'a', 'is', 'string'}

It should be: {'this', 'is', 'a', 'string'} right? Why is it out of order?

:confused:

edit: removing set() from the input line above fixed it. But Im still a bit confused why.

Tacos Al Pastor fucked around with this message at 23:53 on Apr 16, 2014

SurgicalOntologist
Jun 17, 2004

Sets have no order. If you want order, use a list. If you want order and no duplicates, use the keys of an OrderedDict:
http://stackoverflow.com/questions/9792664/python-set-changes-element-order

Tacos Al Pastor
Jun 20, 2003

SurgicalOntologist posted:

Sets have no order. If you want order, use a list. If you want order and no duplicates, use the keys of an OrderedDict:
http://stackoverflow.com/questions/9792664/python-set-changes-element-order

For this particular problem, Im to read input into a set but this definitely helps as I have to take that input and add it to a dict later and keep track of the number of times the word appears using the key for that dict.

Thanks

Adbot
ADBOT LOVES YOU

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
:spergin:Technically:spergin: python sets and dictionaries have some kind of order but you should never rely on them and treat them as unordered.

I'm just saying this if the idea of unordered computer data doesn't sit well with you.

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