! ( True || False) evaluates to False.
! ( ( true || false) && false ) evaluates to True.
But why is that?
I was reading jumping into C++ and there were some examples of boolean expressions. Can someone help me out?
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
MiyaviTeddy
Canada697 Posts
! ( True || False) evaluates to False. ! ( ( true || false) && false ) evaluates to True. But why is that? I was reading jumping into C++ and there were some examples of boolean expressions. Can someone help me out? | ||
Craton
United States17250 Posts
not true = false (true or false) = true (true) && false = false not false = true | ||
CecilSunkure
United States2829 Posts
On January 10 2013 13:31 MiyaviTeddy wrote: I have a quick question about boolean expression: ! ( True || False) evaluates to False. ! ( ( true || false) && false ) evaluates to True. But why is that? I was reading jumping into C++ and there were some examples of boolean expressions. Can someone help me out? ! ( ( true || false) && false ) evaluates to True. >> ! ( ( true || false) && false ) >> ! ( ( true) && false ) >> ! ( false ) >> true | ||
![]()
tofucake
Hyrule19083 Posts
http://en.wikipedia.org/wiki/Boolean_algebra | ||
tec27
United States3701 Posts
On January 09 2013 23:28 fabiano wrote: Hello, I've found myself coding a lot of PHP lately and I've been wondering what is a better practice: [1] Leave all the PHP processing code before the <html> and postpone the print/echo of the results of that processing + Show Spoiler + ![]() or [2] Leave the PHP processing entangled in the html as needed + Show Spoiler + ![]() Note that the example code is simple, but I mean what would be preffered when we are dealing with much larger scripts? Personally I find [1] to be much more readable, while theorically [2] should be more efficient. Is there a coding standard or do programmers just code as they please? R1CH, by your wizardry powers, if you are reading this, what do you recommend? Ideally you should separate the complex logic out from the display logic. You do the complex logic in its own part, build a set of data to pass to the display part, then in the display part you intertwine the *simple* logic with the display. This gives you an MVCish setup that will likely be easier to maintain and understand (and in this case, example 1 is basically doing that). As for what R1CH would recommend, he'd probably recommend not using PHP ![]() | ||
Azerbaijan
United States660 Posts
I hate VS 2012 and windows in general lately. | ||
artynko
Slovakia86 Posts
However I would not recommend to use EMACs unless you really have to (i.e. you do erlang) Eclipse is a far better option in most cases or vim is sufficient for the extra trivial stuff | ||
Nimelrian
Germany142 Posts
On January 09 2013 08:51 NukeTheBunnys wrote: Im looking to do some c++\openGL game related programming. Does anyone have any suggestions for a cross platform library (or libraries) that can do windowing, input, and sound. And before someone says I should use an engine like Unity, or a different language - half the point of doing this is I'm interested in the low level game systems like managing the input/threading/audio streams Windows APIs (not multi-platform, but oh well - I can encapsulate the code anddeal with porting the code if I ever want to port it) SDL - started working with it but had some troubles getting it set up on windows and visual studio, but otherwise it looks like it would meet all my desires. Allegro - can be used with openGL, but the documentation of using allegro with openGL (2d or 3d) is pretty sparse I have also considered using openAL for 3d positional sound, but that will likely come after I get some of the other systems working Anyone have other suggestions, or experience with the mentioned libraries. Check out the SFML http://www.sfml-dev.org/ (Use 2.0, not 1.6, it's basically outdated) | ||
tec27
United States3701 Posts
On January 10 2013 19:11 artynko wrote: You can pick any EMACs tutorial from google for the basic stuff (the first search hit is decent), but the power of emacs comes with all the plugins which depend on the language you want to use. Once you understand buffers and remember the shortcuts you should be set to go. However I would not recommend to use EMACs unless you really have to (i.e. you do erlang) Eclipse is a far better option in most cases or vim is sufficient for the extra trivial stuff I'm not sure why you would suggest that emacs isn't worth it but then suggest he use vim for 'trivial stuff'. Vim and emacs are essentially on par in terms of both power and learning curve, and I wouldn't suggest either of them for trivial editing (unless, of course you've already invested time to learn them for other reasons, in which case you probably already use one of them for everything anyway ![]() As for learning resources for emacs, I can't really help much as I use vim, but I just want to say that its well worth the time investment to learn vim or emacs | ||
phar
United States1080 Posts
| ||
Frigo
Hungary1023 Posts
On January 11 2013 16:36 phar wrote: Either one is a godsend when you end up having to code something quick over a spotty remote connection. Or you know, you could just code it on localhost and upload it. | ||
Chairman Ray
United States11903 Posts
| ||
phar
United States1080 Posts
On January 12 2013 02:21 Frigo wrote: Show nested quote + On January 11 2013 16:36 phar wrote: Either one is a godsend when you end up having to code something quick over a spotty remote connection. Or you know, you could just code it on localhost and upload it. Not if you're not allowed to code locally. | ||
JeanLuc
Canada377 Posts
On January 12 2013 06:24 Chairman Ray wrote: Has anyone worked with Google Maps api or any other street maps? I'm trying to create a tower defense game, but instead of making levels myself, the user will be able to select a location somewhere, and it will generate a level based off the roads (one ways and overpasses will work as intended). Has anyone had any experience with this kinda thing? seems like a cool idea, but I think taking the map and interpreting it into a tower defence level should be more difficult than learning the google maps api | ||
ObliviousNA
United States535 Posts
On January 12 2013 06:24 Chairman Ray wrote: Has anyone worked with Google Maps api or any other street maps? I'm trying to create a tower defense game, but instead of making levels myself, the user will be able to select a location somewhere, and it will generate a level based off the roads (one ways and overpasses will work as intended). Has anyone had any experience with this kinda thing? The only way I know to access the Google Maps data is through their javascript API. In this case, you're using their API to access raster/image data rather than vector data. Hence, it would be very difficult to resolve that into some kind of Tower Defense path. It might be possible for you to grab these tiles and do static image analysis to look for white pixels and call these 'creep paths', but that's iffy at best. A better approach is to get the vector data defining different streets. This is what OpenStreetMap provides, and it's also royalty free. http://www.openstreetmap.org/ Complex task, but if you're serious I would take a look at their data/API | ||
FFGenerations
7088 Posts
Here's the PM I sent with details heya, im coming into more stupid problems. everyone else is just doing a stupid no relationship 1-table database because its only worth 15 marks and you just need to make a form which adds, deletes and updates (edit) a record on the form. but im pretty close to doing it this way.. i have a Main form, which displays the full record (items from tables Person, Email, Association, HomeNo and MobileNo). it displays all of those things at once. however, this form suffers from a similar problem as the previous AddNewPersonDetails form, in which i had to use your trick to update the related tables alongside the "parent" Person table. i want to be able to Update (edit) and Delete a record shown on this form, but the form gives an error message when I try this using a Wizard button (or simply try pressing delete on keyboard): "This Recordset is not updateable" (in the taskbar) or "Records can't be deleted from this form." (popup msg). i looked at using a Query to allow a user to update a record but i doubt this is the right way to do it (and i have no idea how to turn a form into a query, if thats what you're supposed to do, but i can find out by looking up queries and how they work). i looked at the data tab of the form's property sheet and things like (allow) Data entry and Allow edits are set to Yes. I would be open to the idea of dumping my forms altogether if i could use a subform which displays all 5 tables info at once but the wizard only seems to give 1 subform. there is clearly a "proper" way to do what i'm doing. Another idea is having an Edit form on which you can first select a Person and then choose to navigate to individual Email, HomeNo and MobileNo forms - which would display only those things and therefore not be screwed up by the problem - and update those individually. i think this would work but it might be unecessarily long-winded (meaning it'd take me an unecessary time to figure out because i'm clueless and would probably have to ask for help again). the final option is to start again, make a 1-table database in 5 minutes, add the buttons with the wizard and stop wasting time on this -.- i've uploaded the database again, remember to enable it if the warning pops up. many thanks, http://www.sendspace.com/file/iu09bi TLDR - my Main form doesn't allow editing/deleting and all I want to do is add an Update and Delete button . i dont have to have a relational database to get top marks but it'd be nice to see why its not working more clearly before i move on | ||
lannisport
878 Posts
#footer-cart { position:fixed; top: 93%; left: 70%; } Now when people add an item to the cart I want it to expand vertically, since it's fixed on the bottom. I also have the cart on the non home page where it's fixed to the sidebar and when items are added it expands downwards naturally. | ||
tec27
United States3701 Posts
On January 14 2013 07:26 lannisport wrote: I hope it's kosher to ask HTML related questions here. I can't figure out this seemingly simple problem where I have a div that is fixed to the bottom right of the page (where there is a shopping cart widget from WordPress). So the CSS is #footer-cart { position:fixed; top: 93%; left: 70%; } Now when people add an item to the cart I want it to expand vertically, since it's fixed on the bottom. I also have the cart on the non home page where it's fixed to the sidebar and when items are added it expands downwards naturally. If you want it fixed to the bottom-right, you should probably be using the bottom and right attributes, instead of top and left, IE: #footer-cart { | ||
lannisport
878 Posts
On January 14 2013 07:32 tec27 wrote: Show nested quote + On January 14 2013 07:26 lannisport wrote: I hope it's kosher to ask HTML related questions here. I can't figure out this seemingly simple problem where I have a div that is fixed to the bottom right of the page (where there is a shopping cart widget from WordPress). So the CSS is #footer-cart { position:fixed; top: 93%; left: 70%; } Now when people add an item to the cart I want it to expand vertically, since it's fixed on the bottom. I also have the cart on the non home page where it's fixed to the sidebar and when items are added it expands downwards naturally. If you want it fixed to the bottom-right, you should probably be using the bottom and right attributes, instead of top and left, IE: #footer-cart { .... bottom:0; seemed to do it O_O I thought that somehow helped what I was already trying (floating each of the li elements thats dynamically added to the div and putting a clear:div at the bottom) but I took all that out and it still worked.... THANKS A MILLION. | ||
![]()
tofucake
Hyrule19083 Posts
| ||
| ||
![]() |
CranKy Ducklings
RSL Revival
GuMiho vs Cham
ByuN vs TriGGeR
Cosmonarchy
TriGGeR vs YoungYakov
YoungYakov vs HonMonO
HonMonO vs TriGGeR
Maestros of the Game
Solar vs Bunny
Clem vs Rogue
[BSL 2025] Weekly
OSC
RSL Revival
Cure vs Bunny
Creator vs Zoun
Maestros of the Game
Maru vs Lambo
herO vs ShoWTimE
BSL Team Wars
Team Hawk vs Team Sziky
Sparkling Tuna Cup
[ Show More ] Monday Night Weeklies
The PondCast
Online Event
BSL Team Wars
Team Bonyth vs Team Dewalt
BSL Team Wars
|
|