Search This Blog

Wednesday, December 25, 2013

web screen scraping tools

HtmlUnit is a "GUI-Less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser.
http://htmlunit.sourceforge.net/


tool  http://screen-scraper.com/

java library list http://www.manageability.org/blog/stuff/screen-scraping-tools-written-in-java/view

JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning up malformed and faulty HTML. In addition, JTidy provides a DOM interface to the document that is being processed, which effectively makes you able to use JTidy as a DOM parser for real-world HTML.
http://jtidy.sourceforge.net/

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.


http://andreas-hess.info/programming/webcrawler/index.html


Monday, December 16, 2013

C++ migrating to Visual Studio 2012/13 from VC6

Read here
Lessons learned migrating to Visual Studio 2012 and .NET 4.5 - CodeProject:

and here - about CDatabase and CRecordset issue:
http://stackoverflow.com/questions/12714310/crecordsetsnapshot-doesnt-work-in-vs2012-anymore-whats-the-alternative
One of the major changes in the ODBC that MS did for MFC is changing the cursor type while opening DB connection.
They change it from SQL_CUR_USE_ODBC to be SQL_CUR_USE_DRIVER


It seems that while accessing DB2 db via MFC/odbc there is no runtime error, when I used  MS default implementation at vs2013(e.g. SQL_CUR_USE_DRIVER), when accessing MSSQL via odbc there are runtime error "feature not implemnted" while trying to update sanpshot CRecordset.

the fix at the moment is as explain in the above link , override the CDatabase OpenEx and use the "old" cursor type SQL_CUR_USE_ODBC.


in case of huge obj files follow this:
Avoid overriding from Template class , its better to use Proxy pattern , and gave it as a data member.



ATL and MFC changes and fixes in Visual Studio 2013

Tuesday, November 26, 2013

Identifying Memory Leak in User App

Identifying Memory Leak With Process Explorer And Windbg - Alik Levin's - Site Home - MSDN Blogs:

http://www.codeproject.com/Articles/31382/Memory-Leak-Detection-Using-Windbg


another one:
The Debug Diagnostic Tool (DebugDiag) is designed to assist in troubleshooting issues such as hangs, slow performance, memory leaks or fragmentation, and crashes in any user-mode process. The tool includes additional debugging scripts focused on Internet Information Services (IIS) applications, web data access components, COM+ and related Microsoft technologies. http://www.microsoft.com/en-gb/download/details.aspx?id=26798

Create Windows Dump File - How to create a user-mode process dump file in Windows Vista and in Windows 7  && How to use the Userdump.exe tool to create a dump file


Monday, November 4, 2013

Using the GNU C/C++ compiler on AIX

very good article to people who want to port their C++ code that compiled under XLC compiler to work and compile via gcc/g++.

Using the GNU C/C++ compiler on AIX:

from internal test ...( not scientific tests)- its seems like the test program i used for my performence testing run faster when compile with g++  !!!!

FYI
Yaniv Tzanany

Thursday, October 10, 2013

Wednesday, October 9, 2013

Passing jstring to JAVA from C++ - the right way.

hi
i used to use this function
m_env->NewStringUTF(formattedMsg);

and one day i saw that the string i passed in my case it was huge more than 500k, cut in the end.
so i replcae this function with this one ... and its worked !!

jstring WindowsToJstring(JNIEnv* pEnv, LPCTSTR cstr) {
jstring retJstring = NULL;
int slen = strlen(cstr);
int length = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)cstr, slen, NULL, 0 );
unsigned short* tempbuffer = (unsigned short *)malloc( length*2 + 1 );
MultiByteToWideChar( CP_ACP, 0, (LPCSTR)cstr, slen, (LPWSTR)tempbuffer, length );
retJstring = (pEnv)->NewString((jchar*)tempbuffer, length );
free( tempbuffer );
return retJstring;
}

more details could be found here
http://www.anyang-window.com.cn/between-java-and-c-transmission-through-jni-chinese-string-and-hash-issues/

and
http://stackoverflow.com/questions/8258834/sending-utf-chars-to-java-from-c-using-jni

