Xcode 6 iOS8 Error: Can’t find keyplane that supports type 8 for keyboard

Can’t find keyplane that supports type 8 for keyboard Wildcat-Landscape-QWERTY-Pad; using 3673479387_Wildcat-Alphabetic-Keyboard_Capital-Letters

If you see an error message like the one in above, you’re probably not able to see keyboard on your simulator while you run your app. Here’s the solution:

Run your app on simultor then go to iOS Simulator-> Hardware-> Keyboard -> Uncheck the Connect Hardware Keyboard Option

Yorum yap

Filed under Swift, Xcode

> Operator

> operatörü ile terminal komutlarınızı ihtiyaçlarınız doğrultusunda yönlendirebilirsiniz. Mesela az önce benim terminal geçmişimi kayıt altına almam gerekiyordu. Bunun için > operatörü ile şöyle bir çalışma yaptım:

Screenshot

Yorum yap

Filed under Ubuntu

Bash programming for Crawling with cURL

Currently i’m assigned to collect and index mass data from internet and specific sources at work. In order to achieve this, there is must-know concept called “Crawler“. After i talked with a senior colleague, i was done with whole concept and system architecture (or at least i knew more about which direction to go).

What is crawler?

According to wikipedia: “A Web crawler is an Internet bot that systematically browses the World Wide Web, typically for the purpose of Web indexing. A Web crawler may also be called a Web spider,[1] an ant, an automatic indexer,[2] or (in the FOAF software context) a Web scutter.”

As always first thing in my consideration was avoding to invent wheel again. There are several free and open source projects but first of all i wanted to use a command line tool called: cURL

What is cURL?

As i mentioned cURL is a  command line tool which enables you to transfer data using various protocols such as FTP, HTTP etc. Personally, i liked cURL. It’s very easy to install and use tool with some handy features. But first, let’s install it:

Since i was using Ubuntu it was very easy for me; sudo apt-get install curl

But cURL runs under wide variety of operating systems. You can check it’s web site: http://curl.haxx.se/

In order to retrieve a simple web page, you can user this command on terminal: curl http://www.demo.com

But if you want to retrieve with with -o flag, should type this:

curl -o LocalFileName.html http://www.demo.com This will retrieve url and save it as LocalFileName.html

To download output to a file that has the same name as on the system it originates from, use the -O flag, for example: curl -O http://www.demo.com/demo.html

You can also use different flags for different requirements while calling cURL from terminal.

How to use cURL for crawling?

I decided to make a humble beginning. I took some url from one of the APIs that i was going to use and wrote them in a .txt file one at a line. With xargs curl < url-list.txt command, i could display display all the html content in my terminal but i was unable to get files in my desktop. And with curl -o myFile.html http://www.demo.html command i could download only 1 file. And in my case, i’m suppose to download hundreds of thousands pages per each API source. What i needed was some sort of combination of those two commands. I don’t know if there is any way to do it by only calling cURL with some flags and other commands. But i managed to solve this problem by writing a simple loop in a scripting language called “Bash

What is Bash?

Bash is a scripting programming language for Unix like systems. It is a part of GNU projects and it comes as installed in most of GNU/Linux distros. For detailed information, there is always wikipedia: http://en.wikipedia.org/wiki/Bash_(Unix_shell)

Below you can check my script:


#!/bin/bash
file="url-list.txt"

while read line
do
 outfile=$(echo $line | awk 'BEGIN { FS = "/" } ; {print $NF}')
 curl -o "$outfile.html" "$line"
done < "$file"

Yorum yap

Filed under Bash, Linux, Ubuntu

Xcode – fatal error: malformed or corrupted AST file

1

http://timuraykutyildirim.wordpress.com/2014/07/21/xcode-error-no-provisioned-ios-devices-are-available-with-a-compatible-ios-version/ adresindeki yazımın sonunda söz ettiğim bu hatayı düzeltmek için;

  1. Windows -> Organizer -> Projects
  2. Projennizi seçin ve “Derived Data”nın yanında bulunan delete butonuna tıklayın

2

Yorum yap

Filed under Xcode

Xcode error: No provisioned iOS devices are available with a compatible iOS version.

Bugün Xcode 5 kullanarak ve iOS 7.1’e yükseltilmiş bir chazı Mac’e bağlayarak uygulamamı çalıştırmak istediğimde karşıma çıktı bu hata. Hatta tam hata metni şöyle birşey:

Screen Shot 2014-07-21 at 10.57.54

Bu sorunu çözmek için Xcode’un File menüsünde şunları yaptım:

  1. Window -> Organizer
  2. Device sekmesine tıkla
  3. iOS device’ın üzerine tıkla ve sol kısımda bulunan “use for development” butonuna tıkla.

Sorun çözülmek şöyle bir dursun,  Xcode fatal error vermeye başladı. Gerçi bunda Xcode’un başlamadan önce istediği lüzumsuz güncelleştirmeleri yapmasına izin vermeminde payı var sanırım. Fakat o başka bir yazının konusu olmalı sanırım, hata şöyle birşey:

