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
TheEffect
Aug 12, 2013
I have a batch file that asks the user for three separate pieces of information. I want to make a GUI out of this for ease-of-use but I'm not sure where to begin. I have a Windows Form with three separate boxes of text and a submit button.

Is this even feasible? I've seen plenty of results for passing batch arguments to VB.Net but none regarding the other way around.

Clarification:

My batch file prompts the user for three separate pieces of information, one at a time. I actually want to make it so that these pieces of information come from three separate input boxes in a Windows Form and then have that information get passed to the batch file in order for it to actually do it's thing. The batch file asks the user their name, the department they are shadowing, and their ID number and then places that information into the appropriate folder which is named with the person's ID and the date. I have everything figured out in the batch file and it works perfectly, I just need to integrate it in Windows Forms.

TheEffect fucked around with this message at 22:53 on Oct 13, 2014

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Modify your batch file to take those values as command-line parameters - then it will be straightforward to simply invoke it with those arguments from your program.

I like turtles
Aug 6, 2009

I'm on a team looking at building an android application, and I'm hoping to get suggestions on an optimal technology stack.

There will be a centralized server application living somewhere like AWS. Users in the field will submit short reports to the server, which will be aggregated and shown to other users of the app - info like Geotag, notes, etc, simple stuff.

We have a current sever application written by some students in flask/mysql that is not ready for a production environment in terms of security, scalability, etc, so we're willing to rewrite completely if needed.

We need to have an application that properly deals with user management, ideally encrypts the data to be sent, and has a robust offline mode for use in limited data connectivity situations. We generally need a system with more security in mind.

I'm a python developer, as my primary language, so if we're able to reasonably stick with flask as a web framework for the server side application that's fine, but I'm not married to it.

I'm initially thinking about changing the server side to use a mongo backend, since we're already just passing json back and forth, bolting on https and flask-security, and letting the app itself worry about dealing with the offline mode, but I'm open to suggestions. Thoughts?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

I like turtles posted:

I'm on a team looking at building an android application, and I'm hoping to get suggestions on an optimal technology stack.

There will be a centralized server application living somewhere like AWS. Users in the field will submit short reports to the server, which will be aggregated and shown to other users of the app - info like Geotag, notes, etc, simple stuff.

We have a current sever application written by some students in flask/mysql that is not ready for a production environment in terms of security, scalability, etc, so we're willing to rewrite completely if needed.

We need to have an application that properly deals with user management, ideally encrypts the data to be sent, and has a robust offline mode for use in limited data connectivity situations. We generally need a system with more security in mind.

I'm a python developer, as my primary language, so if we're able to reasonably stick with flask as a web framework for the server side application that's fine, but I'm not married to it.

I'm initially thinking about changing the server side to use a mongo backend, since we're already just passing json back and forth, bolting on https and flask-security, and letting the app itself worry about dealing with the offline mode, but I'm open to suggestions. Thoughts?

Why not just make sure your data is in 3nf? I doubt that MySQL is your bottleneck, and it isn't clear why mongo would be better.

I like turtles
Aug 6, 2009

leper khan posted:

Why not just make sure your data is in 3nf? I doubt that MySQL is your bottleneck, and it isn't clear why mongo would be better.

Personal preference mostly, I've had more mysql headaches than mongo headaches. Flask-security also mentions a tie in with a flask-mongo extension, and getting out of the box integration is appealing. The student code is pretty much going to require a full rewrite to meet the more secure and offline set of requirements, so I'm not tied to any currently implemented stuff.

Boz0r
Sep 7, 2006
The Rocketship in action.
I don't know if this is a pure math question, but how do I use linear programming to find a convex hull? I get that all the edges of the hull are like half-space constraints of the linear program, but those are the ones we're trying to find.

Pizzatime
Apr 1, 2011