Sunday, September 29, 2013

Friday, September 6, 2013

Android change time zone - programmatically

i use the next code to change OS time zone ... seems to be working

AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm.setTimeZone("Europe/Athens");

add the next permisiion :
android.permission.SET_TIME_ZONE


Sunday, September 1, 2013

SVN - for dummies

Create TAG , is good idea when you have like a big delivery to client.
TAG is like base line.
while Brunch is like a Stream.

Trunk is the main development stream , Usually you will have Tags on the trunk.

you can Merge stuff from brunch to trunk - with the merge options.



Friday, August 23, 2013

Android screen size info

Supporting Multiple Screens


nice tool
http://coh.io/adpi/

Understanding Screen Densities and the “dp”

Resolution is the actual number of pixels available in the display, density is how many pixels appear within a constant area of the display, and size is the amount of physical space available for displaying your interface. These are interrelated: increase the resolution and density together, and size stays about the same. This is why the 320x480 screen on a G1 and 480x800 screen on a Droid are both the same screen size: the 480x800 screen has more pixels, but it is also higher density.
To remove the size/density calculations from the picture, the Android framework works wherever possible in terms of "dp" units, which are corrected for density. In medium-density ("mdpi") screens, which correspond to the original Android phones, physical pixels are identical to dp's; the devices’ dimensions are 320x480 in either scale. A more recent phone might have physical-pixel dimensions of 480x800 but be a high-density device. The conversion factor from hdpi to mdpi in this case is 1.5, so for a developer's purposes, the device is 320x533 in dp's.

Screen-size Buckets

Android has included support for three screen-size “buckets” since 1.6, based on these “dp” units: “normal” is currently the most popular device format (originally 320x480, more recently higher-density 480x800); “small” is for smaller screens, and “large” is for “substantially larger” screens. Devices that fall in the “large” bucket include the Dell Streak and original 7” Samsung Galaxy Tab. Android 2.3 introduced a new bucket size “xlarge”, in preparation for the approximately-10” tablets (such as the Motorola Xoom) that Android 3.0 was designed to support.
The definitions are:
  • xlarge screens are at least 960dp x 720dp.
  • large screens are at least 640dp x 480dp.
  • normal screens are at least 470dp x 320dp.
  • small screens are at least 426dp x 320dp. (Android does not currently support screens smaller than this.)
Here are some more examples of how this works with real screens:
  • A QVGA screen is 320x240 ldpi. Converting to mdpi (a 4/3 scaling factor) gives us 426dp x 320dp; this matches the minimum size above for the small screen bucket.
  • The Xoom is a typical 10” tablet with a 1280x800 mdpi screen. This places it into the xlarge screen bucket.
  • The Dell Streak is a 800x480 mdpi screen. This places it into the bottom of the large size bucket.
  • A typical 7” tablet has a 1024x600 mdpi screen. This also counts as a large screen.
  • The original Samsung Galaxy Tab is an interesting case. Physically it is a 1024x600 7” screen and thus classified as “large”. However the device configures its screen as hdpi, which means after applying the appropriate ⅔ scaling factor the actual space on the screen is 682dp x 400dp. This actually moves it out of the “large” bucket and into a “normal” screen size. The Tab actually reports that it is “large”; this was a mistake in the framework’s computation of the size for that device that we made. Today no devices should ship like this.


Thursday, July 18, 2013

sim card - How to get all android contacts but without those which are on SIM

sim card - How to get all android contacts but without those which are on SIM - Stack Overflow:


i used the next function to get the contacts  with phone, include/exclude from sim  , in one query
the function is part of big program so you might need to change /add it