1

1 Yorum

Filed under Xcode

VirtualBox ile Kurulan Ubuntu’da Çözünürlük Sorunu

VirtualBox ile bir sanal makine üzerinde Ubuntu kullanırken çözünürlüğünüz çok düşük ise bunun için VirtualBox’ın VBox guest utility’lerini yüklemeniz gerekiyor.

sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

Eğer bir sorunla karşılaşıyorsanız öncesinde “ose” versiyonlarını yüklemeniz gerekebilir.

sudo apt-get install virtualbox-ose-guest-utils virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms

Paketler yüklendikten sonra sanal makinenizi yeniden başlatmayı unutmayın.

 

Yorum yap

Filed under Ubuntu

MapXtreme Demo Uygulaması

Geçtiğimiz yaz yazdığım bir projeydi. Bir firmanın (ismi lazım değil ama baş harfi Başarsoft) mülakat için az laf çok kod ayaklarında verdiği bir web uygulaması. C# , ASP.NET ve MapInfo MapXtreme kullanarak yaptığım GIS amaçlı bir proje. Pitney Bowes’taki abilerimiz ablalarımız iyi güzel yapmışlar, sağolsunlar ama dökümantasyonları biraz karmaşık gelmişti bana. Gerçi bunda kodu yazdığım zaman yazın sıcağından bunalmış, uzun zaman tatile hasret kalmışken tatilin ortasında kod yazmış ve daha önce GIS işleriyle pek uğraşmamış olmamında etkisi olabilir, bilemiyorum. Okumaya devam et

Yorum yap

Filed under Projelerim

Zebra Style in CSS – 2

zebraaa

Daha önce http://timuraykutyildirim.wordpress.com/2012/02/06/zebra-style-in-css/ adresindeki yazımda Zebra Style’ı html’in <table> etiketi ile oluşturduğumuz tablolarda uygulamayı göstermiştim. Ama tabi artık devir değişti. jQuery olmadan JavaScript yazılamıyor piyasada. <div> kullanamayanı ayıplıyorlar dersem yeridir.

Geçen bir tablo oluşturmam gerektiğinde internette handsontable isimli jQuery kütüphanesini keşfetmiştim. Adamlar resmen excel’in javascript eşleniğini yapmışlar, çok başarılı. Ben de hemen ofiste yaptığım projeye dahil ettim çünkü hangi boyutta data gönderirsem göndereyim tablo halinde gösterebiliyordu. Birazda dökümanını kurcalayıp diğer özelliklerine bakınca gayet başarılı buldum.

Bu yazının çıkış noktası da aslında handsontable’a dayanıyor. div ile oluşturulan tabloda zebra style oluşturmak için aşağıdaki kodu inceleyebilirsiniz, hem handsontable’ın nasıl kullanıldığını da görmüş olursunuz:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<script src="http://warpech.github.io/jquery-handsontable/lib/jquery.min.js"></script>
<script src="http://warpech.github.io/jquery-handsontable/dist/jquery.handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="http://warpech.github.io/jquery-handsontable/dist/jquery.handsontable.full.css">
<link rel="stylesheet" media="screen" href="http://warpech.github.io/jquery-handsontable/demo/css/samples.css?20140401">