I have this simple html table and was wondering if I could somehow parse of bunch of text into the table to be made into paragraphs. Also I was wondering how hard it would be to have a function within the html that makes it possible to just click a button and make a new entry like that. Basically I have this table I'm always updating and it's real tiresome having to do this
code:
<tr>
<td class="calign">5</td>
<td>Starcraft II: Heart of the Swarm</td>
<td>PC</td>
<th>Blizzard</th>
<td>2013</td>
<td>Digital</td>
<td>Starcraft</td>
<td>Online</td>
<td>-</td>
</tr>
each time I'm doing a new entry. Maybe there's some kind of big tutorial on tables including how to go about adding new entries in a convenient fashion someone could point me to? tia

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Writing all the <td>s out manually is difficult. You can write a little Python script or something to generate the <td>s for you and then you can copy/paste that into your HTML file. You can also write a little JavaScript script inside the page to generate it inside the browser, but then Google won't be able to see it.

What languages are you familiar with?

sarehu
Apr 20, 2007

(call/cc call/cc)

Boz0r posted:

I don't know if this is a pure math question, but how do I use linear programming to find a convex hull? I get that all the edges of the hull are like half-space constraints of the linear program, but those are the ones we're trying to find.

Any best outcome given by linear programming is going to be on the convex hull. So tweak the cost/profit function's gradient until you've got all the elements on the convex hull.

I like turtles
Aug 6, 2009

It really all depends how you've got the text and how you want it to look. Regexes are probably your friend here.
If you've already got your desired data in a format like:
code:
My stuff
is cool
alright
neato
All you'd need to do is use a regex compatible text editor like sublime text.
Search for
code:
(.*)
Replace with
code:
<td>\1</td>
Which would yield you
code:
<td>My stuff</td>
<td>is cool</td>
<td>alright</td>
<td>neato</td>
Then just manually add in the <tr> and the "class="calign"" bits and you're good to go.

Honestly if you're using sublime text it'd be just as easy to select the text you want to work on, click the "selection" menu and hit "split into lines". You're able to edit text on multiple lines simultaneously then.

Pizzatime
Apr 1, 2011

Thanks for all the suggestions! I've found my wet dream of tables, it's sortable, editable and loads it's content from a seperate file, but I have no idea how to use it :(

http://www.editablegrid.net/en

TheEffect
Aug 12, 2013

Jabor posted:

Modify your batch file to take those values as command-line parameters - then it will be straightforward to simply invoke it with those arguments from your program.

Edit- Issue was with my batch file.

Thank you for your guidance!

TheEffect fucked around with this message at 02:12 on Oct 16, 2014

JawKnee
Mar 24, 2007





You'll take the ride to leave this town along that yellow line

Jo posted:

Basically, if you want to map to n colors (which you can get from m-bits), you create n centroids/parent nodes. You go through the whole images and, for each pixel, assign its parent to the color which is 'closest'. Closest in this case means, 'has the smallest color distance as determined by colorDist = Math.sqrt(dr*dr + dg*dg + db*db) with dr = the different in the red channel'. Then, after you've done that for each pixel, you move the centroids to the 'center of the color space', that is, average the color of the children and assign that value to the parent. Then you repeat the process until you're satisfied.

Thank you, this (and the code you posted) was very helpful

KoRMaK
Jul 31, 2012



I just learned a useful thing in eclipse. I have a Ruby on Rails app and eclipse as aptana installed. I started a new project and my team menu, which gives me a git interface, was all different. Turns out that the "Disconnect" option doesn't disconnect you from git remotes, it disconnects the git interpreter for the project. So I clicked that, then went back to the team menu where there were only two options, one being "share project", I clicked that, then it gives me 3 options to use for a git interpreter and I selected the Aptana stuido one. Now everything looks like how I'm used to!

Disconnect and Share are weird phrases to use for those menu options.

tl;dr Woooooooo, I got eclipse to look how I am used to in a new project.

Crunk Magnet
Feb 19, 2004
Poop Soup
I haven't had to do any data modeling in a very long time, and when I did it was a simple UML diagram. I just created my first UML activity diagram in Visio 2013 and I would appreciate it if someone would at least give me an idea if I am using Visio to do this the right way. Programming this would be infinitely easier for me.

The UML Activity Diagram needs to model the following:

    Support the basic functions of addition, subtraction, and multiplication
    Support the basic functions of changing the sign of the number (the +/- key)

