text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 22 Oct 2019, 19:34

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# The New Oxnard Resort and Spa will hire 12 individuals to fill the

Author Message
TAGS:

### Hide Tags

Manager
Joined: 27 Jan 2016
Posts: 123
Schools: ISB '18
GMAT 1: 700 Q50 V34
The New Oxnard Resort and Spa will hire 12 individuals to fill the  [#permalink]

### Show Tags

17 Jul 2017, 03:40
3
00:00

Difficulty:

75% (hard)

Question Stats:

38% (02:02) correct 62% (02:07) wrong based on 29 sessions

### HideShow timer Statistics

The New Oxnard Resort and Spa will hire 12 individuals to fill the positions of greeter, janitor, consultant, fry cook, and massage therapist. If each individual will be hired for 2 positions, and no position will be filled by more than 9 individuals, how many distinct groups of individuals could be hired as greeters?

(1) 66 distinct groups each of massage therapists, fry cooks and consultants could be hired.
(2) All of the fry cooks are also hired as consultants and all of the janitors are also hired as greeters.
Current Student
Joined: 22 Sep 2016
Posts: 159
Location: India
GMAT 1: 710 Q50 V35
GPA: 4
Re: The New Oxnard Resort and Spa will hire 12 individuals to fill the  [#permalink]

### Show Tags

18 Jul 2017, 06:00
1

srikanth9502 wrote:
The New Oxnard Resort and Spa will hire 12 individuals to fill the positions of greeter, janitor, consultant, fry cook, and massage therapist. If each individual will be hired for 2 positions, and no position will be filled by more than 9 individuals, how many distinct groups of individuals could be hired as greeters?

(1) 66 distinct groups each of massage therapists, fry cooks and consultants could be hired.
(2) All of the fry cooks are also hired as consultants and all of the janitors are also hired as greeters.

What does this question even mean?
I don't understand the question itself, let alone answer it!

_________________
Desperately need 'KUDOS' !!
Manager
Joined: 27 Jan 2016
Posts: 123
Schools: ISB '18
GMAT 1: 700 Q50 V34
Re: The New Oxnard Resort and Spa will hire 12 individuals to fill the  [#permalink]

### Show Tags

18 Jul 2017, 07:07
rekhabishop wrote:

srikanth9502 wrote:
The New Oxnard Resort and Spa will hire 12 individuals to fill the positions of greeter, janitor, consultant, fry cook, and massage therapist. If each individual will be hired for 2 positions, and no position will be filled by more than 9 individuals, how many distinct groups of individuals could be hired as greeters?

(1) 66 distinct groups each of massage therapists, fry cooks and consultants could be hired.
(2) All of the fry cooks are also hired as consultants and all of the janitors are also hired as greeters.

What does this question even mean?
I don't understand the question itself, let alone answer it!

Even, I am in the same state. That is the reason I've posted it, so that someone in this forum could help me out.
Intern
Joined: 13 Aug 2018
Posts: 1
The New Oxnard Resort and Spa will hire 12 individuals to fill the  [#permalink]

### Show Tags

23 Aug 2018, 09:04
This seems to be a 700+ problem,but solvable.

Let the 12 individuals be marked as A,B,C,D...L.
Since each individual is supposed to be fill exactly 2 positions,
total no. of positions=12x2= 24

Coming to statements:

(1) 12Cx = 66,
where x= no. of individuals taken at a time
Solving, x gives 2.
So,it only tells that 2 individuals are hired for each of the three listed positions. [INSUFFICIENT]

(2) Statement alone tells no useful values; only gives comparisons. [INSUFFICIENT]

Combining, we have:
Since the 2 fry cooks are consultants also, we can assign individuals 'A' and 'B' (say) to both these positions.
Remaining positions =24-4=20

Now,2 Massage therapists (from Statement 1) must be appointed either as Greeters or Janitors.
But, as per Statement 2,all Janitors are Greeters and each individual should be in 2 positions exactly. Therefore, the 2 Massage therapists have to be Greeters.
Let'C' and 'D' be these 2 massage therapists cum Greeters.
Now, remaining positions=20-4=16

These remaining 16 positions(for 8 individuals) should be split evenly between Janitors and Greeters, as all janitors are greeters too.

Hence, distinct groups of individuals that could be hired as Greeters = 10C2 x 1= 45

Posted from my mobile device
The New Oxnard Resort and Spa will hire 12 individuals to fill the   [#permalink] 23 Aug 2018, 09:04
Display posts from previous: Sort by


text:
Bapilievolia0o0

2023-02-21

A 0.5 kg ball is thrown horizontally from point A with velocity V_A=2m/s. It strikes the smooth inclined plane and bounces. Take coefficient of restitution e =0.6 and g=10m/s^2The speed at which it bounces from the plane is...

Riley Cisneros

$R={V}_{A}t\phantom{\rule{0ex}{0ex}}t=1sec\phantom{\rule{0ex}{0ex}}{v}_{x}=\mathrm{cos}{30}^{\circ }=\sqrt{3}m/s\phantom{\rule{0ex}{0ex}}{v}_{y}=2\mathrm{sin}{30}^{\circ }=1m/s\phantom{\rule{0ex}{0ex}}{a}_{x}=-g\mathrm{cos}{30}^{\circ }=4.9m/{s}^{2}\phantom{\rule{0ex}{0ex}}{a}_{y}=-g\mathrm{cos}{30}^{\circ }=-4.9\sqrt{3}m/{s}^{2}\phantom{\rule{0ex}{0ex}}{v}_{x}={v}_{x}+{a}_{x}t\phantom{\rule{0ex}{0ex}}{v}_{y}={v}_{y}+{a}_{y}t\phantom{\rule{0ex}{0ex}}V=\sqrt{{v}_{x}^{2}+\left(eVy{\right)}^{2}}=8.0m/s$

format: plain


text:
# GIMP: Why can I set a higher quality than original image in the "Export Image as JPEG" dialog?

Photography Asked by bela53 on December 20, 2020

After having read the GIMP Export Image as JPEG section, I still have one understanding issue:

Why am I able to select a higher quality value than the one from original image in the export dialog?

For example, given a .jpeg image, the quality slider is first set to the default 90. When marking "Use quality settings from original image", the value is set to 75. I can now still select slider values > 75, which creates the impression to raise the quality above original image.

With that assumption in mind (which may be wrong, I am happy to be corrected here), this dialog does not make sense to me. JPEG is a lossy format and an image with lower quality cannot be magically transformed to a higher-detail image. Also, the value seems to indicate some kind of "absolute quality", not a relative one – otherwise the original quality would be 100.

### Edit

It seems, the biggest source of confusion has been the GIMP tooltip itself for me. Here are some screenshots, to show what I mean:

1. This is the default export as jpeg screen with image quality of 90

2. After having marked "use quality settings from original image"

Quality slider is automatically adjusted to 75 here. Tooltip says, its (almost) same quality, which let me assume, that

1. it is an (almost) losless conversion
2. 75 is some kind of absolute, computed quality indicator and means 100% quality preserveation in relative terms

After loading the image, Gimp is just working with the grid of pixels, which now include noise/artifacts from that first save (as well as noise/artifacts from the original sensor and any processing done in-camera).

When you go to save in Gimp, you're selecting how much more degradation you're willing to allow in saving the current batch of pixels (or to put it another way, how much fidelity you want to preserve of the current noise/artifacts).

If I Compress a JPEG at 70 Percent and Later Reopen It and Compress It at 90 Percent, the Final Image Will Be Restored to a Quality Setting of 90 Percent: False

The initial save at 70 percent introduces a permanent loss in quality that can't be restored. Saving again at 90 percent only introduces additional degradation to an image that has already had a considerable loss in quality.

Correct answer by L. Scott Johnson on December 20, 2020

Because Gimp makes no assumption about what you did to the image. Several cases where it makes sense:

• You load a low-quality image to serve as a background to which you add high-quality elements. A typical case is adding text to an image, text is very vulnerable to compression...
• You save the image after cropping it by something which is not a multiple of 8 pixels along the leading edges: the 8x8 blocks of the JPEG encoding are shifted, the compression artifacts are not re-encoded the same way and are just like other pixels, so compression artifacts apply to them. There is a non-negligible difference between the two images. Below, the image of a plane (Q=70), cropped with an origin shifted by 3x5 pixels, re-saved with Q=70 and Q=95. Showing the (re-aligned) difference with the original, thresholded at 15. Needless to say, Q=70 is at the top.

But really, low-quality JPGs are not meant to be re-edited.

Special case: if you:

• only do local edits (removing blemishes, etc)
• do not shift the origin of the image when cropping (or shift it by multiples of 8 pixels)
• tick the Use quality setting from original image

... then there will be very little re-compression loss on the parts that were not edited.

Answered by xenoid on December 20, 2020

When an image is saved as JPEG, the JPEG compression is free to discard details so that the image takes less space. The quality setting controls how close the output image is to the original. With it set to 100, there is the possibility of loss of precision that leads to reduction of details. See this answer for details. Keep in mind that the compression may not remove any detail if it happens to be well represented, for example an image made of just a single color throughout.

Once a JPEG is loaded, its pixel data is available in the application for editing but that is only the pixel data that is in the file. Anything that was discarded when creating that JPEG, is gone.

Saving the image again after editing results in another pass of the JPEG compressor. Again, any quality level can remove more details, so even if you ave at higher quality than the original you will never have more details but it is likely that further details are lost. It is not exactly multiplicative but if you have a quality 75 image from one that was already quality 75%, the result is a lower quality image even though the number is the same.

Answered by Itai on December 20, 2020

The compression quality setting indicates the accuracy with which Gimp tries to preserve its in-memory image when saving.

I can make an ultra-high quality recording of a mobile phone call. That does not make the phone call sound any better. It also does not make it deteriorate further, like sending it over a mobile phone connection again would likely do.

But it will take a larger file size to represent the quality of a small file.

Answered by user92986 on December 20, 2020

## Related Questions

### How do I get metallic labels to pop

3  Asked on December 23, 2020 by jerry-fictum

### What is Nineteen Megapixels minus Sixteen Megapixels?

2  Asked on December 23, 2020 by billy

### How to crop multiple pictures for a time-lapse so they fit over each other perfectly?

1  Asked on December 23, 2020

### Picture Metadata and Face Tags: What Software to Write and Read them?

6  Asked on December 22, 2020 by euphoria

### Is it possible to take pictures for a timelapse on a Nikon D90 without using an intervalmeter

3  Asked on December 22, 2020 by roberteves92

### Why won’t my Fujifilm X-T2 take pictures when I press the shutter?

1  Asked on December 22, 2020 by roos

### Problems creating a photo album: which is the expected size and resolution?

1  Asked on December 22, 2020

### Why do I get the “Change the battery pack” message on startup with my Canon Powershot ELPH?

5  Asked on December 22, 2020 by avi-ginsburg

### Small photos c. 1919 1.75 X 2.75 prints

2  Asked on December 22, 2020 by dan-j-friend

### Do you have to account for crop factor in the NPF rule?

2  Asked on December 22, 2020

### What is the difference or relation between a Color Model and a Color Space?

4  Asked on December 21, 2020 by tormod-haugene

### Canon 80D DC Coupler to automatically turn DSLR back on after power outage

2  Asked on December 21, 2020 by nikolaj-cklamovski

### Why won’t my Canon 60D take more than one photo with the internal flash, without closing it manually?

2  Asked on December 21, 2020 by bluetile

### Cannot enable remote control for still images on Canon EOS M50

2  Asked on December 21, 2020

### How to properly focus using a Macro reverse ring?

2  Asked on December 21, 2020 by jrme-mevel

### Is there a way to delete all RAW files if a corresponding JPG file exists?

2  Asked on December 21, 2020 by user1074239

### Can the specs for a digital camera indicate to me the color quality before buying?

5  Asked on December 20, 2020 by griffon-vulture

### GIMP: Why can I set a higher quality than original image in the “Export Image as JPEG” dialog?

4  Asked on December 20, 2020 by bela53

### Extend PIR range by adding a lens?

1  Asked on December 20, 2020 by jasonplutext

### How does having a large diameter make the SEL85F1.4 a premium lens?

3  Asked on December 20, 2020


text:
# In observing a Tetrahedron.....

#### gillsimo

##### New member
Is it already well established that in a regular tetrahedron;

Any two opposing edges are segments of the two strands of a double helix.

That, there being three sets of two opposing edges, the other two sets are also likewise.

That a tetrahedron is the geometric structure formed where three double helixes, one in/from each of the dimensions, meet.

It's taken almost 20yrs of mental meditation for me, personally, to see this simple truth but I find it implausible that I've seen something novel?

Thank you
Gill

#### mmm4444bot

##### Super Moderator
Staff member
… I find it implausible that I've seen something novel?
Hello Gill. That looks like a rhetorical question. Are you trying to solicit commentary about the topic in general, or are you looking for something specific? Cheers

$$\;$$

#### gillsimo

##### New member
Hi, thanks for responding.
I must admit that I had to Google rhetorical question but having done so then no....I'm not asking a question expecting no answer, nor am I asking a question with an obvious answer...well, not obvious to myself at least.
I have, after many years of application, come to observe that the above statements re a tetrahedron are apparently fact.
That said, I'm in no way confident that my 20yr quest to reach this observation is anything more than a wasted effort....that I've put an immense effort into discovering something for myself that I could have discovered was already very well known, in a few seconds, simply by a Google search....20yrs ago!
I've since attempted an online search of course but I've found nothing at all that relates. However, that is just as likely due to my inability to conduct a search effectively as it might be due to there actually being no info on the matter.
Thus I'm asking the question here, hoping to receive a simple yes...it's already observed, or no....what on Earth are you talking about Gill?
Logic must suggest it to be the former of the two, that all possible observations of a tetrahedron have long since been made....the illogical suggests that perhaps my efforts haven't been wasted....that perhaps this particular observation requires 20yrs worth of mental digging before it can be unearthed?
Torn between the both by way of my own ignorance, then I'd really appreciate the straight answer to the question in order to settle my sanity, so to speak.
Thanks/Gill


text:
# Variable Exposure - Epidemic Alert

## Recommended Posts

I've been coding in C++ for 4 or 5 years now, and I have shamelessly used public member variables in every class I've ever designed. I'm trying to change my horrible habits.
Quote:
 Never use public or protected member data.
This is something I ran into, within a list of programming guidelines for OO decency. Why not have member data as protected? Do classes publically derived from base classes inherit the protected data? What about the private data? I know I sound like an idiot, but I've never attempted to understand the issues around protected and private declaration, or the difference between them. Are there any good tutorials or documents out there specifically written to help educated but corrupted programmers? :) Here's a scenario for ya. Say I have a class that is written correctly (term for non-exposure?). If I include that class as a member variable in another class, can I expose that data? It's own data is hidden from access, so why hide the actual class member? Let me know if you don't follow what I'm describing. Here's another. What if I have a GUI system which doesn't have it's own data, but uses pointers to the actual runtime data to do its work? How can I respectably give a generic GUI control total acces to modify a data member (generic variable, such as int, float, char, etc) within a class which has that data as protected / private? Supplying a pointer to it would completely destory the whole point, right? I have other questions, but I don't want to be a leech :) The more simple your terms of are, the higher I'll rate ya ;) Thanks for any advice.

##### Share on other sites
First of all, whenever a programming text says "Never do XXXX", it usually means "XXXX is generally considered a BAD thing for a variety of reasons, but is useful in some circumstances". Remember these are guidelines you're reading, not hard and fast rules that you must follow.

Anyway, in most practical cases, the superclass will either be an interface class - in which case it doesn't require any data at all - or a fully self contained class in it's own right - in which case the subclasses can access/manipulate the data in the same way that everything else does, through the use of suitable member functions.

In your first scenario, I suppose you could expose it directly, but it's still not recommended, since the parent class may need to perform initialization, or other operations on it. Strictly speaking it would be better to use inlined accessors or else rethink your design.

I'm not sure I fully understand your second scenario, but again it sounds like something which could be resolved with a rethink of your implementation.

##### Share on other sites
Quote:
 Original post by JiiaWhy not have member data as protected? Do classes publically derived from base classes inherit the protected data? What about the private data?

I think it would be best to describe why we encapsulate a type's representation from other unrelated types/modules using private access in the first place before talking about why it's best practice not to use protected data members.

The two main reasons why we encapsulate a type's representation is to:

1. Provide loose coupling among modules, meaning that if a library of modules/types relies on another module/type's representation and we decide that the representation for it is incorrect/unsuitable and we make changes in that module/type then every other module/type needs to be updated. Where as if they all relied on the interface of the module/type instead it's easy to change the repsentation without effecting other modules/types.

2. To maintain the state invariant, meaning to avoid putting an instance of some type in an underfined state. If the data members are only allowed certain values in a certain ranges and you allowed direct access how could you stop users of that instance from putting invalid/out-of-range values?

Now we know the main reasons why we encapsulate a type's representation from other unrelated types/modules we'll talk about protected members.

If you make a data member protected your basically contradicting your self, why? well you've encapsulated from unrelated types/modules but you allow clients direct access from sub-types and now instead of avoiding tight coupling among unrelated types you've just made tight coupling with related types and the possiablity of invalidating the state invariant making an instance of the sub-type in a undefined state.

Probably see where this is going, a type's representation is just minor details, it's interface is more important, this is especially true for abstract data types (ADT) where they can have more than one representation for example the ADT Stack there are probably infinite number of ways to represent the internals of a stack but no one cares we just care what we can do to stacks, it's behaviour/operations/interface.

Quote:
 Original post by JiiaHere's a scenario for ya. Say I have a class that is written correctly (term for non-exposure?). If I include that class as a member variable in another class, can I expose that data? It's own data is hidden from access, so why hide the actual class member? Let me know if you don't follow what I'm describing.

Quote:
 Original post by JiiaHere's another. What if I have a GUI system which doesn't have it's own data, but uses pointers to the actual runtime data to do its work? How can I respectably give a generic GUI control total acces to modify a data member (generic variable, such as int, float, char, etc) within a class which has that data as protected / private? Supplying a pointer to it would completely destory the whole point, right?

Well first you should prefer returning constant references over pointers but anyways provide a constant member function that returns constant pointer or constant reference.

[Edited by - snk_kid on August 3, 2004 11:45:43 AM]

##### Share on other sites
You make data private for a reason - its status is important and you need to control access to it so that it doesn't become invalid. Anyone outside of the class shouldn't have to worry about the object being in an invalid state.

These reasons still apply to protected data. You're saying 'only derived classes should have access to this data - anyone else might modify it in an inconsistent way'. But if there is that danger, derived classes are just as capable of messing up the state of the object. So it's a bit of a half baked idea.

Quote:
 I think that overstates the case against protected' a bit. here is the actual quote:Five years or so later, Mark banned the use of protected datamembers in Interviews because they had become a source of bugs:novice users poking where they shouldn't in ways that they oughtto have known better than.'' They also seriously complicatemaintenance: now it would be nice to change this, do you thinksomeone out there might have used it?'' Barbara Liskov's OOPSLAkeynote gives a detailed explanation of the theoretical andpractical problems with access control based on the protected'notion. In my experience, there have always been alternativesto placing significant amounts of information in a common baseclass for derived classes to use directly. In fact, one of myconcerns about protected' is exactly that it makes it too easyto use a common base the way one might sloppily have used globaldata.Fortunately, you don't have to use protected data in C++;private' is the default in classes and is usually the betterchoice. Note that none of these objections are significant forprotected member functions. I still consider protected'a fine way of specifying operations for use in derived classes.The Design and Evolution of C++, sec13.9.However, I do consider reliance on protected data a dubious practice in any language.

I was recently reading Large Scale C++ Design by Lakos and was interested by his practice.

Basically, the main use of protected is for member functions and it allows you to call them in a controlled manner. This is useful (primarily in my opinion) for the Template Method Pattern. But Lakos considers it to be putting implementation details in the public interface of the class. If I'm a user of the class I don't care what its protected functions are. I'm not allowed to call them.

So Lakos suggests you could move those functions and put them in an implementation class (this is something he does all the way through and it is now well known as the PimplIdiom). But this is a specific application of it to remove protected members from the public interface. So the protected functions go into another class, but you make them public. Then people derive from that class instead of the original one.

In terms of good design, on the whole, making your interface classes have data protected or even private isn't enough. You need to remove the details completely.

//SomeClass.hclass SomeClass {private:    std::string m_name;public:    void SetName(const char* name) {        m_name = name;        OnSetName(name);    }protected:    virtual void OnSetName(const std::string& name) = 0;};

becomes
//SomeClass.hclass SomeClassImpl;//will be the private functionalityclass SomeClassStrategy;//will be the protected functionalityclass SomeClass {private:    SomeClassImpl* m_pImpl;public:    void SetName(const char* name);    void SetStrategy(const SomeClassStrategy*);};

You implement SomeClassImpl elsewhere. Users can derive from SomeClassStrategy. All you have in the public interface is the public members. You have decoupled the implementation details and can change them without users of having to recompile.

Hope that all makes sense. I've rambled a bit, but basically, you can remove protected and private data and functions from your class interface. The data becomes private and the functions become public. The implementation is never made available to users.

This is useful and it is good to understand the benefits. These are rules to do with good large scale design. It isn't morally wrong but could be a design problem. Never say never though.

##### Share on other sites
You know, at the heart of this question is the question "Who are we designing our classes for?"

Often the answer to this is ourselves and therefore the whole data hiding thing seems silly because we can't hide it from ourself because we know it's there and we know the bounds and limits and uses of that data, so when we our the class writer and user it seems to add a lot of unneeded redirection.

So I guess the bottom line to ask yourself when you are writing a class is who will be the end user? If you are sure it's only for yourself then I wouldn't worry about hiding and continue using public members.

On a related note though, hiding from yourself may be benificial too if you ever think you might have to come back to a complicated class you havn't worked with in a long time. Though, since you've got the source, you can always go back in and review/relearn it.

D

##### Share on other sites
Quote:
 Original post by darrylshYou know, at the heart of this question is the question "Who are we designing our classes for?"Often the answer to this is ourselves and therefore the whole data hiding thing seems silly because we can't hide it from ourself because we know it's there and we know the bounds and limits and uses of that data, so when we our the class writer and user it seems to add a lot of uneeded redirection. So I guess the bottom line to ask yourself when you are writing a class is who will be the end user? If you are sure it's only for yourself then I wouldn't worry about hiding and continue using public/private. On a related note though, hiding from yourself may be benificial too if you ever think you might have to come back to a complicated class you havn't worked with in a long time. Though, since you've got the source, you can always go back in and review/relearn it.D

And the question is why are we creating a user-defined types for are selfs? The common answer is to build a portfolio of are skills to show it to employers to get a job so do we really wanna show sloppy code that no-one can decipher/decrypt?

I'm not saying that these good principles apply for every-case, like a 2d vector/point is valid to have it's members public because there is no limit/range on the values the members can have, the representation is never gonna change.

##### Share on other sites
Quote:
 Original post by darrylshYou know, at the heart of this question is the question "Who are we designing our classes for?"

The point of encapsulation is not so much to hide implementation details from another programmer, but to ensure that classes are self contained and loosely bound to one another, resulting in modular, reusable code which can be expanded without necessarily breaking the code that depends on it.

Of course, properly encapsulated reusable code is not something you'll learn to write overnight, and there may be projects for which it simply isn't worth the extra effort. It's very easy to get caught in the trap of overengineering everything, with the result that instead of getting unreusable but functional code, you end up with no working code at all.

##### Share on other sites
Quote:
 Original post by darrylshYou know, at the heart of this question is the question "Who are we designing our classes for?"Often the answer to this is ourselves and therefore the whole data hiding thing seems silly because we can't hide it from ourself because we know it's there and we know the bounds and limits and uses of that data, so when we our the class writer and user it seems to add a lot of unneeded redirection.

Taken to an extreme you could say you'll have all data public in your classes/structures and no member functions. You could make all your data global too.

But your design would be unmanageable.

The reason you write code in a professional manner isn't because someone is looking over your shoulder, or even because some prospective employer may someday see it. You write good code because it's good code.

##### Share on other sites
I really appreciate all of the help and advice. I've learned more in the last few minutes than in the last few months. Kind of sad, really.

Quote:
 Original post by petewoodThese reasons still apply to protected data. You're saying 'only derived classes should have access to this data - anyone else might modify it in an inconsistent way'. But if there is that danger, derived classes are just as capable of messing up the state of the object. So it's a bit of a half baked idea.

Ahh, I very much like the simplified example. This was very helpful. So all derived classes still inherit all member data variables, no matter which section they are listed under? But the point is that in private, the derived class cannot modify it's base classes' data, just as the outside world cannot modify it? But protected is still very useful to include tasks for that class to run on itself. This really does make a lot of sense.

My current game has 1.46 megs of poorly written source code, so I'm gonna be busy for quite a while.

I don't seem to use pure interface classes very often. My interface classes usually contain data which is needed for all derived objects. Such as CObject, which has a position vector, which is needed by CCharacter and CItem. That's a simple example; the number of actual variables is pretty high. My code is written now in such a way that CObject has member functions which handle almost everything that both characters and items need to have handled. There are very few functions which are overridden. Most are virtual, and the character and item classes use many CObject member functions to perform their tasks.

There are some situations where not having data as public or protected would seem to be a real pain. My CObject class has a CBitflag variable. CBitflag is a correctly encapsulated class that has member functions to handle tasks with it's own bitflag variable. How do I allow characters to turn on and off state-flags without having to write the CBitflag class interface into the CObject class interface? Example:
class CBitFlags{public:    CBitFlags() { Clear(); }    VOID Clear()                    { Data = 0; }    VOID Fill()                     { Data = 0xFFFFFFFF; }    BOOL Bits(ULONG FlagValue)      { return Data & FlagValue; }    VOID TurnOn(ULONG FlagValue)    { Data |= FlagValue; }    VOID TurnOff(ULONG FlagValue)   { Data &= ~FlagValue; }    VOID Toggle(ULONG FlagValue)    { Data ^= FlagValue; }    ULONG GetData() { return Data; }    operator = ( CONST ULONG FlagValues ) { Data = FlagValues; }private:    ULONG        Data;              // Flag Data};class CObject{public:    ...private:    CBitFlags   FStatus;    ...};class CCharacter : public CObject{public:    VOID TakeHealth(INT value)    {        HurtMe(value);        if(GetHealth() < 0)            FStatus.TurnOn(STATUS_DEAD);    }};

There are many flags defined for FStatus. Well... 32 :) And this is just an example; I know I could allow CObject to handle deaths, but this is not the case with all flags. And I cannot access them from CCharacter if FStatus is private. What can I do?

I almost forgot to ask one other question. Why derive classes as public? As in CCharacter : public CObject. What happens when you derive them private or protected? Again, sorry if this is a dumb question.

Thanks again.

##### Share on other sites
Quote:
 Original post by JiiaBut protected is still very useful to include tasks for that class to run on itself. This really does make a lot of sense.

I'm not sure what your saying here.

Quote:
 Original post by JiiaI don't seem to use pure interface classes very often. My interface classes usually contain data which is needed for all derived objects. Such as CObject, which has a position vector, which is needed by CCharacter and CItem. That's a simple example; the number of actual variables is pretty high. My code is written now in such a way that CObject has member functions which handle almost everything that both characters and items need to have handled. There are very few functions which are overridden. Most are virtual, and the character and item classes use many CObject member functions to perform their tasks.

Maybe your using the wrong levels of abstraction, i see having CObject type which is the root of all types in a type hierarchy not very useful at all to be honest, it's to abstract to be put into any good use, you end up stuffing data and pushing functionality there where it doesn't actually make any sense.

You usually find interfaces in the concepts of the problem domain, where you see adjective-nouns such as serializable, cloneable, renderable etc or in traditional object-oriented abstract data types (ADTs). Interfaces do not have data members, constants are fine though.

Quote:
 Original post by JiiaThere are some situations where not having data as public or protected would seem to be a real pain. My CObject class has a CBitflag variable. CBitflag is a correctly encapsulated class that has member functions to handle tasks with it's own bitflag variable. How do I allow characters to turn on and off state-flags without having to write the CBitflag class interface into the CObject class interface? Example:*** Source Snippet Removed ***There are many flags defined for FStatus. Well... 32 :) And this is just an example; I know I could allow CObject to handle deaths, but this is not the case with all flags. And I cannot access them from CCharacter if FStatus is private. What can I do?

solution look at the standard library bitset and prefer using that instead

##### Share on other sites
Quote:
 Original post by JiiaI almost forgot to ask one other question. Why derive classes as public? As in CCharacter : public CObject. What happens when you derive them private or protected? Again, sorry if this is a dumb question.

;-)

##### Share on other sites
Quote:
 Original post by snk_kidMaybe your using the wrong levels of abstraction, i see having CObject type which is the root of all types in a type hierarchy not very useful at all to be honest, it's to abstract to be put into any good use, you end up stuffing data and pushing functionality there where it doesn't actually make any sense.

I'm not sure what you mean. CObject represents a map based object. I don't see it as abstract at all. My point was to allow any number of map object types to be juggled around in all of my routines without ever really knowing or caring what is what. Most routines treat all map objects exactly the same, but their internal behavior is what makes them different.

Quote:
 Original post by snk_kidsolution look at the standard library bitset [www.sgi.com] and prefer using that instead.

Thanks, but templated classes make me rather ill. And I'm not sure how this would help me, as it is the concept I'm asking about, not bitflags.

##### Share on other sites
Quote:
Original post by snk_kid
Quote:
 Original post by JiiaBut protected is still very useful to include tasks for that class to run on itself. This really does make a lot of sense.

I'm not sure what your saying here.

If I may speak for Jiia, protected member functions are a possible way to implement callbacks. Example, you can publish a "MessagePump" framework class, and give it a protected virtual function OnIdle. The default implementation does nothing, but people may derive from "MessagePump" and implement their own version of OnIdle. The base class code will then call the derived function during its normal processing.

That being said, I wouldn't do anything this way anymore; I'd probably leave it to functors which would get registered with the class, and publish default functors with my nifty MessagePump.

##### Share on other sites
Quote:
Original post by Jiia
Quote:
 Original post by snk_kidMaybe your using the wrong levels of abstraction, i see having CObject type which is the root of all types in a type hierarchy not very useful at all to be honest, it's to abstract to be put into any good use, you end up stuffing data and pushing functionality there where it doesn't actually make any sense.

I'm not sure what you mean. CObject represents a map based object. I don't see it as abstract at all. My point was to allow any number of map object types to be juggled around in all of my routines without ever really knowing or caring what is what. Most routines treat all map objects exactly the same, but their internal behavior is what makes them different.

Probably calling it CObject may have miss-lead me. You get people having something like an Object type as root of all types in a hierarchy like in java & objective-c, i just dont think it's very useful to base a design on that because an Object is to abstract but thats not what your CObject type represents so don't worry.

##### Share on other sites
I think i should explain what i mean by to abstract to be derived directly from.

Say your problem domain is GUIs and you where focusing on implementing a hierarchy of widgets. Lets start with having a root type for these widgets say you already have an abstract type called Object you use for other problem domains, okay fine we sub-type are widgets from Object type.

Later on you discover that widgets need to implement some basic collision detection so you create a user-defined type that represents the concept of bounds and has an operation that can detect if two bounds have intersected. You've done that you relize that this functionality needs to be through-out the hierarchy of widgets so you end up puting a bounds data member in the Object type and an operation that allows querying/updating/testing etc on the bounds member.

There is one problem does it really make sense for the type Object to have bounds? that depends on which context object is in, the meaning of object is to abstract, it's ambiguous. A much better abstraction would be either to start with an abstract type called widget as the root type, or add a new abstract type derived from the object type also called widget where it makes sense to put a bounds member inside a widget type.

[Edited by - snk_kid on August 3, 2004 6:26:26 PM]

##### Share on other sites
Quote:
 Original post by JiiaThanks, but templated classes make me rather ill. And I'm not sure how this would help me, as it is the concept I'm asking about, not bitflags.

Sorry i wasn't paying much attention on that bit, well i'm bored at the moment so i'll read that bit a bit more closely.

Well you could provide an accessor function that is protected if it doesn't make sense for it to be in the type's interface e.g.

class CBitFlags;class CObject {    ...    CBitFlags   FStatus;    ...protected:    const CBitFlags& getFlags() const { return FStatus; }    CBitFlags& getFlags() { return FStatus; }public:    virtual ~CObject() {}};struct CCharacter : public CObject {   void TakeHealth(int value) {        HurtMe(value);        if(GetHealth() < 0)            getFlags().TurnOn(STATUS_DEAD);    }};

I know your probably thinking what difference does it make but this is just silly example of what can do.

##### Share on other sites
No, I don't derive everything from one type. Kind of pointless, really. CObject only has about 4 or 5 derived children.

In my opinion, GetFlags().TurnOn(STATUS_DEAD) is much uglier than having such protected member variables. Not to mention that functions need to be made to return every interface implimented.

In cases such as this, where the data itself is an interface, I don't understand the point of hiding the data in the first place. I'm not saying it's right, but I'm saying I don't understand why it's wrong.

I also find it nice to have sub-interfaces for related tasks, because it leaves the CObject class less cluttered. For example, I could have a very detailed vector class for force, which does its own bounds checking and updates it's own velocity. All objects can have force, but only characters apply forces to themself. So it only makes sense to allow them to access that interface. That, or privide routines specific to characters in the CObject class. But doesn't this go against your original CObject argument? To not provide extensive routines that are specific to only a single or few derived types? Yet again, I'm giving bad examples; I'm sure you understand what I mean, though.
Quote:
 If I may speak for Jiia, protected member functions are a possible way to implement callbacks. Example, you can publish a "MessagePump" framework class, and give it a protected virtual function OnIdle. The default implementation does nothing, but people may derive from "MessagePump" and implement their own version of OnIdle. The base class code will then call the derived function during its normal processing.That being said, I wouldn't do anything this way anymore; I'd probably leave it to functors which would get registered with the class, and publish default functors with my nifty MessagePump.

The HurtMe() function in my example is what I'm speaking of. HurtMe would be a CObject method, as all CObject types can be hurt. So why not have that as protected? I am the absolute master at dumb examples, but I hope the idea is clear.

##### Share on other sites
Quote:
 Original post by JiiaNo, I don't derive everything from one type. Kind of pointless, really. CObject only has about 4 or 5 derived children.In my opinion, GetFlags().TurnOn(STATUS_DEAD) is much uglier than having such protected member variables. Not to mention that functions need to be made to return every interface implimented.In cases such as this, where the data itself is an interface, I don't understand the point of hiding the data in the first place. I'm not saying it's right, but I'm saying I don't understand why it's wrong.

I'm sorry but like i said before that getFlags wasn't such good example to get the point across.

Think about it thou don't you think that having a data member protected is bit of a contridiction like i was saying in my first post above, by declaring a data member protected your implying that unrelated types/modules can't access but if you sub-type you can, if you do that it may aswell be public but then you need to make sure that the member never changes to avoid updating all other modules and re-compilling & the state invariant is maintained manually.

If the representation really is not going to change ever then make it public because making it protected is silly. Just remember thou that this makes it less extendable in the future but that doesn't mean it's a bad thing because to sub-type from certain concrete types would be plain dumb like sub-typing from the c++ standard library complex type.

So with that in mind i would say only

Quote:
 Originally by snk_kidencapsulate the variant/variation.

What do i mean there, well if a representation or even an interface varies statically/dynamically encapsulate it and provide a uniform interface that never changes. This is simillar to the Handle-Body idiom

This is the key to the abstract mechanism, to abstract complexity or variation.

##### Share on other sites
I don't see a big difference between an interface data member and a group of member functions. No data can be modified directly. But you still wouldn't always want outside code to be able to call functions of the interfaces, just as you wouldn't want them to be able to call member functions. You don't agree that this situation happens, often?

A) All or most derived types of the base class must perform a task the exact same way.

B) That task may be implimented in different situations / at different times for each derived type. The tasks may be proceeded and followed by other tasks unique to each type. ie: The base class does not know when the tasks must be executed.

C) No outside routines should ever be allowed to run the tasks, as it would screw up the whole flow of things.