<style type="text/css">
body {background: white; margin: 20px;}
h2 {margin: 20px 0;}
.zebraStyle > tbody > tr:nth-child(2n+1) > td {background: #e0e0d1;}
</style>

<script type='text/javascript'>
var arr= [["", "2012", "2013", "2014(YTD)"],["Ferrari", 1460089088.3900001, 1637243070.99, 283566771.55000001],["Alfa Romeo", 1199141138.1900001, 1224624821.1500001, 192307335.49000001]];

$(document).ready( function(){
$('#myTable').handsontable({
data: arr,
minSpareRows: 1,
contextMenu: true,
readOnly: true,
fixedColumnsLeft: 1
});
$('#myTable').find('table').addClass('zebraStyle');
});
</script>
</head>
<body>
<div id="myTable" class="handsontable" style="width: 400px; margin-left:auto; margin-right:auto; background-color:silver"></div>
</body>
</html>

 

Son tahlilde yukarıdaki kodun şöyle bir görüntüsü olacaktır:

table

Yorum yap

Filed under CSS

“Windows Explorer Not Responding” in VBA Excel Runtime for Large Data Set

I was supposed to format an excel file for specific report requirements and this was requiring to code in VBA. First I divided task to some mini-tasks then did some googling. Code was giving 100% correct output but it had a little flaw: It was freezing while run time. It was freezing on the screen and says “Not Responding” on it’s windows frame and when i click on it, it gives a message like this:

winexp

The excel sheet that i get records had 20997 rows and 7 columns and i make some records to another sheet on same file sized and 20997 lines 23 columns. This freezing problem was happening because my procedure was very busy working. I can’t post the original code because it’s already replaced with the new one, But; my Sub TheLoop() was accessing 20995 x 16 times a cell to write on them a string. Naturally, VBA’s interaction with excel took some time.

I tried couple of things to make the procedure faster according to advice of an colleague.

1. Disabling events handlers, screen updating and calculations before you run your procedure. At the end of the procedure restore the settings again. Like this:


'Disabling event handlers, screen updating and calculations'
 Application.EnableEvents = False
 Application.ScreenUpdating = False
 Application.Calculation = xlCalculationManual

'some code comes here'

'Enabling event handlers, screen updating and calculations'
 Application.EnableEvents = True
 Application.ScreenUpdating = True
 Application.Calculation = xlCalculationAutomatic

This helped a little bit but screen freeze still existed.

2. You can optimize the Sub TheLoop. Instead of writing immediately on the cells, write the values inside an array. After the array is full with the values, assign the values of the array to the range that you need. Like this:

Dim ResultValues() As String
Dim j As Long

ReDim ResultValues(2 To 20997, 1 To 3)

For j = 2 To 20997
 ResultValues(j, 1) = "New Defect"
 ResultValues(j, 2) = "3"
 ResultValues(j, 3) = "2"
Next j

With ThisWorkbook.Worksheets("myWorksheet")
 .Range(.Cells(2, 3), .Cells(20997, 5)) = ResultValues
End With

Luckily the columns between the ones that i modified were only text or empty cells. (some of the columns were not meant to be modified) So;

  • I read the whole range into an array.
  • Then modified the array in the same way you are currently modifying cells.
  • After the modifications, dumped the whole matrix in the range again.

For instance:

Sub TheLoop()
Dim arrRangeValues() as Variant
Dim j as Long

arrRangeValues= Range("A2:V20997").Value2

For j = 2 To 20997
 arrRangeValues(j, 1) = "Defect" 'Cells(row_index , column_index)'
 arrRangeValues(j, 3) = "New Defect"
 arrRangeValues(j, 4) = "3" ' this one also might be empty'
 arrRangeValues(j, 5) = "2" ' this one also might be empty'

 arrRangeValues(j, 7) = "Name Surname"
 arrRangeValues(j, 8) = arrRangeValues(j, 7)
 arrRangeValues(j, 16) = arrRangeValues(j, 7)
 ...
 arrRangeValues(j, 10) = " http://SERVER_NAME:8888/PROJECT_NAME/ "
Next j

Range("A2:V20997").Value2 = arrRangeValues
End Sub

I decided to try second advise, but eventhough i don’t know about Dim and ReDim in VBA, it seem like a necessary requirement a write my columns next-to-next in here ReDim ResultValues(2 To 20997, 1 To 3)  but there are some other columns which are including nothing but a title and most of the those columns are between the columns that i record in TheLoop subroutine. And i did’t want to write extra codes for moving columns to between others. 3 of the remaining columns were getting data from another excel sheet.

Then i decided to make more research, and found the perfect solution. Instead of using for loop in TheLoop subroutine, i removed the loop and changed it as in below. That makes it incredibly faster when i compare it with my first code eventhough i didn’t disable event properties, and now it’s not freezing. :)

Sub TheLoop()

 Cells(2, 1).Resize(20996) = "Defect"
 Cells(2, 3).Resize(20996) = "New Defect"
 Cells(2, 4).Resize(20996) = "3"
 Cells(2, 5).Resize(20996) = "2"
 Cells(2, 7).Resize(20996) = "Name Surname"
 Cells(2, 8).Resize(20996) = "Name Surname"
 Cells(2, 9).Resize(20996) = "FALSE"


 Cells(2, 10).Resize(20996) = " http://SERVER_NAME:8888/PROJECT_NAME/ "


 Cells(2, 12).Resize(20996) = "Software Quality"
 Cells(2, 13).Resize(20996) = "Unsigned"
 Cells(2, 14).Resize(20996) = "Software Quality"
 Cells(2, 15).Resize(20996) = "1"
 Cells(2, 16).Resize(20996) = "Name Surname"
 Cells(2, 18).Resize(20996) = "Software Quality"
 Cells(2, 20).Resize(20996) = "Development"
 Cells(2, 22).Resize(20996) = " TYPE YOUR MODULE'S NAME TO HERE"

End Sub

Yorum yap

Filed under VBA

iOS Simulator failed to install the application

Apple may be all in for best user experience but when it comes to being “developer friendly” they suck so hard i can’t find any polite way to describe it.

Here’s the error i’m having:

[ERROR] : An error occurred running the iOS Simulator

[ERROR] : [DEBUG] Session could not be started: Error

Domain=DTiPhoneSimulatorErrorDomain Code=1 “iOS Simulator failed to install the application.” UserInfo=0x101b27020 {NSLocalizedDescription=iOS Simulator failed to install the application., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}

And here’s the solution:

reset

Yorum yap

Filed under iOS App Development