http://www.filedropper.com/umlactivitydiagram

Thank you in advance!

TheEffect
Aug 12, 2013
Is there a way in Windows Forms to make it so the pre-populated text in an input box is greyed out and when a user clicks the box the text goes away? Similar to a input boxes on a lot of websites, i.e. "Search..." and when the user clicks the text goes away.

TheEffect fucked around with this message at 16:42 on Oct 17, 2014

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.

TheEffect posted:

Is there a way in Windows Forms to make it so the pre-populated text in an input box is greyed out and when a user clicks the box the text goes away? Similar to a input boxes on a lot of websites, i.e. "Search..." and when the user clicks the text goes away.

What language are you working in? TextBoxes don't have placeholder functionality baked in, but you're likely to find an extension of the TextBox class that does in whatever language you look for.

TheEffect
Aug 12, 2013

Newf posted:

What language are you working in? TextBoxes don't have placeholder functionality baked in, but you're likely to find an extension of the TextBox class that does in whatever language you look for.

The default language for Windows Forms that Visual Studio uses, I believe VB.Net. sorry, I'm kind of new to Windows Forms.

TheEffect fucked around with this message at 17:05 on Oct 17, 2014

I am not a book
Mar 9, 2013
Ok I know this is really dumb, but my coding knowledge is mostly self-taught:
Is there a name for the style of programming where the program starts, get some input from the user, and then call out to functions that do whatever it is that I need doing? More like scripting than anything else.
I tend to do stuff like that as rebellion against the super-object-oriented way that I was taught in my CS minor. Each program was an object and I really hated it because it doesn't seem to make any sense to me.

JawKnee
Mar 24, 2007





You'll take the ride to leave this town along that yellow line

I am not a book posted:

Ok I know this is really dumb, but my coding knowledge is mostly self-taught:
Is there a name for the style of programming where the program starts, get some input from the user, and then call out to functions that do whatever it is that I need doing? More like scripting than anything else.
I tend to do stuff like that as rebellion against the super-object-oriented way that I was taught in my CS minor. Each program was an object and I really hated it because it doesn't seem to make any sense to me.

Do you mean that it starts separate threads which then handle individual functions?

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

I am not a book posted:

Ok I know this is really dumb, but my coding knowledge is mostly self-taught:
Is there a name for the style of programming where the program starts, get some input from the user, and then call out to functions that do whatever it is that I need doing? More like scripting than anything else.
I tend to do stuff like that as rebellion against the super-object-oriented way that I was taught in my CS minor. Each program was an object and I really hated it because it doesn't seem to make any sense to me.

Probably just procedural programming, basically what C is.

And the reason CS classes go a bit overboard on the object-oriented is to get everyone used to thinking in terms of good OOP when they take later classes and need to use those techniques to develop larger software that doesn't devolve into a complete mess of god objects and mega functions.

I am not a book
Mar 9, 2013

JawKnee posted:

Do you mean that it starts separate threads which then handle individual functions?

Nope. Just directly calls other functions.

nielsm
Jun 1, 2009



I am not a book posted:

Nope. Just directly calls other functions.

Procedural programming.

If your program is basically supposed to be non-interactive, reading a limited-size data set in from a file/network/whatever and writing output back, and exits when all input is processed, you might also call it a batch program. But that's not really a programming style as much as a form of UI.

I am not a book
Mar 9, 2013
Thanks everyone, now I can form an unreasonably strong opinion about why my style is superior to all others.

Crunk Magnet
Feb 19, 2004
Poop Soup

Crunk Magnet posted:

I haven't had to do any data modeling in a very long time, and when I did it was a simple UML diagram. I just created my first UML activity diagram in Visio 2013 and I would appreciate it if someone would at least give me an idea if I am using Visio to do this the right way. Programming this would be infinitely easier for me.

The UML Activity Diagram needs to model the following:

    Support the basic functions of addition, subtraction, and multiplication
    Support the basic functions of changing the sign of the number (the +/- key)

http://www.filedropper.com/umlactivitydiagram

Thank you in advance!

