Redmi Note With adb in mac
- Enable Developer Options.
- Enable USB Debugging.
In terminal,
$ echo "0x2717" > ~/.android/adb_usb.ini
$ ./adb kill-server
$ ./adb devices
In terminal,
$ echo "0x2717" > ~/.android/adb_usb.ini
$ ./adb kill-server
$ ./adb devices
Yesterday , I got a problem with Testflight. I gave them the app with testflight for testing. However, they can’t install and always got “Unable to Download Application”.
I found the article on testflight .
Everthing is correct. But I forget to check Architecture settings. I am using Build Active Architecture Only . So, it’s a problem. Ater I change to the Build Active Architecture Only to NO and it’s working fine.
Today, I update the Xcode 6 Beta 3 and retest the bubble sort that I wrote yesterday. In Beta 3, bubble sort is done in 11 miliseconds in Debug Mode. Before it done in 14 miliseconds. After that I changed to the Release Mode and run it. It done in the 0.15 miliseconds. Yes, this time swift is faster than Objective-C now. In objective-C , it done in 0.28 miliseconds.
Swift Programming Language book has been updated and you need to update it.
Changes in Xcode 6 beta 3 for Swift are
You can read more at here
Apple claimed that swift is faster than the Objective-C. However, I feel is slower than Objective-C. When I writing the custom keyboard with Swift , IDE response too slow and Sourcekitservice use over 100% CPU usages. It may be the IDE bug and X-Code 6 still beta 2.
So, I tried to sort the array with bubblesort with Objective-C and Swift like following.
As the result , Objective-C done is 0.297070 miliseconds and Swift Done in 14 miliseconds. It’s so much different. So, I change the swift compiler method to Fastest and It done ine 0.5 miliseconds. Not so much different with Objective-C but still slow.
I hope, it’s a bug and apple will fix in next version of xcode 6 release. I love the Swift because it’s safer and easier than Objective-C. However, I don’t want to use if it’s slower than Obective-C at run time.
I am using mongodb for tracking my website. I am saving date and time with ISODate , "time" : ISODate("2014-05-18T13:23:04.227Z")
.
So, I wrote like that.
db.analystic.aggregate(
{
"$project": {
"y": {
"$year": "$time"
},
"m": {
"$month": "$time"
},
"d": {
"$dayOfMonth": "$time"
}
}
},
{
"$group": {
"_id": {
"year": "$y",
"month": "$m",
"day": "$d"
},
count: {
"$sum": 1
}
}
},
{
$sort: {
"_id.year": 1,
"_id.month": 1,
"_id.day": 1
}
})
First , need to separate the year , month and date. After that , make a group and then sort it.
I couldn’t find the EMV TLV decoder for iOS. However, I found a PHP code on github. So, I port to iOS version. However, I only need decoder. So, ios code include only decoder.
//some of your code
//usage it
NSDictionary *value = [SGTLVDecode decodeWithString:@"Your TLV String"];
NSLog(@"TLV %@",value);
I am using disqus for my blog. However, it has a problem. If the URL is include query string , comments can’t show and it’s showing new one. I found a solution JavaScript configuration variables of disqus.
We need to put correct URL at disqus_url
variable. So, I put
var disqus_url = document.location.origin + document.location.pathname;
For jade template , it will look like
#disqus_thread
script(type='text/javascript')
|/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|var disqus_shortname = 'myblogname'; // required: replace example with your forum shortname
|var disqus_url = document.location.origin + document.location.pathname;
|/* * * DON'T EDIT BELOW THIS LINE * * */
|(function() {
|var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|})();
noscript
| Please enable JavaScript to view the
a(href='http://disqus.com/?ref_noscript') comments powered by Disqus.
a.dsq-brlink(href='http://disqus.com')
| comments powered by
span.logo-disqus Disqus
After that , there is no more problem about query string URL problem.
I build the library(SDK) file for iOS. I have a one problem. That is to support both simulator and device. After building both simulator and device , I need to do
lipo -create mylibDevice.a mylibSimulator.a -output mylib.a
I always need to do when release the library.
It’s really troublesome for doing many time.
So, I decided to create the script in post-action.
Go to the Product > Scheme > Edit Scheme.
And then Duplicate Scheme because we will only do post action when it ready to release. Give a name , release build.
Chose the release build scheme and Build > Post Action.
Click the + icon.
Need to choose the target build in Provide build setting from .
I create a script like that
rm -r ~/Desktop/mylib
mkdir ~/Desktop/mylib
mkdir ~/Desktop/mylib/Device+Simulator
mkdir ~/Desktop/mylib/Device
cd ${BUILT_PRODUCTS_DIR}
cd ..
cd Debug-iphoneos
cp mylib.a ~/Desktop/eb/Device+Simulator/mylibDevice.a
cp -r mylib.bundle ~/Desktop/eb/Device+Simulator/mylib.bundle
cp -r usr ~/Desktop/eb/Device+Simulator/usr
cp mylib.a ~/Desktop/eb/Device/mylib.a
cp -r mylib.bundle ~/Desktop/eb/Device/mylib.bundle
cp -r usr ~/Desktop/eb/Device/usr
cd ..
cd Debug-iphonesimulator
cp mylib.a ~/Desktop/eb/Device+Simulator/mylibSimulator.a
cd ~/Desktop/mylib/Device+Simulator
lipo -create mylibDevice.a mylibSimulator.a -output mylib.a
rm mylibSimulator.a
rm mylibDevice.a
After ready to publish , I built the app that use mylib static library project for both device and simulator.
And then choose the release build and build again.
After that I got mylib static library on my desktop. Nothing to do anymore and ready to use.
After moving to the wintersmith from wordpress, I have two problem.
Today, I moved to the wintersmith from the wordpress. Wordpress is amazing blog platform. However, I want to try a static generated blog instead of dyanmic. Actually there is no reason for changing to static page. After testing wintersmith , it is really fast. It is easy to use.
Pros : support markdown. Static pages. Really fast. Can use with github pages.
Cons : no full text search and use with google custom search. Need to use jade for creating template. Only few templates. You need computer to write blog.
I prefer wintersmith than jekyll because of node.js. I can customize if it’s require to change.
[...]