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.


Random Number posted:

The equation that calculates the signal strength has a randomized numerator. I get the method you're explaining conceptually, but I don't know how i would go about building the system of equations to solve it.

I just had discussion with my TAs about this problem and they're just horribly frustrating, so maybe I'm just too frustrated to see the obvious solution.

It's three equations that are equal to three measured values, and each equation has 3 variables, Am i on the right track here?

Is the numerator the same every time you measure the signal?

Adbot
ADBOT LOVES YOU

ToxicFrog
Apr 26, 2008


2 fat 4 my lambo posted:

you are correct, however it's not my code and I was trying to figure out why it worked in solaris but not linux + how to fix it changing as little as possible

Aah. Without knowing what your end goal is it's hard to say. However, if you just want the ps line for the current process you can replace that whole messy grep pipeline with this:

code:
ps -fp $$ | tail -n1
Which I think will work in Solaris as well, although I don't have a Solaris system handy to test it with at the moment.

Samuel L. Hacksaw
Mar 26, 2007

Never Stop Posting

ultrafilter posted:

Is the numerator the same every time you measure the signal?

yeah but it's randomly generated between 0 and 1 when the program starts.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Random Number posted:

The equation that calculates the signal strength has a randomized numerator. I get the method you're explaining conceptually, but I don't know how i would go about building the system of equations to solve it.

I just had discussion with my TAs about this problem and they're just horribly frustrating, so maybe I'm just too frustrated to see the obvious solution.

It's three equations that are equal to three measured values, and each equation has 3 variables, Am i on the right track here?

See this post:

ToxicFrog posted:

In effect, one measurement gives you a ring, and the source could lie anywhere on that ring; two measurements gives you two rings, which - unless you are very lucky and moved straight towards or away from the source - will intersect at two points, either of which could contain the source; three measurements gives you three rings, and there will only be one point at which all three intersect.

You essentially draw three circles with center = the point you measured at, and radius = signal strength as a distance. The point where they overlap is the location of the signal.

E: Obviously don't actually draw the circles, just do the math.

Carthag Tuek fucked around with this message at 18:26 on Apr 27, 2012

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I'm trying to add some buttons to a toolbar in a closed-source app. I'm pretty sure this is what I have to do:

Inject a dll
In the dll, find the toolbar class (msvb_lib_toolbar)

Add a button - this is where it gets hazy, not sure how to do this yet

Hook the toolbar, act on button events, pass on the ones I don't.



Am I barking up all the right trees?

Opinion Haver
Apr 9, 2007

Carthag posted:

See this post:


You essentially draw three circles with center = the point you measured at, and radius = signal strength as a distance. The point where they overlap is the location of the signal.

E: Obviously don't actually draw the circles, just do the math.

This doesn't work if he doesn't know the numerator though.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Oh didn't see that. He might need to move a bit more than 3 steps before locating the signal then.

At point A, he only knows signal strength.
At point B, he knows signal strength + how far he moved (and in what direction).

Every time he moves, he is given info that can be used to calculate how signal strength corresponds to distance.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Random Number posted:

yeah but it's randomly generated between 0 and 1 when the program starts.

In that case, the ratio of the signal strength at two points doesn't depend on the numerator.

2 fat 4 my lambo
Oct 9, 2003

WEED POOP

ToxicFrog posted:

Aah. Without knowing what your end goal is it's hard to say. However, if you just want the ps line for the current process you can replace that whole messy grep pipeline with this:

code:
ps -fp $$ | tail -n1
Which I think will work in Solaris as well, although I don't have a Solaris system handy to test it with at the moment.

It's actually just to check if the process is already running, so I'll use the $$ variable to exclude itself and it's child processes. Thanks again!

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

Random Number posted:

I posted this over in the Phyiscs questions thread and didn't see a MATLAB thread here so here,

Random Number posted:

I don't know if this question is really a physics question but here goes.

I have a signal, S. That is going to be within a 50m radius of me.

S= (0<=x<=1)/dist^2

I don't know dist or the exact value of the numerator.

I have to use trig and a minimum number of movements to find the position of this source, but I have no idea where to start.

