Thursday, 22 August 2013

Mac app is still running after deleting Info.plist

Mac app is still running after deleting Info.plist

I want to build a Mac App from scratch. I manually created the required
folders of main app, Contents, MacOS, Resources, and dropped the binaries.
The only one I don't know how to create from scratch is "Info.plist". So,
I just copied one from the installed Applications on my machine, removed
all the unfamiliar keys, except the Executable and Package type (as APP).
Then I did a test. Before I copied and editted the Info.plist file, I
double-clicked the app icon in Finder. Not working, which is expected.
After I copied and editted the Info.plist file, it is working, which is
also expected. Next is what I don't understand. I removed the Info.plist
file, and double-clicked the app icon in Finder, it is STILL working!
My question is:
Did the first time running migrate the Info.plist information to some
secret place in the app bundle?
Is copying and editing an existing Info.plist file from other applications
a good practice for building an app from scratch?

Compiling QT with MSVC 2012 fails

Compiling QT with MSVC 2012 fails

I installed QT 5.1 VS2012 release and installed successfuly.
I get error while compilng the project in QT Creator with the 'jom' thingy
saying:
*"jom:
F:\tmp2\build-testprj-Desktop_Qt_5_1_0_MSVC2012_32bit-Debug\Makefile.Debug
[debug\mainwindow.obj] Error 2 jom:
F:\tmp2\build-testprj-Desktop_Qt_5_1_0_MSVC2012_32bit-Debug\Makefile.Debug
[debug\moc_mainwindow.obj] Error 2 jom:
F:\tmp2\build-testprj-Desktop_Qt_5_1_0_MSVC2012_32bit-Debug\Makefile
[debug] Error 2 17:30:06: The process
"C:\Qt\Qt5.1.0\Tools\QtCreator\bin\jom.exe" exited with code 2. Error
while building/deploying project testprj (kit: Desktop Qt 5.1.0 MSVC2012
32bit) When executing step 'Make'"*

How do I exclude first ten and last 1 li from hide() jquery

How do I exclude first ten and last 1 li from hide() jquery

So far I've this:
$(".actor ul li").not($(".actor ul li").slice(0,11)).hide();
I also would like to exclude last li from hide(). How would I do that?
obvious answer would be to also show :last. But there should be an elegant
way to do this :)

How to get reference for TextView which is not in activity_main.xml?

How to get reference for TextView which is not in activity_main.xml?

wordonlist.xml:
<TextView
android:id="@+id/tvHiragana"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="Hiragana"
android:textColor="@color/blackColor"
android:textColorHint="@color/blackColor"
android:textSize="18sp" />
MainActivity:
setContentView(R.layout.activity_main);
tvHiragana = (TextView) findViewById(R.id.tvHiragana);
Typeface tf =
Typeface.createFromAsset(getAssets(),"fonts/JapaneseLetter.ttf");
tvHiragana.setTypeface(tf,Typeface.BOLD);
Result:
NullPointerException in the line tvHiragana.setTypeface(tf,Typeface.BOLD);
I think it is because of TextView which is not in activity_main.xml. How
to get reference for TextView which is in wordonlist.xml?

Wednesday, 21 August 2013

jquery appended objects all have the same left value

jquery appended objects all have the same left value

So I have a javascript/jquery code It appends a bunch of span elements to
the main div container and then animates them to move to the left. I need
to be able to detect the left value of each span element, however when I
output the left value to the console log it shows that they all have the
same value. any ideas?
http://jsbin.com/uKobuja/2/

Items disappearing from array within array

Items disappearing from array within array

I create a NSMutableArray that I need as long as my app lives, lets call
it suseranArray, just after the @implementation of my main class. This
Array will hold several objects of a class called Vassal. A Vassal is
simply:
1) A NSMutableString 2) Another NSMutableString 3) A NSMutableArray 4)
Another NSMutable Array
Each Vassal created is also needed for the life of the app, and they never
change.
These objects are made as (retain) properties in an .h file, synthesized
in the .m file, and each given an alloc+init whenever the object Vassal is
created during the init function. Each vassal has data filled in and
stored in the suzerain Array. the 3rd item always has several elements,
and after a bug appeared, I put a line to check if it is ever empty, but
it never is, and life is good.
Now, later on when a certain Vassal object is needed, we try to access its
3rd property to fetch the data in there, and sometimes that array empty...
I checked to see if it disappeared somehow, but it is always there on the
debug, carrying a nice address like 0x2319f8a0 which makes sense since the
NSMutableString just above it is at address 0x2319fb40 - (I was expecting
00000000 after a lot of headache). What is happening? I my head, I am
creating an RETAINed objects, which retains data put in by default, and
that object is put inside another, but somehow the data inside the array
vanishes. What possible scenario could lead to this? Thank you for your
time :)
Note: the last array currently just holds one item at this stage of
development, and curiously enough, that one item is never missing, despite
the two arrays being 'brothers'

Write operation is happening from 1 Gigabit port instead of 10 Gigabit port in NetGear switch and its random

Write operation is happening from 1 Gigabit port instead of 10 Gigabit
port in NetGear switch and its random

We have a Synology system which is connected with NetGear switch. We
passed 2, 10 gigabit cables from synology to switch. We connected HP
server with switch with 2, 10 gigabit port. We connected one more network
on 1 gigabit port to a switch. We installed VMWare on the server and
testing write test on Synology system. While testing, some time write
operation is going through 1 gigabit port. The NetGear switch is smart
enough to route the traffic to the fastest connection (i.e. from 10
gigabit port). This thing is happening on random. Sometimes write
operation is going through 1 gigabit port and sometime its going through
10 gigabit port. We are performing write test from the server which is
connected with two 10 gigabit port.