// the idea is get the contacts with the phone first
public static List<Contact> getContacts(Context context,
boolean favoritesOnly, boolean removeSimContacts) {

boolean withEmail = true;
List<Contact> contactsList = null;
HashMap<String, Contact> contactsMap = new HashMap<String, Contact>();
String starred = favoritesOnly ? " AND starred=1 " : "";
String sNOSimContacs = removeSimContacts ? "%sim%": "%%";
String filter = ContactsContract.Contacts.HAS_PHONE_NUMBER + "=1 " + starred + " AND " ;
if(removeSimContacts)
filter += RawContacts.ACCOUNT_TYPE + " NOT LIKE ? AND ";
else
filter += RawContacts.ACCOUNT_TYPE + " LIKE ? AND ";

filter += Data.MIMETYPE + "=?";

Cursor cursor = null;
try {

String[] projection = new String[] {
ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.Contacts.HAS_PHONE_NUMBER,
ContactsContract.Contacts._ID,
ContactsContract.Contacts.STARRED,
ContactsContract.CommonDataKinds.Phone.DATA,
ContactsContract.CommonDataKinds.Phone.TYPE,
ContactsContract.CommonDataKinds.Phone.LABEL,
ContactsContract.RawContacts.CONTACT_ID};

cursor = context.getContentResolver().query(Data.CONTENT_URI,
projection,
filter, new String[] { sNOSimContacs,Phone.CONTENT_ITEM_TYPE},
ContactsContract.Contacts.DISPLAY_NAME);

while (cursor != null && cursor.moveToNext()) {

String contactId = cursor.getString(cursor
.getColumnIndex(ContactsContract.RawContacts.CONTACT_ID));
// if we dont have this contact add it
// if the user have multi numbers we get the same contact here
if(!contactsMap.containsKey(contactId)){
Contact contact;

if(Const.IS_USE_SHARED_PREF_ONLY)
contact = ContactProviderAlternative.getContact(context,
Integer.parseInt(contactId));
else
contact = ContactProvider.getContact(context,
Integer.parseInt(contactId));

// if (favoritesOnly)
// Log.d("Info", "pos: " + contact.getContactPosition());


boolean isFav  = (cursor.getShort(cursor
.getColumnIndex(ContactsContract.Contacts.STARRED)) == 1);

contact.setFavorite(isFav);
contact.setContactId(contactId);
contact.setContactName(cursor.getString(cursor
.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
contact.setContactPhoto(Utils.openPhoto(context,
Long.parseLong(contactId), false));
contact.setContactUri(Integer.parseInt(contactId));
contact.setContactPhone(cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DATA)));
int type = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
contact.setContactPhoneType(type == 1 ? Const.NEW_CONTACT_PHONE_TYPE_LANDLINE : Const.NEW_CONTACT_PHONE_TYPE_MOBILE);

contactsMap.put(contactId,contact);
}else{
// we have this conatct lets update his phone the latest one we get
Contact contact = contactsMap.get(contactId);
contact.setContactPhone(cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DATA)));
int type = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
contact.setContactPhoneType(type == 1 ? Const.NEW_CONTACT_PHONE_TYPE_LANDLINE : Const.NEW_CONTACT_PHONE_TYPE_MOBILE);
}
}
if(cursor != null){
cursor.close();
cursor = null;
}

contactsList = new ArrayList<Contact>(contactsMap.values());
if(withEmail){
String[] projectionEmail = new String[] {
ContactsContract.CommonDataKinds.Email.DATA,
ContactsContract.CommonDataKinds.Email.TYPE,
ContactsContract.CommonDataKinds.Email.LABEL
};

String where= Data.CONTACT_ID + " = ? AND " + Data.MIMETYPE + "=?";

for(Contact c : contactsList){
//email & phone

String[] params = new String[]{c.getContactId(), Email.CONTENT_ITEM_TYPE};

cursor = context.getContentResolver().query(
Data.CONTENT_URI,
       projectionEmail,
       where,
       params,
       null);

while(cursor != null && cursor.moveToNext()) {
c.setContactEmail(cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA)));
    }
if(cursor != null){
cursor.close();
cursor = null;
}

}
}

}

catch (Exception e) {
e.printStackTrace();
}finally{
if(cursor != null)
cursor.close();
}

return contactsList;
}

Yaniv Tzannay

Sunday, July 14, 2013

Android icons size for tab

for mdpi use - 32x32 pixel
for hdpi use - 48x48 pixel
for xhdpi use - 64x64 pixel