This is a question for my MATLAB class and this is the one part of it I'm hung up on.

I could just move in Y till I'm on axis with the source then move X to the source but that's less than optimal.

Does MATLAB maybe have a function that does this sort of triangulation?

I'd start by taking your equation S=n/d^2 (n is the random numerator) and changing it around to d^2=n/S. At some location x1,y1 you can express the squared distance d^2 as

d^2 = n/S1 = (x1-xs)^2 + (y1-ys)^2

where xs,ys is the location of the source and S1 is the value of S that you measure from x1,y1. Moving around to three locations and measuring S at each point gives the equations

n/S1 = (x1-xs)^2 + (y1-ys)^2
n/S2 = (x2-xs)^2 + (y2-ys)^2
n/S3 = (x3-xs)^2 + (y3-ys)^2

That's three equations with three unknowns (n, xs, ys). Do whatever Matlab stuff you need to do to solve that system.

Samuel L. Hacksaw
Mar 26, 2007

Never Stop Posting

quote:

I'd start by taking your equation S=n/d^2 (n is the random numerator) and changing it around to d^2=n/S. At some location x1,y1 you can express the squared distance d^2 as

d^2 = n/S1 = (x1-xs)^2 + (y1-ys)^2

where xs,ys is the location of the source and S1 is the value of S that you measure from x1,y1. Moving around to three locations and measuring S at each point gives the equations

n/S1 = (x1-xs)^2 + (y1-ys)^2
n/S2 = (x2-xs)^2 + (y2-ys)^2
n/S3 = (x3-xs)^2 + (y3-ys)^2

That's three equations with three unknowns (n, xs, ys). Do whatever Matlab stuff you need to do to solve that system.

Yeah I came to the same conclusion today when thinking about it at work. MATLAB can solve that poo poo easy. Thanks for all the help folks!

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Man its more fun when its hints => solution and the middle part is your own brain.

Samuel L. Hacksaw
Mar 26, 2007

Never Stop Posting

Random Number posted:

Yeah I came to the same conclusion today when thinking about it at work. MATLAB can solve that poo poo easy. Thanks for all the help folks!

Trip Report:

fsolve owns, but when I use my subfunction to solve the system in the larger code that moves me to the source I get errors out the rear end, but at least i know it works if i plug in the values by hand.

I think my guesses might be too far away from the actual values and that's where the errors are coming from.

dmccaff
Nov 8, 2010
What's PhoneGap/Titanium like to use? I have an upcoming project that requires apps for both android and iOS. I'm comfortable with android but I've never touched iOS, or Objective-C for that matter. I have a good amount of Javascript/CSS/HTML experience (although not HTML5/CSS3), so that's why I was thinking of going down the PhoneGap/Titanium route. Thoughts?

spiritual bypass
Feb 19, 2008

Grimey Drawer
It's the quickest, easiest way to get a decent, usable app out the door. If you're not doing much beyond what you would put on a normal website, go for it.

Opulent Ceremony
Feb 22, 2012

rt4 posted:

It's the quickest, easiest way to get a decent, usable app out the door. If you're not doing much beyond what you would put on a normal website, go for it.

Have you or anyone else around here used Titanium for more complex operations?

My colleague and I just used it to make a prototype which was indeed quick and easy, but we are concerned about continuing to use it for the full project since even our very simple app will occasionally crash (could easily be our fault), not to mention the persistent comments of users across the internet that claim it has memory leak problems.

The real project would require building a service-type application that would require the app running in the background all the time so as to push notifications to the user when deemed necessary. It appears that Titanium might have the proper hooks for multiple platforms to go about this, but the issues listed previously concern me.

Physical
Sep 26, 2007

by T. Finninho
Github talk:

We have a repo that houses our production source. We want to be able to have a dev branch, and a production branch. The dev side will be doing things like feature development and bug fixes. I'm a noob to git/github and am wondering how other people/repo's handle situations where they have a feature branch that they are 3 months from deploying, but simultaneously we have a bug fix that needs to be deployed immediately.

Are there any write-up's on this kind of thing? What would you recommend?

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Physical posted:

Github talk:

We have a repo that houses our production source. We want to be able to have a dev branch, and a production branch. The dev side will be doing things like feature development and bug fixes. I'm a noob to git/github and am wondering how other people/repo's handle situations where they have a feature branch that they are 3 months from deploying, but simultaneously we have a bug fix that needs to be deployed immediately.

Are there any write-up's on this kind of thing? What would you recommend?

bugfix branch

Sab669
Sep 24, 2009

So, at my new job they have a weird way of handling things. Or at least, as an intern, it's weird. I don't know, and I hope it isn't, if it's standard in the industry or not.

In any given project, the way they populate drop down menus is by having two tables in the database; DDTypes and DDValues.

So DDTypes might look like this:
code:
DDT-ID | DDT-Type
0      |   EmploymentStatus
1      |   Field
Then there's the DDValues table which will be like this:
code:
DDV-ID | DDT-ID | Value
1      |    0   | Employed
2      |    0   | Unemployed
3      |    1   | Accounting
4      |    1   | IT
So we just have this god drat massive, ugly DDValues table full of all sorts of aribtrary data ranging from different States, Countries, Job Statuses, all sorts of poo poo. Is this a common thing? :psyduck:

ShadoX
Oct 4, 2004
There is no W!

Sab669 posted:

So, at my new job they have a weird way of handling things. Or at least, as an intern, it's weird. I don't know, and I hope it isn't, if it's standard in the industry or not.

In any given project, the way they populate drop down menus is by having two tables in the database; DDTypes and DDValues.

So DDTypes might look like this:
code:
DDT-ID | DDT-Type
0      |   EmploymentStatus
1      |   Field
Then there's the DDValues table which will be like this:
code:
DDV-ID | DDT-ID | Value
1      |    0   | Employed
2      |    0   | Unemployed
3      |    1   | Accounting
4      |    1   | IT
So we just have this god drat massive, ugly DDValues table full of all sorts of aribtrary data ranging from different States, Countries, Job Statuses, all sorts of poo poo. Is this a common thing? :psyduck:

I'm not familiar with that, but I imagine what technology you're developing in will influence those decisions a lot.

Sab669
Sep 24, 2009

We all just work in C#.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

It's not actually an out and out bad decision, it completely takes strings out of the equation for most operations other than insert or update. I could see the benefits of that; I remember wrestling with a system that stored all status codes as varchar(2) but they were all actually integers. Inserting another layer for type definition control and seamless identification seems like it could be a good idea.

Zombywuf
Mar 29, 2008

Sab669 posted:

So we just have this god drat massive, ugly DDValues table full of all sorts of aribtrary data ranging from different States, Countries, Job Statuses, all sorts of poo poo. Is this a common thing? :psyduck:

It is a common thing, it is known as Entity Attribute Value (although this is a normalised form of it). It is almost always a bad thing and hints at other horrors within the DB.

Huragok
Sep 14, 2011
This might be a tricky one, but has anyone had experience interfacing with NetSuite? If so, what were your experiences like?

Background: I have a potential client that wants some reports pulled/inserted from a mobile app, and they use NetSuite as their CRMS.

dmccaff posted:

What's PhoneGap/Titanium like to use? I have an upcoming project that requires apps for both android and iOS. I'm comfortable with android but I've never touched iOS, or Objective-C for that matter. I have a good amount of Javascript/CSS/HTML experience (although not HTML5/CSS3), so that's why I was thinking of going down the PhoneGap/Titanium route. Thoughts?

I put out this app in about a week. Uses Cordova (PhoneGap), jqtouch and some plugins. Super easy to get running and I learned how to make PDFs with JavaScript.

Huragok fucked around with this message at 06:42 on May 6, 2012

ZanderZ
Apr 7, 2011

by T. Mascis
Just a silly question, but when did they make it so you could ID/Class everything in HTML? Is it a 5 feature, or has it been like that for quite some time? The other day I was happily surprised that <li id="foobar"> actually worked when applying styles.

Is it advantageous for SEO to have nicely labled id/classes for as much as possible, or am I getting too crazy? <p1 class="companyname"> I'm still trying to figure out HTML5 and how to make your page meta as gently caress.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

ZanderZ posted:

Just a silly question, but when did they make it so you could ID/Class everything in HTML? Is it a 5 feature, or has it been like that for quite some time? The other day I was happily surprised that <li id="foobar"> actually worked when applying styles.
When id and class were first added in HTML 4. They never were specific to a subset of elements.

nielsm
Jun 1, 2009



ZanderZ posted:

Just a silly question, but when did they make it so you could ID/Class everything in HTML? Is it a 5 feature, or has it been like that for quite some time? The other day I was happily surprised that <li id="foobar"> actually worked when applying styles.

Is it advantageous for SEO to have nicely labled id/classes for as much as possible, or am I getting too crazy? <p1 class="companyname"> I'm still trying to figure out HTML5 and how to make your page meta as gently caress.

It's a HTML 4 thing, so from around 1997.
I doubt crawlers really look at anything you put as classes or ids.

Johnny Cache Hit
Oct 17, 2011

ZanderZ posted:

Just a silly question, but when did they make it so you could ID/Class everything in HTML? Is it a 5 feature, or has it been like that for quite some time? The other day I was happily surprised that <li id="foobar"> actually worked when applying styles.

Is it advantageous for SEO to have nicely labled id/classes for as much as possible, or am I getting too crazy? <p1 class="companyname"> I'm still trying to figure out HTML5 and how to make your page meta as gently caress.

I don't think scrapers look at ID/class. And I'm pretty sure they also don't look at any of the new semantic layout tags (article/section/whatever). I think SEO-wise, the only bump you can get is from HTML5 microdata/Rich Snippets.

dmccaff
Nov 8, 2010

Kim Jong III posted:

I don't think scrapers look at ID/class. And I'm pretty sure they also don't look at any of the new semantic layout tags (article/section/whatever). I think SEO-wise, the only bump you can get is from HTML5 microdata/Rich Snippets.

Pardon my ignorance if I'm totally wrong here since I have not used HTML or done a website in quite some time, but what's the point of the 'article'/whatever tags if the search crawlers don't look at them? I was always under the impression they would look at those sort of things as we move toward the 'semantic' web, or whatever it's called.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





The new tags are for better 'alternative' interfaces to consume html5. Things like screen readers, mobile browsers, Instapaper like clients, webapps that consume other webpages, etc.

Zombywuf
Mar 29, 2008

Basically there are huge parts of web technology that have nothing to do with boosting your search rankings.

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
I'm looking for a good resource on developing testing procedures for QA.

Admittedly, my situation is a bit screwed up. We have a bunch of user-facing tools that aren't being tested, and therefore I am very wary about making changes to them. Too often, I've found that I have broken features that I didn't even know about (or forgot about). We do have a lot of users, though, so bugs like this tend to get caught early, but sometimes they just fester.

So, getting started with testing on something like this feels daunting... especially because I don't even know how I should write scripts that I could give to an arbitrary QA person to run through (who are not necessarily familiar with the function of our tools).

Coolguye
Jul 6, 2011

Required by his programming!
Does anyone have some good primers to get started properly with Bash scripting? Half of the ones I google up don't even have working code examples, which makes me wonder exactly how terrible their advice is. I'm mainly messing around with outputting stuff to the screen for use in videos, so if there's any neat tricks with curses or other psuedo-graphical outputs we can do with Bash I'd definitely like to know about that stuff.

Johnny Cache Hit
Oct 17, 2011

baby puzzle posted:

Admittedly, my situation is a bit screwed up. We have a bunch of user-facing tools that aren't being tested, and therefore I am very wary about making changes to them. Too often, I've found that I have broken features that I didn't even know about (or forgot about). We do have a lot of users, though, so bugs like this tend to get caught early, but sometimes they just fester.

I think you'll quickly find that your situation is the norm - most places spend as much time on QA as they do on documentation :eng99:

The last time I took over on a large codebase with zero testcase/QA coverage, I started with writing functional tests. I broke them into two categories - smoke tests & functionality tests. The smoke tests should be really limited - does the tool open, does it read/write files properly, etc. These tests should take a few minutes to run, and you should run them before every commit to be sure you don't break poo poo. The functional tests should test what the smoke tests don't. They'll take longer to run, so I ended up doing them every morning on the trunk.

