Thursday, 3 October 2013

Facebook Like activity

Facebook Like activity

I'm new to Facebook application development., What am trying to do is
I have a website with 100 different objects (Places, Restaurants etc) -
Objects will be added dynamically.
I have two options - namely "Thumbs Up" & "Thumbs Down". To do any of
these actions the user has to login through FB
When next user visits that particular object, I want to show who pressed
the Up and Down buttons. Also I want to show that user's Facebook friend's
separately if some one pressed Up or Down.
How can I achieve it?

Wednesday, 2 October 2013

Loading framework in Polycode Xcode project

Loading framework in Polycode Xcode project

I have what could be a very obvious problem when trying to load a
framework in a Polycode (C++ gaming library) Xcode project.
I locate the library in the file that its in, in finder. Then drag and
drop into the Framework file in the left hand column in Xcode- a dialogue
box comes up and I click ok. It's there in linked frameworks in the
general tab, and in build phases. It's in the frameworks folder on the
left. Press build and I get;
ld: warning: directory not found for option
'-L"/Users/user/Documents/Polycode/Release/Darwin/Framework/Template/Xcode/../../Core/Lib"'
ld: warning: directory not found for option
'-L"/Users/user/Documents/Polycode/Release/Darwin/Framework/Template/Xcode/../../Dependencies/Lib"'
ld: warning: directory not found for option
'-L"/Users/user/Documents/Polycode/Release/Darwin/Framework/Template/Xcode/../../Core/Dependencies/lib"'
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Anyone know what I'm doing wrong?

Eclipse is giving an error when trying to refactor a method's signature

Eclipse is giving an error when trying to refactor a method's signature

Whenever I try to change a method's signature using eclipse refactoring
functionality (shortcut Shift+Alt+c) I get an error dialog with the text
below.
An unexpected exception occured while performing the refactoring. See the
error log for more details
org/springframework/ide/eclipse/ui/editor/util/BeansEditorUtils
I'm not sure where the error log is located to provide additional
information.
I'm running the following version of eclipse: Version: Juno Release Build
id: 20120614-1722
looking at the "for more details" it sounds that the error could be caused
by the SpringIDE plugin. I have the version: 3.3.0.201307091516-RELEASE
If you need me to provide additional details please ask and tell me where
I could find them.
Thanks a lot

knockout js css multiple class bindings

knockout js css multiple class bindings

I am making a small app for countdown timer in which i have used knockout
css binding with multiple classes. Now, the problem is if i am writing the
logic in separate handler it is working fine but if trying to implement
the same logic inline with css binding its not working as required.
Working version: http://jsfiddle.net/gzejF/3/
<div class="dateTimer" data-bind="timer: startTime, timerOptions: {speed:
1000}">
<div class="tens">
<div class="upperTensClock timerLine"></div>
<div class="lowerTensClock timerLine"></div>
</div>
<div class="units">
<div class="upperClock timerLine"></div>
<div class="lowerClock timerLine"></div>
</div>
</div>
Not working version: http://jsfiddle.net/K6m93/
<div class="dateTimer">
<div class="tens">
<div class="upperTensClock" data-bind="css: {
'l1 l2 l3': tens() == 0,
'l3': tens() == 1,
'l2 l3 l7': tens() == 2 || tens() == 3,
'l1 l3 l7': tens() == 4,
'l1 l2 l7': tens() == 5 || tens() == 6,
'l2 l3': tens() == 7,
'l1 l2 l3 l7': tens() == 8 || tens() == 9
}"></div>
<div class="lowerTensClock" data-bind="css: {
'l4 l5 l6': tens() == 0 || tens() == 6 || tens() == 8,
'l4': tens() == 1 || tens() == 4 || tens() == 7 || tens() == 9,
'l5 l6': tens() == 2,
'l4 l5': tens() == 3 || tens() == 5
}"></div>
</div>
<div class="units">
<div class="upperClock l1 l2 l3 l7" data-bind="css: {
'l1 l2 l3': units() == 0,
'l3': units() == 1,
'l2 l3 l7': units() == 2 || units() == 3,
'l1 l3 l7': units() == 4,
'l1 l2 l7': units() == 5 || units() == 6,
'l2 l3': units() == 7,
'l1 l2 l3 l7': units() == 8 || units() == 9
}"></div>
<div class="lowerClock l4 l5 l6" data-bind="css: {
'l4 l5 l6': units() == 0 || units() == 6 || units() == 8,
'l4': units() == 1 || units() == 4 || units() == 7 || units()
== 9,
'l5 l6': units() == 2,
'l4 l5': units() == 3 || units() == 5
}"></div>
</div>
</div>
It seems like in inline css binding if condition is true then its applying
the class but when checking next statement which is false it removes the
class added in previous step. Is there any workaround for this inline css
check because lots of switch statements are not looking good in the
working code.

Tuesday, 1 October 2013

Run Jmeter test in Interactive (GUI) mode from command prompt

Run Jmeter test in Interactive (GUI) mode from command prompt

From the command prompt, I want to be able to load a .jmx and run the test
in the GUI mode. I know running the jmeter -t test.jmx will load it in
GUI, but I also want it to be able to run. Anyone know on how this can be
done?

Any way using pyodbc to return literal SQL

Any way using pyodbc to return literal SQL

Is there any way using pyodbc to return the literal sql that was passed to
the database? I'm passing parameters to statements within a for loop
iterating over a list of dictionaries. For example:
mylist = [{'name': 'john', 'key': 1}, {'name': 'jane', 'key': 2}]
sql = "update people set name = ? where key = ?"
for i in mylist:
cursor.execute(sql, i['name'], i['key'])
I'd like to be able to print or store the literal sql that the script is
passing to the database. If this is not possible using pyodbc, can someone
recommend a different Python module that has this feature? Thanks in
advance.

Installing 13.4 on macbook dualboot: grub bootloader installation failed

Installing 13.4 on macbook dualboot: grub bootloader installation failed

Previously I had Ubuntu 12.4 running as second OS on a second boot
partition, installed with bootcamp (no rEFIt). Now I tried to install
Ubuntu 13.4 (amd64) from USB but it failed to install Grub ('bootloader
installation failed') on /dev/sda3 (the fresh Ubuntu partition). Since
there is no further error message, I'm kind of puzzled about this. When I
startup the MacBook and choose "windows" (this name is due to bootcamp and
was that way with 12.4 all the time) from the EFI boot menu, grub "loads"
but says: error, file not found
I googled around and tried a few things:
Running the live-ubuntu and manually installing grub via:
sudo mount /dev/sda3 /mnt
sudo grub-install /dev/sda3 --[b/r]oot-directory="/mnt" --force
... didn't work. Apparently it installed Grub but spit out a lot of
warnings the usage of blocklists and I still couldn't boot.
Installing rEFIt and trying the whole installation over and over again ...
didn't work.
So ... any ideas why grub-install fails? Does the 64bit-version only
supports (u)efi-boot and there are issues due to the old
hardware/firmware?
The setting: Macbook 5,1(late 2008) with OSX 10.8 Ubuntu 13.4 64bit on USB
The disk is healthy (says disk-warrior and diskutil on osx) and the
partition tables are synchronized (rEFIt)
Update: After uninstalling rEFIt, I wasnt able to boot from usb-ununtu
anymore. So I installed rEFInd, run the installation (I think the usb was
booted with efi and not with bios because I didn't see grub before the
installation!) and et voilá, the bootloader installed. BUT: I'm still not
able to boot into the newly installed ubuntu. Same as above: error, file
not found. >grub rescue: ... Did I kill my bootloader??!