more stuff could be found here

Iconography

http://developer.android.com/design/style/iconography.html

please note when you put an image on xhdpi - android know how to scale down your image ...

yaniv tzanany

Thursday, July 11, 2013

Android change some system settings

i was looking for some info about chnaging system setttings , here arte some pointers for links that might help you .

The major class  is : /Settings.Secure
http://developer.android.com/reference/android/provider/Settings.Secure.html

allowed adb insatll
http://stackoverflow.com/questions/11985251/how-to-access-device-settings-programmatically
Settings.Secure.putInt(getActivity().getContentResolver(),Settings.Secure.ADB_ENABLED, 1);


How to change programmatically a global setting like 'haptic feedback'?
http://stackoverflow.com/questions/7696934/how-to-change-programmatically-a-global-setting-like-haptic-feedback
Settings.System.putInt(getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0);


Control default auto rotate screen in my application
http://stackoverflow.com/questions/9718317/control-default-auto-rotate-screen-in-my-application

public static void setAutoOrientationEnabled(ContentResolver resolver, boolean enabled)
{
  Settings.System.putInt(resolver, Settings.System.ACCELEROMETER_ROTATION, enabled ? 1 : 0);
}

  How to change screen timeout programmatically?
http://stackoverflow.com/questions/10748861/how-to-change-screen-timeout-programmatically
  android.provider.Settings.System.putInt(getContentResolver(),
            Settings.System.SCREEN_OFF_TIMEOUT, time);
turn-the-volume-to-max
http://stackoverflow.com/questions/15670524/how-to-turn-the-volume-to-max-programmatically-on-android

change keyboard
http://stackoverflow.com/questions/6901097/change-input-method-of-android-device-programatically-android
not possible to change keyboard

GPS - on off
http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker
http://stackoverflow.com/questions/8983772/turn-on-location-providers-programmatically-in-android

Monday, July 1, 2013

Entity frameworks notes

if you get such error while serialize your entity ".......System.Data.Entity.DynamicProxies is not expected."
after creating your entity context (generated class derived from DbContext) the next line:

 base.Configuration.ProxyCreationEnabled = false;

to solve the error of
DataContractJsonSerializer  "reference tracking is disabled" 
i remove some of my association i created to avoid back reference

Loading Related Entities -  http://msdn.microsoft.com/en-us/data/jj574232.aspx

links for EE framework
http://blogs.msdn.com/b/adonet/archive/2011/01/31/using-dbcontext-in-ef-feature-ctp5-part-6-loading-related-entities.aspx


To get the SQL query that generated by db entity use:
var sql = ((System.Data.Entity.Infrastructure.DbQuery<tbl_artists>)query).ToString();
if its object:
var sql = ((System.Data.Objects.ObjectQuery)result).ToTraceString();