If code is broken up properly, there should be quite a few medium sized functions and interfaces which perform individual tasks. Where do I put these functions and interfaces?

##### Share on other sites
Quote:
 Original post by JiiaI don't see a big difference between an interface data member and a group of member functions.

An interface type doesn't have any data members, or any implementation whats so ever (in C++ this would be class with no data members and all methods are pure virtual member functions, in java they have interface types, in objective-C there are protocol types). It just defines a protocol for two parties to participate & be able to communicate with each.

Then there is also the object/instance's interface which is something kind of different that would mean all it's public members.

I think that might the problem because when i was saying interface before i was using it to mean either depending on the context being used.

Quote:
 Original post by JiiaNo data can be modified directly.

Not sure what you mean, if you make it public, create an instance of that type you can access it directly your code becomes dependant/coupled tightly with it.

Quote:
 Original post by JiiaBut you still wouldn't always want outside code to be able to call functions of the interfaces, just as you wouldn't want them to be able to call member functions.

You've completely lost me here, what interface do you mean, an interface type or the inteface of an intance, it's public members that is.

Quote:
 Original post by JiiaYou don't agree that this situation happens, often?A) All or most derived types of the base class must perform a task the exact same way.B) That task may be implimented in different situations / at different times for each derived type. The tasks may be proceeded and followed by other tasks unique to each type. ie: The base class does not know when the tasks must be executed.C) No outside routines should ever be allowed to run the tasks, as it would screw up the whole flow of things.If code is broken up properly, there should be quite a few medium sized functions and interfaces which perform individual tasks. Where do I put these functions and interfaces?

