Showing posts with label comment. Show all posts
Showing posts with label comment. Show all posts

Wednesday, 14 September 2016

Xcode 8 notes

Just installed Xcode 8. Let's see what Apple have in store. Nervous about installing Xcode as anything pre 7.x was a patchy. The 4-5 series were just alphas and should never have replaced 3.x.

First thing noticed, the font has changed! Ok, we'll roll with that. GUI looks largely the same. Try some editing: comment in/out shortcut not working.

Fixing comment shortcut

Other users having same problem in the betas. Fix kudos to Chris Hanson from Twitter. From terminal:
sudo /use/libexec/xpccachectl
And you have to restart your Mac. Just log out/in won't work.

I think plug-ins are used in Xcode 8. XPC appears to be an IPC protocol, part of Grand Dispatch. So I guess this is how the plug-ins talk to Xcode. Ok so that looks fixed.

Still no column display

For something that claims to be a source code editor, it is pretty strange that the column number isn't displayed anywhere. You can get line number from the sidebar, but not column, which is useful for commenting and layout. Will update issue ticket for this.


Wednesday, 31 August 2016

Ponder Design Review


Review of  function features

The Ponder library is a fork of CAMP and takes its design decisions from there. The biggest change was the removal of Boost, which should leave the functionality of the API unchanged.

CAMP has some interesting features, e.g. in Function we can assign a function callback to test whether a function is currently callable.

  /**
   * \brief Set the callable state of the current function with a dynamic value
   *
   * function can be any C++ callable type, and will be called to return the
   * callable state of the function each time it is requested. This way, the callable
   * state of a function can depend on metaclass instances.
   *
   * \param function Function to call to get the callable state of the function
   *
   * \return Reference to this, in order to chain other calls
   */
  template <typename F>
  ClassBuilder<T>& callable(F function);


I'm not sure of the rationale of some of the features. This is a feature I have not used. There are other features, like parent-child user objects, again unused. These features may have a use in a particular application, but they might not be viewed as widely used. So, perhaps they should not be so tightly coupled with the function data.

Design is choice

As Andrei Alexandrescu says, "Design is choice". There may be many solutions to problem, but the design is the one you chose.

In CAMP the data of an object is mixed with its use, e.g. function data also contains methods to call the function. There may be different ways in which we want to call the function. The current call method takes a dynamic array of arguments which are value types. This is quite inefficient, along with the value mapping that occurs, where many of the objects may be copied.

CAMP call behaviour has several particular traits:
  • Coercion of values through ValueMapper.
  • Calling with dynamic array of values.
  • Ability to block calls (callable).
It might be best to separate the call behaviour from the type information. This way calling, and any other uses of the type, can be customised for its use. This is a significant change away from CAMP.

I am currently extending Ponder with Lua scripting ability. This has been complicated by the Ponder value mapping and its difficulty in dealing with the ambiguity of references.

Type data is immutable

Type information is static. It is baked into the program at compile-time. The Ponder types should reflect this. Any uses of the data should refer to the data, but not modify it.


Ponder: what is reflection?

This is discussion on the current state of Ponder and thoughts on future changes.

What is reflection?

Wikipedia states:
In computer science, reflection is the ability of a computer program to examine, introspect, and modify its own structure and behavior at runtime
and uses are:
... observing and modifying program execution at runtime. A reflection-oriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal related to that enclosure. This is typically accomplished by dynamically assigning program code at runtime. 
In object-oriented programming languages such as Java, reflection allows inspection of classes, interfaces, fields and methods at runtime without knowing the names of the interfaces, fields, methods at compile time. It also allows instantiation of new objects and invocation of methods. 
Reflection can be used to adapt a given program to different situations dynamically. Reflection-oriented programming almost always requires additional knowledge, framework, relational mapping, and object relevance in order to take advantage of more generic code execution.
Features we might expect are:

Type Introspection

The ability to introspect a program type. E.g. see what type it is and which members it contains. This might useful for runtime data binding, e.g. loading an XML file and assigning the values to class members based on element name matches.

Some C++ reflection systems offer this data automatically by parsing the symbols in a compiled C++ file. Ponder does not offer this, and there is some discussion of this in a previous post. It is generally thought that you do not want to export all data, and that sometimes the data needs annotating in order to remove ambiguity. For example, function returning references: should the values be copied or kept as references?