Basic LINQ Query Operations (C#)



Saturday, June 8, 2013

IIS Express - access from android while debugging

i am working on end to end project , need to build the android UI and the web services.
while building the webservice via .NET i wanted to test them via my device connected to my usb.

i noticed i failed to access the IISEXpress ,only localhost works.
i couldn't use localhost  on my url , i get an error.
one of the solution is to use my ip (in the local domain 10.0.0.5),
but i get access error HTTP/1.1 400 Bad Request 
i follow this link
http://stackoverflow.com/questions/5433786/configure-iis-express-for-external-access-to-vs2010-project/5438322#5438322

and this
http://stackoverflow.com/questions/7877523/how-to-allow-iisexpress-to-listen-internet

and i decided to change the next file  (win 7)
%userprofile%\documents\iisexpress\config\applicationhost.config

i change the next line - under my project (replace localhost with 10.0.0.5)
 <binding protocol="https" bindingInformation="*:44300:10.0.0.5" />

and my android managed to consume the service 

enjoy 
yaniv tzanany

Passing multiple POST parameters to Web API Controller Methods

Passing multiple POST parameters to Web API Controller Methods


http://www.west-wind.com/weblog/posts/2012/May/08/Passing-multiple-POST-parameters-to-Web-API-Controller-Methods

Wednesday, June 5, 2013

Microsoft Visual C++ Tips and Tricks

Microsoft Visual C++ Tips and Tricks:

 "0xCDCDCDCD Allocated in heap, but not initialized
0xDDDDDDDD Released heap memory.
0xFDFDFDFD "NoMansLand" fences automatically placed at boundary of heap memory. Should never be overwritten. If you do overwrite one, you're probably walking off the end of an array.
0xCCCCCCCC Allocated on stack, but not initialized"

Develop For Google Glass?

Want To Develop For Google Glass? Watch These Videos | WebProNews:


Wednesday, April 10, 2013

android - How to post data to not verified SSL url

the next code snippets will  allow you to make HTTPS call to non verified SSL certificate.

 HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;  
 HttpClient client = new DefaultHttpClient();  
 SchemeRegistry registry = new SchemeRegistry();  
 SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();  
 socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);  
 registry.register(new Scheme("https", socketFactory, 443));  
 SingleClientConnManager mgr = new SingleClientConnManager(client.getParams(), registry);  
 DefaultHttpClient httpClient = new DefaultHttpClient(mgr, client.getParams());  
 HttpPost post = new HttpPost("https://www.yaniv.co.il/tst/IsValidUser.php");  
 List<NameValuePair> pairs = new ArrayList<NameValuePair>();  
 pairs.add(new BasicNameValuePair("user_name", user));  
 pairs.add(new BasicNameValuePair("password", pwd));  
 pairs.add(new BasicNameValuePair("type", type));                 
 post.setEntity(new UrlEncodedFormEntity(pairs, HTTP.UTF_8));  
 HttpParams params = new BasicHttpParams();  
 int timeoutConnection = 5000;  
 HttpConnectionParams.setConnectionTimeout(params, timeoutConnection);  
 post.setParams(params);  
 HttpResponse response = httpClient.execute(post);  

be aware ,its not safe to make calls to non verified ssl, unless you know what are you doing.

enjoy
yaniv tzanany

Thursday, April 4, 2013

ASP.NEW web service creation - top down

sometime you want to create a mockup web service based on wsdl files that you get from the client.
the client sent to you the wsdl file , because he not allowed to access to his domain while developing the solution.

the easy way to create such service is with in your domain for testing.
you can do so via wsdl.exe program that ship with MS VS2008/2012 (Visual Studio 2008 Command Prompt).

if you have external xsd file that linked from the wsdl , add it to the command after the wsdl file.

e.g.
wsdl.exe my_demo.wsdl my_demo.xsd /l:CS /serverInterface /out:D:\MyStuff\ServerGenCode

the above command generates the interface file is D:\MyStuff\ServerGenCode directory based on the wsdl file and the xsd.

after generating the interface file , you need to implement the interface
e.g.
public class WebTestService : System.Web.Services.WebService, IMyDemo
{

    #region IMyDemo Members
    [WebMethod]
    public string GetName()
    {
     return "It Works !!!!";
    }
    #endregion 
}

enjoy
Yaniv Tzanany

Tuesday, March 19, 2013

Asynchronous Web Service Calls over HTTP with the .NET Framework

very informative article , contains description and several implantation Asynchronous Web Service Calls over HTTP with the .NET Framework: "Asynchronous Web Service Calls over HTTP with the .NET Framework"

on the same subject

Calling Web Services Asynchronously 



Saturday, March 16, 2013

AXIS C++ - starter kit for client on windows- WS from C++

To call Webservice from C++ (VC6 in may case) consider using AXIS C++ - gSoap is also a good option.

before starting your code , its very important to set the axis c++ correctly, i get many "system exception" until i figure out that i need to set the environment  properly.

after downloading your version  (axis-c-1.6b-Win32-trace-bin) and extract it.
set the this environment  variable:
  • AXISCPP_DEPLOY=D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\ -- [ your path]
  • add %AXISCPP_DEPLOY%\bin to your PATH.
  • download  - xerces 2.2  , grab the dll from the bin directory and put it in the %AXISCPP_DEPLOY%\bin directory.
  • Create file axiscpp.conf at %AXISCPP_DEPLOY%