I'm sort of lost wheather your last post was for or against this discussion.

##### Share on other sites
If an interface has no data members, then I didn't mean to suggest interfaces. I'm talking about encapsulated classes which are used to maintain specific data and perform specific tasks. They really only serve as an interface, since the class which uses them as data members could easily contain the data instead.

By no data can be directly modified, I'm talking about the individual sub-classes as above. Their data is private, and they do the work on it. The object which uses the class does not. The object which uses the class calls it's interface functions. The derived classes also need to work with the sub-classes. But sometimes, the outside code (outside of the base object's hierarchy altogether) should not be able to mess with it.

That doesn't make sense?

##### Share on other sites
How is this:
class Routine{public:  VOID DoMethod() { Data++; }private:  int Data;};class Object{public:  Routine  MyRoutine;};

Any different than this?
class Object{public:  VOID DoMethod() { Data++; }private:  int Data;};

The same data members are protected in the same way, are they not? Why is one right and one wrong?

##### Share on other sites
Quote:
 Original post by JiiaHow is this:*** Source Snippet Removed ***Any different than this?*** Source Snippet Removed ***The same data members are protected in the same way, are they not? Why is one right and one wrong?

Well it really depends on the requirements but there is alot of a difference the first version of type Object exposes it's interal representation no client (unrelated or related type/module) should know or care to know how it's representated. If any unrelated/related type/module uses that member and you decide to change it to the second version of type Object you will need to update all clients & recompile.

The second version of type Object is much better because every related/unrelated type/module rely on the interface, the "DoMethod" memeber that is. You could easily change the data member int data to the type Routine and not effect all clients, no recompile for the clients just for the type Object.

Another thing it's not just enough to maintain a state invariant in one type, all types should maintain there own state invariant if they have one.

##### Share on other sites
By the way if you do this:

class Routine {public:  Routine(int i = 0): data(i) {}  Routine(const Routine& r): data(r.data) {}  Routine& operator=(const Routine& r) {     if(this != &r) {        data = r.data;      }      return *this;  }  void do_method() { ++data; }private:  int data;};class Object {  Routine*  my_routine;public:  Object(int i = 0): my_routine(new Routine(i)) {  }  Object(const Object& o): my_rountine(new Routine(o.r)) {}  Object& operator=(const Object& o) {     if(this != &o) {        delete my_routine;        my_routine = new Routine(o.r);     }     return *this;  }  void do_method() {  my_rountine->do_method(); }  ~Object() {  delete my_rountine; }};`

If you look at the do_method in type Object this is form of and known as delegation and is a powerful technique.

##### Share on other sites
Quote:
 Original post by snk_kidWell it really depends on the requirements but there is alot of a difference the first version of type Object exposes it's interal representation no client (unrelated or related type/module) should know or care to know how it's representated. If any unrelated/related type/module uses that member and you decide to change it to the second version of type Object you will need to update all clients & recompile.

I'm still a little lost. What do you mean by "second version of type Object"? The only thing Object type is exposing is the name of the interface, eg "MyRoutine". Any external routines would simply ObjectType.MyRoutine.DoMethod(); How is this any different than ObjectType.MyRoutine()? I don't see any more danger in the "MyRoutine" variable name changing than the DoMethod() name. I could just as easily want to rename the MyRoutine() function into YourRoutine(). Everything still needs to be updated. The routine class respresents an entire set of common tasks, and in my opinion, is no different than a set of functions. Except that it is much more organized, easily managed, because all related methods and data's are grouped into one sub-object.

Unless you're talking about the fact that you can overload DoMethod() in derived types, but can't really do so, easily, with the Routine class member. If so, in my case I know that these routine classes will not be overloaded.

Quote:
 Original post by snk_kidThe second version of type Object is much better because every related/unrelated type/module rely on the interface, the "DoMethod" memeber that is. You could easily change the data member int data to the type Routine and not effect all clients, no recompile for the clients just for the type Object.

The data member is very specific to the Routine class. It would never change unless the Routine class itself needed to change. In which case, there would be little difference in your above example. I just modify the Routine class data member, and not effect all clients, no recompile for the clients, just for the types Routine & Object.

Let me know if I'm totally missing the point.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628305
• Total Posts
2981939

• 9
• 11
• 11
• 11
• 10


text:
# Where to find others with Prusa3D i3m3s/MMU2s printer?

I don't want to ask off-topic and opinion questions here, but I would like to find a cadre of others dialing in their devices. Any ideas?

– Mick
Apr 22 '19 at 21:18
• HI, I migrated the question to meta, I hope that you understand why. :-) BTW, What do you mean by dialing in their devices exactly? Do you mean comparing their printers and posting pix? Or something else? @Starwind has a (large?) Facebook group, he might know more...? I don't have a Facebook account (left it years ago) so I don't know anything about that...
– Greenonline Mod
Apr 22 '19 at 22:03
• I thought I had written it on meta. I wonder what I did wrong? It is totally not a main group question.
– cmm
Apr 22 '19 at 22:46
• @greenline I'm not sure what word is used in the Prusa community. I mean going through the process of tweaking this and that to improve the reliability. There is data in support of the mmu2 being a great addition, but at the moment I have a user interaction rate of about 5-7%. With 100 changes, I have to intervene on about 6 of them.
– cmm
Apr 22 '19 at 22:50
• @Mick Thanks for the reference to the Facebook group. I'm waiting for a moderator to approve my join request.
– cmm
Apr 23 '19 at 18:09
• Ah tweaking, now that's a word I can understand... gotcha :-)
– Greenonline Mod
Apr 24 '19 at 18:01

I stumbled across this forum/group, Original Prusa i3 MMU2S & MMU2, amongst all of the other Prusa printers forums on the Prusaprinters blog, which seems fairly active.

In particular, the User mods - OctoPrint, enclosures, nozzles, ... page seems like it might be what you are looking for.

There is a lot of activity on Reddit related to 3D printing and the Prusa printers.


text:
# Simple question

This topic is 4924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How can a bitwise constant be placed in ROM? THX!

##### Share on other sites
Fist: What is bitwise constant? There are bitwise operators and constants...

Second: It's only operating system's good will to place something in ROM. However - if it sees some good candidate for being in ROM, there's a change it will be placed in ROM.

Oxyd

##### Share on other sites
Why should it matter where it's at?

##### Share on other sites
Yeah, there's something a bit weird about wanting to put bitwise constants in ROM. Are you wanting it in ROM to write protect it? Because if you are, most languages provide constant variables that you can't write to after you set them (well, you can, but it's a complete hack).

You'll need to give a bit more detail if you want to get some help here.

-Auron

##### Share on other sites
Wait, you can't write to ROM, can you? Unless he's talking about a CD rom.

##### Share on other sites
Simple question alright. So simple nobody has a freakin clue what the hell you are talking about!
Start from the absolute beginning. What are you writing?

##### Share on other sites
Quote:
 Original post by Kelly GWait, you can't write to ROM, can you? Unless he's talking about a CD rom.

Well, you can, kind of... but I HIGHLY doubt that he's getting at anything like erasing the OS from the ROM on a console or something.

Then again...

-Auron

##### Share on other sites
Sorry ,i was out for a while,this is what i've found in a book
ROMability
If an object is defined as const, it is a candidate to be placed in read-only memory (ROM), which is often an important consideration in embedded systems programming. Simply making an object const, however, is not enough – the requirements for ROMability are much stricter. Of course, the object must be bitwise-const, rather than logical-const. This is easy to see if logical constness is implemented only through the mutable keyword, but probably not detectable by the compiler if constness is cast away inside a const member function. In addition,

The class or struct must have no user-defined constructors or destructor.
There can be no base classes (covered in Chapter 14) or member objects with user-defined constructors or destructors.
The effect of a write operation on any part of a const object of a ROMable type is undefined. Although a suitably formed object may be placed in ROM, no objects are ever required to be placed in ROM.

It should be more clear now!

##### Share on other sites
Guys i know this is sick but i really want an answer the excerpt i gave you seems strange indeed.[lol]

##### Share on other sites
Quote:
 Original post by DaosSorry ,i was out for a while,this is what i've found in a bookROMabilityIf an object is defined as const, it is a candidate to be placed in read-only memory (ROM), which is often an important consideration in embedded systems programming. Simply making an ...a ROMable type is undefined. Although a suitably formed object may be placed in ROM, no objects are ever required to be placed in ROM.It should be more clear now!

If you're working with embedded systems, sure, place the constant within the E(E)PROM memory, why waste good (often limited in embedded systems) RAM on something that is already defined? As for specifically a bit-wise constant, unless you're talking about a flag bit (in a bitmap arrangement with other flags) you could, but you'd waste the other 7 bits within that space...

>shrug<

Is this for an embedded project?

##### Share on other sites
Not really or i don't know i was just curios!I'm not a native English speaker so i don't have any slim clue about "embeded systems "my Webster dictionary does'n give me any idea[lol]and this is where the confusion comes from.
Thx!

##### Share on other sites
Embedded systems are systems where the operating system is embedded into a ROM chip on the hardware. Pretty much any computer that isn't a desktop or notebook is going to be an embedded system. This means most PDAs, cell phones, consoles (like the PS2 or Gameboy) and so on.

I can't say as I understand their little spiel about bitwise versus logical const either, and English is my first language, so don't feel bad.

But it seems to be saying that if you want to ensure that certain constant data is going to be placed in ROM, you're going to have to do a bit more than put "const" in front of it.

-Auron

##### Share on other sites
C++ on embedded systems? is nothing sacred? but seriously, const was designed for addressing the problems with C's #define statement. one of the fixes involves actually allocating memory (RAM) for the constant. i would think that most compilers would allocate for const everytime, but if they are for embedded systems some may support a compiled const. since this is just for your curiosity and learning, i wouldn't worry too much about this, and Read The Manual for your compiler when it becomes important. other than that #define will never allocate memory and should work fine.

##### Share on other sites
Quote:
 Original post by anist[snip/]but seriously, const was designed for addressing the problems with C's #define statement.

Correction: #define is not a C statement - it's a pre-processor directive and thus not part of the C language.
Quote:
 one of the fixes involves actually allocating memory (RAM) for the constant.

Pardon?
const is a language construct (type-qualifier) that provides a semantic for expressing a constant (read: non-modifiable piece of information). period. Whether this information is allocated in RAM or ROM is context sensitive and thus up to the compiler.
E.g.
const int answer = 42;
will never allocate RAM, it's basically the same as
#define answer 4
Quote:
 i would think that most compilers would allocate for const everytime, but if they are for embedded systems some may support a compiled const.


text:
# Programmatic Mathematica XV: Lucas Numbers

The Lucas sequence follows the same rules for its generation as the Fibonacci sequence, except that the Lucas sequence begins with t1 = 2 and t2 =1.

Lucas numbers are found in the petal counts of flowing plants and pinecone spirals much the same as the Fibonnaci numbers. Also, like the Fibonacci numbers, successive pairs of Lucas numbers can be divided to make the Golden Ratio, $\phi$. The Mathematica version (10) which I am using has a way of  highlighting certain numbers that meet certain conditions. One of them is the Framed[] function, which draws a box around numbers. Framed[] can be placed into If[] statements so that an array of numbers can be fed into it (using a Table[] command).

For example, let’s frame all Lucas numbers that are prime:

In[1]:= If[PrimeQ[#], Framed[#], #] & /@ Table[L[n], {n, 0, 30}]

The If[] statement is best described as:

If[Condition[#], do_if_true[#], do_if_false[#]]

The crosshatch # is a positional parameter upon which some condition is placed by some function we are calling Condition[]. This boolean function returns True or False. In the statement we are using above, the function PrimeQ will return true if the number in the positional parameter is prime; false if 1 or composite.

The positional parameters require a source of numbers by which to make computations, so for this source, we shall look to a sequence of Lucas numbers generated by the Table command. The function which generates the numbers is a user-defined function L[n_]:

In[2]:= L[0] := 2 In[3]:= L[1] := 1 In[4]:= L[n_] := L[n-2] + L[n-1]

With that, I can generate an array with the Table[] command to get the first 31 Lucas numbers:

In[5]:= Table[L[n], {n, 0, 30}] {2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, \ 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, \ 271443, 439204, 710647, 1149851, 1860498}

This list (or “table”) of numbers is passed through the If[] statement thusly:

In[6]:= If[PrimeQ[#], Framed[#], #] & /@ Table[L[n], {n, 0, 30}]

to produce the following output:

In[7]:=

Note that this one was an actual screenshot, to get the effect of the boxes. So, these are the first 31 Lucas numbers, with boxes around the prime numbers. The Table[] command appears to feed the Lucas numbers into the positional parameters represented by #.

There was a sequence I created. Maybe it’s already famous; I have no idea. On the other hand, maybe no one cares. But I wanted to show that with any made-up sequence that is recursive in the same way Fibonacci and Lucas numbers were, that I could show, for example, that as the numbers grow, neighbouring numbers can get closer to the Golden Ratio. The Golden Ratio is $\phi = \frac{1 + \sqrt{5}}{2}$. I want to show that this is not really anything special that would be attributed to Fibonacci or François Lucas. It can be shown that, for any recursive sequence involving the next term being the sum of the previous two terms, sooner or later, you will always approach the Golden Ratio in the same way. It doesn’t matter what your starting numbers are. In Lucas’s sequence, the numbers don’t even have to begin in order. So let’s say I have:

K[0] := 2 K[1] := 5
K[n_] := K[n-2] + K[n-1]

So, just for kicks, I’ll show the first 31 terms:

Table[K[n], {n, 0, 30}] {2, 5, 7, 12, 19, 31, 50, 81, 131, 212, 343, 555, 898, 1453, 2351, \ 3804, 6155, 9959, 16114, 26073, 42187, 68260, 110447, 178707, 289154, \ 467861, 757015, 1224876, 1981891, 3206767, 5188658}

Now, let’s output the Golden Ratio to 15 decimals as a reference:

N[GoldenRatio, 15] 1.61803398874989

Now, let’s take the ratio of the last two numbers in my 31-member sequence:

N[K[30]/K[29], 15] 1.61803398874942

You may say that the last two digits are off, but trying against the Fibonacci sequence, the ratio of the 30th and 31st numbers yields merely: 1.61803398874820, off by 3 digits.

For Lucas: 1.61803398875159, off by 4 digits — even worse.

So, my made-up sequence is more accurate for $\phi$ than either Lucas or Fibonacci. I have tried other made-up sequences. Some are more, and some are less accurate. If it depends on the starting numbers, I think some combinations work better, and you won’t necessarily get greater accuracy by starting and ending with larger numbers.


text:
# Question #9cda7

Oct 13, 2016

$y = 3 x - 1$

#### Explanation:

We will use the following properties of exponents and of logarithms:

• ${a}^{- x} = \frac{1}{a} ^ x$
• ${\left({a}^{x}\right)}^{y} = {a}^{x y}$
• ${a}^{x} \cdot {a}^{y} = {a}^{x + y}$
• ${\log}_{a} \left({a}^{x}\right) = x$

With those

${3}^{y} / {27}^{x} = \frac{1}{3}$

$\implies {3}^{y} / {\left({3}^{3}\right)}^{x} = {3}^{- 1}$

$\implies {3}^{y} / {3}^{3 x} = {3}^{- 1}$

$\implies {3}^{y} = {3}^{3 x} \cdot {3}^{- 1}$

$\implies {3}^{y} = {3}^{3 x - 1}$

$\implies {\log}_{3} \left({3}^{y}\right) = {\log}_{3} \left({3}^{3 x - 1}\right)$

$\therefore y = 3 x - 1$


text:
Vol. 6, No. 4, 2012

 Recent Issues
 The Journal About the Journal Editorial Board Editors’ Interests Subscriptions Submission Guidelines Submission Form Policies for Authors Ethics Statement ISSN: 1944-7833 (e-only) ISSN: 1937-0652 (print) Author Index To Appear Other MSP Journals
Degeneracy of triality-symmetric morphisms

Dave Anderson

Vol. 6 (2012), No. 4, 689–706
Abstract

We define a new symmetry for morphisms of vector bundles, called triality symmetry, and compute Chern class formulas for the degeneracy loci of such morphisms. In an appendix, we show how to canonically associate an octonion algebra bundle to any rank-$2$ vector bundle.

Keywords
degeneracy locus, triality, octonions, equivariant cohomology
Mathematical Subject Classification 2010
Primary: 14M15
Secondary: 14F43, 14N15, 20G99, 17A75


text:
# News Doe v Reed

1. Jun 25, 2010

### BobG

The Supreme Court released their decision on http://www.supremecourt.gov/opinions/09pdf/09-559.pdf and found that releasing the names of the people that sign ballot initiative petitions does not violate their First Amendment Rights.

The case:

The state of Washington passed a law (Senate Bill 5688) expanding the rights and responsibilities of state-registered domestic partners, including same-sex domestic partners. In response, a group called Protect Marriage Washington started a petition drive to put a bill on the ballot to repeal SB 5688. The group obtained enough signatures to get the initiative put on the ballot, which prompted several groups, including Washington Coalition for Open Government (WCOG) and Washington Families StandingTogether (WFST). Two entities, WhoSigned.org and Know-ThyNeighbor.org, issued a joint press release stating their intention to post the names of the petition signers online, in a searchable format - the purpose being to allow the public to engage signers in a debate on the merits of the underlying law (i.e. - engage in the same harrassment tactics that occurred in California in response to Proposition 8). The petition sponsor and several (anonymous) signers sought to prevent the public release of the petitions for obvious reasons.

The first problem with this case is that the petition sponsors included 2 counts in their motion. The first was that the Public Release Act requiring release of the signatures was unconstitutional when applied to referendum petitions. The second was that release “is unconstitutional as applied to the Referendum 71 petition because there is a reasonable probability that the signatories . . . will be subjected to threats, harassment, and reprisals.” This gave the petition sponsors two bites at the apple, since if they lost on the general Count I, they still had a chance to prevent release on their particular petition in Count II.

The lower court agreed with Count I, making it unnecessary to rule on Count II. Groups desiring release appealed the decision, with it winding up in the USSC. Even Alito acknowledges that the signors should be able to gain exemption from the PRA for their specific petition, given that groups requesting the signatures make no secret of what they intend to do with them once they obtain them (Alito concurrence, page 21). Unfortunately, the only decision to appeal or the USSC to decide is the more general Count I.

But, the case does raise some questions about First Amendment rights, the rights of petition signors, and the use of secret ballots in elections.

As Scalia noted (page 6 of his concurrence), there is no right to a secret ballot in elections, nor is there a right to secrecy in signing referendum petitions.

Best of all are Scalia's closing comments:

While the decision rejects the idea that the Public Records Act is unconstitional in its requirement that petition signatures be released to the public, it does note that there is no constitutional requirement to release the names, either, meaning the proper remedy is to amend the PRA to exempt petition signatures from public release.

Last edited by a moderator: Apr 25, 2017
2. Jun 25, 2010

### turbo

We are having a related tussle here in Maine, currently.

http://www.onlinesentinel.com/news/state-housepanel-rejects-call-to-end-marriage-money-probe_2010-06-24.html [Broken]

The National Organization for Marriage dumped over $2M into this little state to push a peoples' referendum that would overturn Maine's new same-sex marriage law. By law, if a group spends over$5K in an election, they are required to file financial disclosures with the state identifying the donors. NOM did not file such a disclosure, and is now stonewalling the ethics committee that is reviewing its activities, refusing to release the identities of donors.

Last edited by a moderator: May 4, 2017
3. Jun 25, 2010

### BobG

NOM will lose based on the Citizen's United case and the Doe v Reed case.

This just raises the whole question of how politics is conducted (campaign contributions, petition signings, secret ballot in elections, reliable voting machines) all over again. The issue needs to be addressed as a whole, in light of today's environment, and in a way that would pass constitutional muster.

The idea that politics should wind up reverting back to abuses similar to those that brought on the secret ballot, except with more sophisticated tools, is just a bizarre outcome.

Last edited by a moderator: May 4, 2017
4. Jun 25, 2010

### TheStatutoryApe

The point of a petition is that you are putting your voice behind a particular bit of legislation. Instead of walking into the public forum yourself you are putting your name to a petition that is to be placed before the public forum. The documents are handed over to the state, the names are to be verified, and the petition is a matter of public record. Anonymity would seem to be anathema to the whole idea.

I would support withholding private information which is only used for verification by the state but the names at least should stand. If they wish to remain anonymous they can write private letters to their elected officials.

5. Jun 25, 2010

### Ygggdrasil

This is why we have harassment laws. Don't throw the baby out with the bathwater.

6. Jun 25, 2010

### BobG

Is there some particular service that's provided by releasing the names?

Votes of legislators should never be secret, because they're hired to represent others. So Scalia's view that a petition signer is acting as a legislator just doesn't hold water. The person signing a petition is representing only himself.

(During oral arguments, the side saying the names should be released claimed it provided important demographic information on supporters of the bill, such as religion, political affiliation, etc, - all info that would not be on a petition, but I guess it's information that a technologically savvy person might be able to obtain if they had your name and address.)

7. Jun 25, 2010

### drankin

Personally, I'm all for voting and petitioning to be a completely public act. It's the release of phone numbers and addresses that doesn't settle well with me.

8. Jun 25, 2010

### aquitaine

Yet another rape of our democracy.......

9. Jun 25, 2010

### TheStatutoryApe

The service of the document in fact being a petition. So the state receives a document. It says that it is a petition. Can we see the document? Well maybe after we alter it. Who is it that is petitioning? Sorry, can't tell you that.

10. Jun 25, 2010

### turbo

We have had a number of well-documented cases of fake petitions (altered, fake petition signers, dead people, etc) since the trend toward "citizens' referendums" took off in Maine ~5 years or so ago. If you have enough money to organize a petition drive (not hard in a thinly-populated state like Maine) and then dump money from out-of-state donors into the election process, you can easily hijack our state government and alter our laws. We need transparency in both areas - BADLY!

In a related wrinkle in the same issue, the Catholic Archdiocese of Portland joined the National Organization for Marriage to get out the petition-drive AND dumped a pile of money into the election ads and we are not sure where all that money came from. The largest holder of tax-exempt properties in most areas of this state is the Catholic church. I believe strongly in the separation of church and state, but on this issue, the church way overstepped some lines IMO. A well-crafted suit challenging the church's anti-gay activism would go a long way to clarifying whether they should retain their tax-free status or register as lobbyists and pay taxes.

Last edited: Jun 25, 2010
11. Jun 25, 2010

### BobG

There's a difference between making the petition available for verification of signatures and publishing a searchable database of all the signers on the internet.

You can do the first by allowing anyone to view the petitions for as long as they need within the building the petitions are kept in, but not allowing any reproduction (either by copier or camera) or scanning of the documents, nor allowing the petitions to be removed.

The point is that advances in technology make it important to find a balance between public access and protection of those exercising their right to participate in their government.

12. Jun 25, 2010

### TheStatutoryApe

I certainly agree that private information should be kept private. The government should not have the ability to publish the phone numbers and addresses of individuals for any reason. Even the sex offender list seems to go too far in my opinion.

13. Jun 26, 2010

### BobG

The address has to be on the petition so you can verify the person signing even resides in the affected area (more applicable to petitions for city, county issues than state issues) and so verifiers can determine whether you're actually registered to vote (especially if you have a common name). It's just that that info shouldn't be published on the internet.

There should be at least one difficult step between viewing the petitions and publishing them on the internet, plus penalties for posting them on the internet if a person somehow overcomes the difficult step. Not foolproof, but it at least provides the likelihood that a person can take part in their government without being harassed at their home.

The two organizations attempting to obtain and publish the signers of the petition in this case make their intent very public ahead of time. It's important to them for the public to know they'll repeat those actions for any petition they disagree with. They don't even to have to harass that many signers for their desired aim - intimidation - to be successful.


text:
# Changes to LaTex processor

Document created by Mark Wittervan on Jun 8, 2017
Version 1Show Document

There was recently a change to the LaTex processor within Canvas, they rolled out a new LaTeX processor (Mathman), to replace the old one (CodeCogs). It has the advantage of giving us much crisper images (svg vs gif) as well as much better MathML (which is read by screenreaders, meaning math content is more accessible now than it was previously). It has the disadvantage of not supporting a couple of the LaTeX commands that CodeCogs supported, so a small percentage of equations now render differently. Unfortunately, CodeCogs does not have a comprehensive list of LaTex commands that it supports, so finding out which ones are no longer available is more of a trial and error thing. Here is a list of the commands supported by Mathman, which uses mathjax:

http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands


text:
If there are 2.50xx10^18 lead atoms, what is the mass of this quantity?

Jun 12, 2017

Isn't a $\text{ream}$ a quantity of paper, i.e. 480 or 500 individual sheets?

Explanation:

I don't know the mass of a ream of lead, and I have never heard of lead being measured with this quantity.

But the number of atoms of any elemental quantity is $\text{Number of moles "xx" Molar mass}$, where a $\text{mole}$ specifies $\text{Avogadro's Number}$, $6.022 \times {10}^{23} \cdot m o {l}^{-} 1$.

And thus if there were $2.50 \times {10}^{18}$ lead atoms........we have a mass of..........

$\left(2.50 \times {10}^{18} \cdot \cancel{\text{lead atoms")/(6.022xx10^23*cancel"lead atoms}} \cdot \cancel{m o {l}^{-} 1}\right) \times 207.2 \cdot g \cdot \cancel{m o {l}^{-} 1}$

$\cong 1 \cdot m g$

Jun 12, 2017

I'm not quite sure how much lead you have but this is how to calculate the number of atoms:

$N = n \cdot {N}_{A}$

Where:

$N = \text{number of atoms}$

${N}_{A} = {\text{Avogadro constant"=6.02*10^23" mol}}^{-} 1$

$n = \text{mass"/"molar mass}$

$\text{molar mass of lead"=207.2" g/mol}$

${N}_{A}$ is a constant and is the number of atoms in one mole of any substance. So if you have $n = 2 \text{ mol}$, you have $2 \cdot {N}_{A}$ atoms.

As an example, if you have $2.50 \cdot {10}^{18}$ grams of lead, you have this many atoms:

$n = \frac{2.50 \cdot {10}^{18}}{207.2} = 1.21 \cdot {10}^{16} \text{ mol}$

$N = n \cdot {N}_{A} = 1.21 \cdot {10}^{16} \cdot 6.02 \cdot {10}^{23} = 7.28 \cdot {10}^{39} \text{ atoms}$

This is a lot of lead!


text:
Under the auspices of the Computational Complexity Foundation (CCF)

REPORTS > KEYWORD > HARDCORE SETS:
Reports tagged with Hardcore Sets:
TR08-103 | 22nd November 2008
that if $D$ is a distribution over $\{ 0,1\}^n$ of min-entropy at least $n-k$,
then for every $S$ and $\epsilon$ there is a circuit $C$ of size at most