Self Modification

Since C++ is statically compiled, self modified code might be limited to setting pointers and callbacks to chosen type. It might be possible by implementing a runtime dynamic C++ compiler is complicated, and also likely something you would't want to distribute with your program. A more popular way would be to customise behaviour with data, or use an embeddable scripting language, perhaps with dynamic features, e.g. Lua.


Thursday, 27 October 2011

Development's ups and downs

Game development is sometimes testing! You get stuck on things, you go through boring phases, you wonder if you are going in the right direction. Often you have to fight though it to get that little reward that keeps you going.

Perseverance is not a long race; it is many short races one after another. - Walter Elliott
I do not think there is any other quality so essential to success of any kind as the quality of perseverance. It overcomes almost everything, even nature. - John D. Rockefeller
The road to success is dotted with many tempting parking places. - Author Unknown
It's not that I'm so smart, it's just that I stay with problems longer. - Albert Einstein

And I guess now I ought to stop reading quotes and do some work. :o)

Tuesday, 3 May 2011

iMac 2011 Buying Decision

This is not a full review of the iMac 2011 refresh, rather some comments on my decision making process for buying one.

There are no cosmetic changes, just a bump in spec, although the increase in power looks quite impressive, especially in the high end 27" iMac's graphics.

New features are:
  • Thunderbolt - high speed video/data connect. Peripherals won't be cheap. :(
  • "iMac displays feature "in-plane switching," or IPS. Originally designed by Hitachi in 1996, IPS improves color and contrast at sharp viewing angles." (source)
Things improved:
  • CPU (faster).
  • GPU (faster).
  • Camera (quality).
  • Screen (quality).

CPU

All of the iMacs are now quad-core (i.e. i5). The higher models can be bumped up to i7, which has hyper-threading (i.e. 8 hardware threads on 4 cores, 2 on each).

This thread contains lots of information comparing the 2010 and 2011 models.

Comparison of iMac 2011 processors.

The i7 3.4 Ghz vs i5 3.1 GHz appears to be (from CPU performance comparison, not real world):
  •  ~25% faster transcoding in Handbrake.
  • ~10% faster at Photoshop.
  • ~10% faster at image rendering in 3DS Max 2010.
The i7 is £160 extra in the 27" top model. So it's about a 10% increase in price (of the whole iMac) for ~10% increase in performance. If you do a lot of video transcoding then it's a ~25% increase in performance for 10% extra, which looks like better value for money.

Initial Benchmarks

Initial iTechVision initial Geekbench tests:
  • Geekbench:
    • i7 3.4 Ghz in 32 bit OSX: ~11750, in 64 bit OSX: ~12700 (8% increase).
    • i5 3.1 Ghz in 32 bit OSX: ~8400 (~71% of i7). Approx 9500 if 13% increase.
      • i7 ~20% faster than MBPs with i7.
      • i7 the same performance as MPs from 2009-10.
  • For comparison (32/64 bit) from Mac Geekbench:
    • MacBook Pro (13-inch Mid 2009) Intel Core 2 Duo P8700 2.53 GHz (2 cores) = 3510/3851.
    • MacBook Pro (17-inch Early 2011) Intel Core i7-2820QM 2.3 GHz (4 cores) = 10383/11179.
    • iMac (27-inch Mid 2010) Intel Core i5 680 3.6 GHz (2 cores) = 6829/7745.
    • iMac (27-inch Late 2009) Intel Core i7 860 2.8 GHz (4 cores) = 8328/9712.
    • iMac (27-inch Mid 2010) Intel Core i7 870 2.93 GHz (4 cores) = 9122/10544.
    • Mac Pro (Mid 2010) Intel Xeon E5620 2.4 GHz (8 cores) = 12722/14083.
  • i5 3.1 GHz is:
    •  same performance as i7 2.93 Ghz from last year.
    • ~86% the performance of MacPro Xeon 3.33 Ghz 2010: 6 core and costs £3400!
The difference between 32 and 64 bit OS appears to be around 8-9% on Macbook Pros and around 12-15% on iMacs.

Graphics