Still curious about this. Again, any help would be greatly appreciated as I have never seen a UML activity diagram created before, and it doesn't appear anywhere in my textbook. I just got a picture of one made in Visio 2007 to use as guidance, but it was pretty ambiguous.

Pollyanna
Mar 5, 2005

Milk's on them.


Nobody here would happen to be familiar with the Yelp API, would they? I'm wondering if there's a way to get a list of Restaurant subcategories (Indian, Chinese, Italian, etc.) in a specified area. I want to get restaurants in a random category, but I don't want to choose a category that isn't present in the area...does the API supply something like "put your address here and i'll tell you what categories are available!"?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Can't you just pick a different category when that happens?

it is
Aug 19, 2011

by Smythe
One of my coworkers wrote a script to push some data to a MySQL database. I ran it and got the error "Got packets out of order." What does that even mean? How do you fix it?

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

it is posted:

One of my coworkers wrote a script to push some data to a MySQL database. I ran it and got the error "Got packets out of order." What does that even mean? How do you fix it?

http://stackoverflow.com/questions/10053613/apache-mysql-packets-out-of-order-on-3306

Pollyanna
Mar 5, 2005

Milk's on them.


ultrafilter posted:

Can't you just pick a different category when that happens?

I want to limit the number of search requests I make, so I want to know what's in the area before I make a full search. I also have an issue involving non-cuisine categories like Bars or Lounges getting thrown in the mix. I may have to make a whitelist...

Actually, yeah, I'd like some input. Should I stick to trying to grab the categories from Yelp, or should I make the potential categories a user-curated (or myself?) list instead?

Pollyanna fucked around with this message at 14:20 on Oct 20, 2014

nielsm
Jun 1, 2009



Pollyanna posted:

I want to limit the number of search requests I make, so I want to know what's in the area before I make a full search. I also have an issue involving non-cuisine categories like Bars or Lounges getting thrown in the mix. I may have to make a whitelist...

Cache it? Keep your own copy of what categories are available in an area, refresh it once in a while, fetch it from their server only if you lack a cached copy or it's old.

Pollyanna
Mar 5, 2005

Milk's on them.


Would that be caching in the sense that I save that location to the database, and add categories to that location? In which case, there'd be something like two models:

code:
Location
  has an address (string, from however Yelp interprets the input)
  has many Categories (i.e. cuisine/restaurant types within the maximum range for a Yelp search)