in the file set the next rows - use full path:
#ClientLogPath is for axis trace - leave empty in case you dont want
ClientLogPath:D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\logs\AxisLog.txt
XMLParser:D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\bin\AxisXMLParserXerces.dll
Transport_http:D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\bin\HTTPTransport.dll
Channel_HTTP:D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\bin\HTTPChannel.dll
Channel_HTTP_SSL:D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\bin\HTTPSSLChannel.dll

you are done - its configured properly.
to create your C++ classes from WSDL:
  • get the wsdl 
  • open cmd windows
  • set the classpath 
    • e.g set CLASSPATH=D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axis\wsdl2ws.jar;D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axisjava\axis.jar;D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axisjava\commons-discovery.jar;D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axisjava\commons-logging.jar;D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axisjava\jaxrpc.jar;D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axisjava\saaj.jar;D:\MyStuff\axis-c++\axis-c-1.6b-Win32-trace-bin\lib\axisjava\wsdl4j.jar
  • run the command 
    • java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws any_wsdl.wsdl -lc++ -sclient
you should see your header/cpp files in the directory.

happy coding 
Yaniv Tzanany

Wednesday, March 6, 2013

Usefull MQ command

here are some usefull comand to use when working with MQ
command to display the queuestatus of a queue:
dis qs() type(handle) all 

command to display the queuestatus of a queue (and only display the pid) :
dis qs() type(handle) pid 

command to display the queuestatus of a queue (and display the applicationtag and the pid) :
dis qs() type(handle) appltag pid
display all the queues that contains more then 0 messages: dis ql(*) where (curdepth gt 0) 

start an api trace:
strmqtrc -m [QM]  -t api
(the -t has several options. Logs are written to: /trace)

end a trace:
endmqtrc -m [QM]


on windows you can read the TRC files via text viewer.

Enjoy 
Yaniv Tzanany

Tuesday, February 19, 2013

Wdcil meeting notes

Mock framework for .net to simulate mockup objects.
Application routing - could be added to .net as package to control routing.
Create github project
Clone it to disk via tortoys for git.
Create project in app harbor.
App harbor will let you deploy your stuff in the cloud with db.
Connect github to appharbor. As service hook. And collorbation.
Add nuget to your project.
Upload to git.
Deploy in appharbor.
Mind Meister good Web.
Dev http client. Very good Dev plugin for chrome.
There are many Mvc framework for the client.
Bootstrap and jquery mobile very good for mobile development.
Backbone its mvc in the client

Sunday, February 10, 2013

Visual Studio 6 (VC++) under Windows 7 64 bit - process not killed

there is a fix from Dr.Hoiby ,

You need to check the version of the file DM.dll that  located into "Common/MSDev98/Bin" is   6.0.9782.0..
i used sp6.
replace the file from http://www.dr-hoiby.com/TLLOC.dll (28KB) with the current TLLOC.dll in your Common/MSDev98/Bin.

its works for me  .

Yaniv Tzanany

Wednesday, January 23, 2013

android - downloading a sqlite database?

android - downloading a sqlite database? - Stack Overflow:


Day6- Web Mobile and HTML5

this day will be about video & audio and drawing with html5.

the ppt is from here http://www.slideshare.net/YnonPerek/06-html5-mobile start at page 60.

in html 5 there is a <video> </video>  tag , each browser support in different coded

http://getmiro.com is a free converter for music and video.
h.264 is widely supported in android & iPhones.
for mobile devices usually use mp4 format.

<audio></audio> tag is like video tag , iPhone & Android support MP3, there is no AutoPlay !!
to play any music you must use "click" event on somthing , no auto play.

if you want some free sound you can find them at Free Sound Clips, Sound Bites, and Sound Effects .

Hybrid app 

ppt could be found  here http://www.slideshare.net/YnonPerek/07-phonegap
phonegap online build is a good option for small application.


ppt about Ajax and WebSockets Intro.


this how to init object from json string:
var obj = eval(json_str)