There appear to be some people who are discontent that Apple uses mobile graphics devices in their iMacs, but this has always been the case. Some modern graphics cards make stupid amounts of noise, and if you are editing music, or trying to concentrate then it can be very off putting. The mobile cards create far less heat, and therefore need less cooling, and are quieter.

This table shows the previous graphics cards used in iMacs:

Comparison of past and present iMac graphics cards.

The Radeon HD 6970M, in the high end 27" iMac has a much higher spec than the other cards, and appears to be about 70% faster than the HD 6770M found in the lower spec iMac. There is £250 difference between the two models (which also includes a faster processor and more VRAM on the graphics card). The HD 6990M card can also be upgraded to 2 GB VRAM for £80.

HD 6970M
This review compares the Radeon HD 6950 1 GB and 2 GB models, and the GeForce GTX 560 Ti. This is interesting because the iMac uses the HD 6970M and has 1 and 2 GB options. The review is not for the mobile version (i.e. the 6950M) but it does show what effect adding VRAM has. The conclusion is that adding VRAM doesn't necessarily speed up the framerate, but it does allow higher quality AA and higher screen resolutions (and the iMac has a massive screen!). The HD 6970 looks to be about 10% more powerful than the 6950.

RAM

Apple's RAM costs are very expensive. I don't know how they justify it. The iMacs come with 4GB of RAM. This comes as 2 x 2GB sticks, which live in 2 of 4 slots, so more can be added easily and cheaply from a third party.
  • RAM specification from Apple.
    • 4GB supplied.
    • Maximum possible: 16GB (4GB in each slot).
    • 2 or 4 GB may be used in each slot.
  • Apple price:
    • 8 GB (2x4) = £160.
    • 16 GB (4x4) = £480.
  • This is for 2010 iMac, but if prices are similar, options are:
    • 6 GB (2x2 + 2) = £17 (inc VAT).
    • 8 GB (2x2 + 4) = £34.
    • 12 GB (2x2 + 2x4) = £67.
    • 16 GB (4x4) = £134. Possibly get money from selling 2x2 GB.

Price Comparison

Apple are often accused of ripping their customers off. And whilst I find it really hard to see how they charge so much for RAM, bigger hard drives and SSD, the basic packages do seem quite competitive. Often, systems that are compared just aren't of the same quality. They have poorly quality screens or make loads noise, or aren't as powerful in one area.

If you look on the Dell site, at their high end gaming rigs, a roughly equivalent spec looks to be the Alienware Aurora i7-2600. It is £1300 (with £230 off). A 27" monitor, the U2711, is £839. So that totals ~£2140. This is also doesn't include software like iLife. The top end iMac is £1889 with i7 and 2GB VRAM.


Conclusion

The extra £250 to jump from the lower to the higher spec 27" iMac is worth it for the extra graphics performance, plus the faster processor.

The extra £160 for the i7 also looks quite good value if you look at the benchmarks. Superficially (according to Geekbench) it looks like you get 37% increase in power for around a 10% increase in price. Of course not all applications will get this full benefit, but you do get a faster processor and most things will run at least 10% faster.

It is also worth investing in some more RAM. Using Apple RAM is ludicrously expensive. Buy the base spec and upgrade later from a third party. 4 GB is plenty for casual use. 8-12 GB is useful for audio/video editing and multi-tasking.

For me, I'd like to play games, program, and have the computer for some time, so I think I'll go for i7 and the 2GB of VRAM option. Games are always using more VRAM, and it might be used for GPU processing. If you don't play games then you probably won't need the 2GB of VRAM. And if you don't edit video then the i5 might be good enough for you. It is still a really powerful machine.

Afterthoughts

[9-July-11] I've since bought my Mac and am very happy with the nice big screen. It is a beast as well, incredibly fast. I noticed it was a little sluggish at first, but I think this is because the CPU/motherboard is so fast that any disc access seems very slow (including any virtual memory swapping) in comparison.

I upgraded to 12GB (Crucial 2x4GB sticks + the existing 2x2GB) and this really speeds things up. Aperture was almost unusable before, but is lightening fast now. I decided not to get an internal SSD, but I can now see why you'd want one.