For these tests, just type up some instructions for QA with screenshots as needed. "Click here, type this, the result should be X" is perfect. I was shocked at how many bugs I was able to catch with just three or four pages of these test cases.

Next, I'd just start with unit tests. Write unit tests from here out - any time you refactor/change features, make a unit test as well. And don't forget to write a unit test for any bug you fix. Set up your VCS to run the unit tests before every check-in & refuse if the tests fail.

Whatever you do, resist the temptation to use testing harnesses like Selenium, or continuous integration tools like Buildbot. These are wonderful, but IMO you'll spend a lot of time learning & working with them. Once the basic tests are in place and the code stops breaking when you breathe on it you can look at the cool stuff :science:

w00tz0r
Aug 10, 2006

I'm just so god damn happy.

Kim Jong III posted:

Whatever you do, resist the temptation to use testing harnesses like Selenium, or continuous integration tools like Buildbot. These are wonderful, but IMO you'll spend a lot of time learning & working with them. Once the basic tests are in place and the code stops breaking when you breathe on it you can look at the cool stuff :science:

We're going the other way at my shop - my lead was refusing to agree to let me put unit tests or stuff like Doxygen in because "I commit a lot and I don't want to have to run tests or extract documentation every time." I put all of our software into Jenkins, all of that stuff happens behind the scenes now, and he's got no arguments on those fronts left.

That said, we have terrible infrastructure and practices, and I need to get out of this place.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Coolguye posted:

Does anyone have some good primers to get started properly with Bash scripting? Half of the ones I google up don't even have working code examples, which makes me wonder exactly how terrible their advice is. I'm mainly messing around with outputting stuff to the screen for use in videos, so if there's any neat tricks with curses or other psuedo-graphical outputs we can do with Bash I'd definitely like to know about that stuff.

I haven't used Bash in a while but when I did this guy's guide seemed pretty good.
http://tldp.org/LDP/abs/html/

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
Didn't we have a cuda thread at some point? Reasoning about performance with cuda is kind of a mindfuck some times :(

an skeleton
Apr 23, 2012

scowls @ u
So I'm taking my final exam for c++ (its open internet so its not cheating, i think) and im confused because in this code:

quote:

pointCls point1;
cin >> point1;
cout << "point1:";point1.print ();cout << endl;
cout << "******" << endl;
plotCls p1(6,2),p2(-2,0),p3(-1,6),p4(0,0),p5(4,8),p6(-3,-2);
cout << "p1:"; p1.print();
cout << "p2:"; p2.print();
cout << "p3:"; p3.print();
p4 = p1 + p2+ p3;
cout << "p4:"; p4.print();
p4 = p4 + 3;
cout << "p4:"; p4.print();
cout << "******" << endl;
lineCls l1(p1,p2), l2(p3,p4),l3(p5,p6),l4(p1,p2);
cout << "l1:"; l1.print(); cout << endl;
cout << "l2:"; l2.print(); cout << endl;
cout << "l3:"; l3.print(); cout << endl;
l4 = l1 + l2 + l3;
cout << "l4:"; l4.print(); cout << endl;
l4 = l4 + 3;
cout << "l4:"; l4.print(); cout << endl;

class point1 is defined by the cin, and I dont know how to get that to work within the program.

also the lineCls l4 is defined by adding integers to it! For some reason this is stumping me, any help?

nielsm
Jun 1, 2009



Lots of operator overloading going on there.
Also eww, iostreams.

cin >> point1; for example, can only work if there is defined an operator>> that takes an input stream on the left-hand side and a pointCls object on the right-hand side.

You can't really know what that code does without knowing what operators are overloaded and what what types, and what they actually do.

Adbot
ADBOT LOVES YOU

an skeleton
Apr 23, 2012

scowls @ u
Well I need cin to take in an X and a Y value to create a "point" (x,y) I guess.

basically this would be easier if I could just make the constructor ask for these values as a cin, but for some reason my professor has it like this in the main and I don't know, it seems like a mistake but I pointed right to it and asked if thats how its supposed to be/can we change it and he said no its correct.

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