place to use images - some are free
deviantART was created to entertain, inspire, and empower the artist in all of us. Founded in August 2000, deviantART is the largest online social network for artists and art enthusiasts with over 25 million registered members, attracting 65 million unique visitors per month - http://www.deviantart.com/

Thursday, January 17, 2013

Upgrade nopcommerce from 1.6 to 2.8

i have an old site with nopcommerce 1.6 here are the steps to upgrade it.

run all the upgrade db scripts from 1.9 version , means download the
nopCommerce_1.90_NoSource.rar - run all the scripts in this rar file nopCommerce_1.90_NoSource.rar\Install\Scripts.

all downlaods could be found from here http://nopcommerce.codeplex.com/releases/view/98452

download nopCommerce_2.00_NoSource.rar install it , when the site want to create new db , set the parameters to your old db ( the original db - the one you already  upgrade to 1.9 ).

after doing so , you need to run the upgrade scripts from 2.0 version  (nopCommerce_2.00_UpgardeScripts).

after run all the upgrade scripts , you can find them here .

enjoy
Yaniv Tzanany

p.s. - its not worked well for me ... i might miss something while copy and paste  - and i am lazy todo it again.
but this is the way !!!!
 

Day5 - Web Mobile and HTML5

JQM = J Query mobile

PPT could be founf here http://www.slideshare.net/YnonPerek/04-jquery-mobile

you can control JQM theme , you can use the

ThemeRoller 

to create theme to your application , you can setup your new theme, then download it ,  open it and save it into your project directory.
new directory called theme will be added to your project, you now need to add one line above JQM mobile links in the header to add your theme.

JQM is very good for prototype , small sites , business portfolio.
JQM build to support many devices ,without performance in their mind.

html5 - features and api  

localstorage is a great way to save your state in the browser.