I am also very happy (so far) with the gaming performance. The GPU performance was worth waiting for as I think previous 27" iMacs were slightly underpowered. All the games I have tried so far run at maximum settings (everything on max/ultra), at maximum resolution without any lag at all. The CPU barely breaks into a jog as well. Starcraft 2 and Settlers 7 both have no problems at all. Looking forward to id Rage.


[4-May-11] Added initial Geekbench test results from (shop bought?) iMac i5 3.1 GHz.
[4-May-11] Added details on gfx performance and 2GB VRAM upgrade.
[9-May-11] Updated conclusion after reading more benchmarks. Added Dell comparison.
[9-July-11] Added afterthoughts.

Thursday, 7 January 2010

Microsoft Shopping Channel Slated

Oh dear, can you smell the fear? Watch the video.

It's like the Microsoft Shopping Channel. Has Ballmer really been reduced to this?

Judging by the comments on the BBC site page I think many consumers have seen the light. Microsoft has failed to deliver. They missed the internet, tried to stifle competition, spent too long on luke warm Vista, and now they're worried about losing market share because they've missed the mobile market. People don't want a PC on a slate. They want something fast, responsive, easy. You don't want to "go into PC mode" when you pull your phone or slate out of your pocket.

And I don't think it's even due to Bill Gates leaving. Microsoft just seem to be doing the same thing, but in a less savvy way now. Microsoft want to be everything to everybody, and you just can't do that. Microsoft have the desktop; it's a given, but Apple have exploited their niche very well, and quietly beavered away to create a great operating system which is part of a package that provides great software that is relevant to people today. For the average user, they hardly need to shell out for anything after buying a Mac. You get iPhoto, email manager, a proper web browser (HTML5?), Garageband, Xcode, and not forgetting Time Machine.

Personally, I'm totally sold on the Mac at home at the moment. I didn't want anything Vista on it. It seemed like a sideways move. What does Vista do amazingly better than XP? Ultimately, the thing that sold me on OSX was Time Machine. I went from one shop looking at Sony laptops with Vista on and then into the Apple store. There was picture on the wall of Time Machine and I suddenly realised that Macs aren't more expensive, and even if they are, they are worth it. You save time and have a more enjoyable user experience. To have fully automated backups on a Mac, completely transparently all you need is an external hard drive.

I'll probably be slagging off Apple one day when they become the complacent, greedy, corporate overlords that everyone hates, but for now I can't wait to see what the "iSlate" will offer. Microsoft are clearly rattled.

Saturday, 2 January 2010

Justin Lee Collins sucks

Why is Justin Lee Collins on television? He just blathers on and on and has nothing interesting to say. He's just like some boring, conceited bloke you accidentally bump into in a pub who you can't get away from. Is this country really so short of talent that this is the best we have to offer? At least he's relegated to Channel 5 now. The slow decline.

Excellent, there is a sack Justin Lee Collins petition. There are also other blogs detailing his crapness on his Star Wars programme. And a group on Facebook.

Enough.

Saturday, 19 December 2009

Revolving kitchen

This is an interesting piece of art:

rotating kitchen from Zeger Reyers on Vimeo.

It comes from the Transmission blog. The question is posed, "is this art?"; but surely the question is "is this good art?". You could consider anything as art, as a metaphor for something, or just something pleasing to look at.

Wikipedia claims "Art is the process or product of deliberately arranging elements in a way that appeals to the senses or emotions." But it doesn't specify by whom. You could come across some spilt milk and appreciate the pattern. If you took a picture of it would that make it art, because the photograph is deliberate?

Wednesday, 9 April 2008

Housing market decline

The housing market is looking a bit bleak at the moment. An interesting site to read is http://www.housepricecrash.co.uk/ which is trying to counteract the overexcited spin of the financial analysts. These are the weasels who obviously are going to make less money if the market goes down. It's interesting to see on the HPC site the only people predicting the market will go up are the people who will make money from it going up. All the economic pundits and research institutes are predicting falls. This essay is very interesting.

The spokesman from the Nationwide was amusing yesterday morning on 5 live. He was trying to paint a rosy picture of things and yet the tone of his voice suggested that even he didn't believe what he was saying! There are amusing asides to the coming pain but it will be good for younger people in the end. The Property Snake (opposite of propery ladder!) shows falling prices in most places and long house sale durations.