Tuesday, 1 October 2013

When is a convex polygon inscribable?

When is a convex polygon inscribable?

Defining the diameter of a convex polygon as the maximum possible distance
between all pairs of vertices, can we conclude that the convex polygon is
inscribable (i.e has all its sides as chords of a circle) if the diameter
isn't the diameter of the minimum bounding circle, in which case the
circumscribed circle is the minimum bounding circle?

Monday, 30 September 2013

Awesome WM - running lua rc.lua gives an error

Awesome WM - running lua rc.lua gives an error

I install awesome using sudo apt-get install awesome
I copied my rc.lua to ~/.config/awesome and ran
lua rc.lua
I got the following error:
lua: rc.lua:2: module 'awful' not found:
no field package.preload['awful']
no file '/usr/local/share/lua/5.2/awful.lua'
no file '/usr/local/share/lua/5.2/awful/init.lua'
no file '/usr/local/lib/lua/5.2/awful.lua'
no file '/usr/local/lib/lua/5.2/awful/init.lua'
no file './awful.lua'
no file '/usr/share/lua/5.2/awful.lua'
no file '/usr/share/lua/5.2/awful/init.lua'
no file './awful.lua'
no file '/usr/local/lib/lua/5.2/awful.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/awful.so'
no file '/usr/lib/lua/5.2/awful.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './awful.so'
stack traceback:
[C]: in function 'require'
rc.lua:2: in main chunk
[C]: in ?
I'm using ubuntu 12.04. I'm not sure what i'm doing wrong or what is
missing. help please.

Says that my computer is running in low-graphics mode, but cannot run failsafe x. How do I fix this?

Says that my computer is running in low-graphics mode, but cannot run
failsafe x. How do I fix this?

When I start up my computer it tells me I am running in low graphics mode.
I've read tutorials on how to fix this and they all say I need to run
failsafe x. When I try to run failsafe x nothing happens. My screen starts
out black and sort of fades to a bluish and then to an orangeish and then
to black, but nothing else happens. What the heck is going on and how do I
fix it?

Accessing Photo File

Accessing Photo File

I use the standard TTakePhotoFromCameraAction in my application in order
to take a photo.
What I would like to do, is when the user closes the application and then
open it again, the last taken photo to be uploaded.
I know how to use SharedPreference in delphi, but I don't know what is the
filename & path of the photo it self!
Any clues?

ngcontroller in Angular JS

ngcontroller in Angular JS

I'm having some trouble understanding how to use ng-controller. I've a
form controller in eventController.js.
<html ng-app>
<head>
<script src="angular.js"></script>
<script src="eventController.js"></script>
</head>
<body>
<div>
<h3>My Event:<i>{{event.name}}</i></h3>
</div>
<div ng-controller="formController">
<form >
<label>Event Name:</label>
<input type="text" ng-model="event.name" placeholder="Event Name">
</form>
</div>
</body>
</html>
Now the heading even.name is not getting displayed when I'm using
ng-controller="formController" in that division otherwise its working
fine. When I use ng-controller on the whole page as a division then I get
{{event.name}} and not the content.
How can I display the content of event.name and also use the controller on
form together ?
What mistake am I making ?

Sunday, 29 September 2013

parsing a JSON fails with missing element in javascript

parsing a JSON fails with missing element in javascript

I am trying to use Youtube's Gdata JSON response in javascript. My code
iterates through the playlist and extract the item data.but for few videos
the rating is not there which throws
"TypeError: item.gd$rating is undefined"
is there a way to check before accessing the element.
this is the code with with i fetch the json response.
var avgrating = item['gd$rating']['average'];
var maxrating = item['gd$rating']['max'];
var minrating = item['gd$rating']['min'];
var numRaters = item['gd$rating']['numRaters'];

Hide Navigation Bar in Interface Builder w/ Storyboards

Hide Navigation Bar in Interface Builder w/ Storyboards

I have a pretty basic storyboard based app, with a UINavigationController,
a main view and a secondary view, both of which are in the navigation
hierarchy. I'm currently hiding the navigation bar on the main view by
using setNavigationBarHidden: as appropriate in viewWillAppear and
viewWillDisappear. It seems like there should be a way to do this in
Interface Builder, rather than in code. Essentially I'd like the options
available in the Simulated Metrics options, but not simulated. Does that
exist?