navigator.geolocation is the way to track your current postion.
please note open html from your hard drive with the  navigator (e.g. file://) will not work from chrome , use firefox instead.

Tuesday, January 15, 2013

Animation between activity in android

i found here very nice working solution that make it very easy to add some animation between activities .
check this out:

Open an activity with animation in Android


yaniv 



Wednesday, January 9, 2013

Day4 - Web Mobile and HTML5

putting script src tag such as
<script src="xx.js"></script> in the end of the html , its good for UI performance , the user experience is better because he see something first.

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

//on re-size do something

var someFunc = function(){
$('myElement').html('******');
}

$(window).on('resize',someFunc);

jQuery mobile framework takes the "write less, do more" mantra to the next level: Instead of writing unique apps for each mobile device or OS, the jQuery mobile framework allows you to design a single highly-branded web site or application that will work on all popular smartphone, tablet, and desktop platforms.

ppt could be found here http://www.slideshare.net/YnonPerek/04-jquery-mobile

in JQM (jQuery mobile) this is the tree of mobile pages:
data-role="page"   - mobile page
---data-role="header"   - header of the page
---data-role="content"   - content of the page

---data-role="footer"   - footer of the page

(data-position="fixed" set the footer/header on the bottom/top of screen and the content in the middle)

JQM start guide

JQM is very popular for forms in the web, you can just add tree line in the header (include , css ..) and your forms will looks better.

set the type on input fields - will help to the user.
type="tel" - open number keyboard
type="email" - will make sure its email
type="text" - regular keyboard.

jqm is very sensitive with the spell of element (id,names,..etc), it will fail to work if you will make any mistake.



Monday, January 7, 2013

Day3 - Web Mobile and HTML5

very nice tool  ---- weinre is WEINspector REmote 
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.

ratchet UI framework  - Prototype iPhone apps with simple HTML, CSS and JS components.
you can combine it with Junior  A front-end framework for building HTML5 mobile apps with a native look and feel.

Today we focus on java-script .. here is a starter slides - advanced java script .

if you not use var on variable , it will be global.
file is not a domain for variables.
var in a function , "live" in the function.
create variable in a function without a var , will be global.

best practice:
all variable should be start with var.
all my code should be insert into function.
function(){
     var foo=5;
}
when you add "use strict" , the supported browser will failed to run the JS function when there is errors in the function.

each var is like hashmap.
console.dir - display all the items in the var.

must tool when working with teams or a big project:JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team's coding conventions.

JS Bin is a JavaScript, HTML and CSS playground. If you want to experiment, learn or help your friends with a problem, then JS Bin is for you.






Thursday, January 3, 2013

Google map API Key

In case you want to use MapView in your android app, you need to have a  map key .
the next step will describe how to do it in your debug environment.

search for the debug.keystore file , in my Win7 its located at:
C:\Users\yanivt\.android

open cmd windows.
cd C:\Users\yanivt\.android


C:\Users\yanivt\.android>"C:\Program Files (x86)\Java\jdk1.6.0_35\jre\bin\keytool.exe" -list -alias
androiddebugkey -keystore debug.keystore -storepass android -keypass android

you should get somthing like this

androiddebugkey, Sep 21, 2012, PrivateKeyEntry,
Certificate fingerprint (MD5): xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

goto here Google Maps Android v1 API Key Signup   and accept the terms and enter the MD5 that generated for you by keytool.


more info: Signing Your Applications

another post about this subject could be found here http://moorandroid.blogspot.co.il/p/google-maps-on-android.html

enjoy
yaniv tzanany


Wednesday, January 2, 2013

GPS with Android

very informative article to deal with GPS and map on android.
Where Are My Friends:


Day2 - Web Mobile and HTML5

day2 of the seminar - pdf  could be found here .

nice tool - for sharing screen with other over http - https://join.me/
if you need to fill up your site with text http://hipsteripsum.me/

the browser before rendering the page looking for any reference for style sheet - css files.
when adding style tag in the page header - should be faster to render.

 (h1,h2...,div,p,li,....) tags are blocked tags - get the full line.
inline tags(span,a,...) written one after the other in the container, inline elements represents text.
if you want.
img tags are special , they are inline/block element , you can define the size of this tag(width ).

to center block element you need to :
mergin-right: auto;
mergin-left: auto;

css selector - its the tag before { such as div,body,h1.

when you have multiple tags selector ,  with space between them, such as:
div div {}
means that the selector will look for div that have a parent div as well (its not have to be a direct father).

when planning a page (web page) use
reset.css - its  important to reset all the browser defaults, best practice, cancelled browser defaults.
there are many browser in the market(desktop,mobile), with different default , so you want to clear it first.

good practice to use em as sizing for fonts/heights , the idea is when the you set the font size on the body each em equal to the font size, when you change the font size all the sizes are changed.

PXtoEM.com PX to EM conversion made simple.

Mobile CSS PPT

we will use class selector when you need to have many items on the same page e.g.:
img.thumb { ......}

cool css samples:
http://css-tricks.com/examples/ShapesOfCSS/
http://www.the-art-of-web.com/


css animation tags:
-webkit-transition: all 0.5s;
-webkit-transform

exercise:
build left menu - when click on button , the menu will shown/hide with animation from the left.

Tuesday, January 1, 2013

Day1 - Web Mobile and HTML5

in this post i will try to summarize what i learned in a course.

some ppt from ynon perek about web mobile could be found here
web most popular front end template - could be found here 
its a good place to start to build your html5 site.

an easy meta tag to set in your html page to present nicely on mobile:
meta name="viewport" content="width=320"
mean that the mobile browser should show this page in 320 width, read more about newport tag.

more about mediaqueries

very good site to start and  play with yours html-css code http://dabblet.com/

JsFiddle is a playground for web developers, a tool which may be used in many ways. One can use it as an online editor for snippets build from HTML, CSS and JavaScript. The code can then be shared with others, embedded on a blog, etc. Using this approach, JavaScript developers can very easily isolate bugs. 

extra info about mobile web http://www.quirksmode.org/mobile/
list of media queries http://nmsdvid.com/snippets/

Here is a  site who can help you to generate css3 styles to controls css3generator.
The Ultimate CSS Gradient Generator , will help you to create gradient.

until the next day ....
Yaniv