Category
  has a display_name (string, part of Yelp's formatting)
  has a search_value (string, a symbol-like way of representing the Category - e.g. ['Italian', :italian] or ['Indian', :indpak]
  belongs to many Locations
I would keep Categories in the database. Upon making a search request for what's in the area, I would iterate through all the categories, check and see if a matching Category exists in the database already, and if not, add it to the database.

Once that's done, and assuming I know every Category available in a given area, I would then create a Location in the database (formatted as Yelp's returned search parameter), add to it all the respective Categories, and save it to the database. Then, if someone makes a request for an address, the app looks up that address in the database, and if it's there, it searches using the categories already known to exist in that area. If not, a new Location is created, and a list of categories available in the area is gotten from the server, etc etc.

There's still the problem of getting what categories are available in the area - the Yelp API only returns 20 results per search, which is definitely not the same as the number of categories in the area. I might just ask them if there's a way they can implement that in their API.

JawnV6
Jul 4, 2004

So hot ...
You know how your phone or kinect or whatever can be listening for a key word like "Siri," or "Ok Google," and that'll kick in higher-fidelity recording to be kicked up to the cloud? I'm interested in that first bit, like a white paper or something, even a vendor bragging about the capability would be fine. I'm assuming it's low-powered, doesn't have to be trained to a particular user, and is just looking for some 'signature' of that phrase like "hard K followed by two G sounds", translated into frequencies. Like at the extreme end (i.e. gunshot detectors) it could be entirely in hardware with clever enough filtering.

Is "keyword interrupts" commodity technology yet?

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

JawnV6 posted:

You know how your phone or kinect or whatever can be listening for a key word like "Siri," or "Ok Google," and that'll kick in higher-fidelity recording to be kicked up to the cloud? I'm interested in that first bit, like a white paper or something, even a vendor bragging about the capability would be fine. I'm assuming it's low-powered, doesn't have to be trained to a particular user, and is just looking for some 'signature' of that phrase like "hard K followed by two G sounds", translated into frequencies. Like at the extreme end (i.e. gunshot detectors) it could be entirely in hardware with clever enough filtering.

Is "keyword interrupts" commodity technology yet?

This is often called hot word detection. Qualcomm advertises it as part of their sensor suite, so I would guess it's doing just what you said and passively listening for a certain frequency pattern. I would expect that pattern to be controlled by software so the chip isn't issuing an interrupt for every sound it picks up, just a very specific set of frequencies.

Jo
Jan 24, 2005

:allears:
Soiled Meat

chmods please posted:

This is often called hot word detection. Qualcomm advertises it as part of their sensor suite, so I would guess it's doing just what you said and passively listening for a certain frequency pattern. I would expect that pattern to be controlled by software so the chip isn't issuing an interrupt for every sound it picks up, just a very specific set of frequencies.

It's possible this is also done with dedicated hardware, a phrase in firmware, and a small ring buffer. Integrated circuits are surprisingly cheap these days.

JawnV6
Jul 4, 2004

So hot ...

chmods please posted:

This is often called hot word detection.
Thanks, this is helping me get in the right direction. It's still a little "too" accessible, in that I'm getting Android blogs instead of datasheets, but it's closer than "did you mean keyboard interrupts??"

Jo posted:

It's possible this is also done with dedicated hardware, a phrase in firmware, and a small ring buffer. Integrated circuits are surprisingly cheap these days.
I kinda doubt it's a "phrase" in the firmware instead of "bundle of phonemes" but that's splitting hairs. Most implementations don't allow arbitrary hot word selection and force the human to emit a known phrase. Do you know any particular IC's or manufacturers that I could look at for some more details?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

JawnV6 posted:

Thanks, this is helping me get in the right direction. It's still a little "too" accessible, in that I'm getting Android blogs instead of datasheets, but it's closer than "did you mean keyboard interrupts??"

I kinda doubt it's a "phrase" in the firmware instead of "bundle of phonemes" but that's splitting hairs. Most implementations don't allow arbitrary hot word selection and force the human to emit a known phrase. Do you know any particular IC's or manufacturers that I could look at for some more details?

I don't know if this helps you in any way, but the 2014 Moto X lets you use whatever phrase you want as the hotword. Does not work on the 2013 Moto X. Not sure if that's artificial segmentation or if there's a hardware difference between the two handsets.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Thermopyle posted:

I don't know if this helps you in any way, but the 2014 Moto X lets you use whatever phrase you want as the hotword. Does not work on the 2013 Moto X. Not sure if that's artificial segmentation or if there's a hardware difference between the two handsets.

Turns out one review had a writeup of the likely implementation. Considering that the X needed training I wonder if it was some kind of mapping where certain frequencies with certain timing were mapped to certain phonemes. (I know nothing about speech recognition and very little about DSP, fwiw.)

sarehu
Apr 20, 2007

(call/cc call/cc)

I am not a book posted:

Ok I know this is really dumb, but my coding knowledge is mostly self-taught:
Is there a name for the style of programming where the program starts, get some input from the user, and then call out to functions that do whatever it is that I need doing? More like scripting than anything else.
I tend to do stuff like that as rebellion against the super-object-oriented way that I was taught in my CS minor. Each program was an object and I really hated it because it doesn't seem to make any sense to me.

It's called programming. Object oriented programming happens this way too. OOP is just the use of runtime dispatch, some languages also add some other features to their type definition system.

Adbot
ADBOT LOVES YOU

JawKnee
Mar 24, 2007





You'll take the ride to leave this town along that yellow line
Does anyone know what re-sizing algorithm is used by StretchDIBits?

I'm re-sizing a bitmap frame captured from a video using GetCurrentImage, and I need to access the pixel data after the re-sizing, but preferably not by grabbing what's displayed on the screen - I'd rather just grab the same pixels that the algorithm does before the re-sizing happens at all.

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