Browsing Category "programming"

Search This Blog

Powered by Blogger.

Pages

Browsing "Older Posts"

Browsing Category "programming"

Unleashing Creativity with Google Cloud's Free Introduction to Generative AI Course

By TY → Sunday, January 7, 2024



In the fast-paced world of technology, staying ahead often involves embracing cutting-edge concepts. One such groundbreaking area is Generative AI, a field that's reshaping the possibilities of artificial intelligence. Google Cloud has taken a stride toward democratizing this knowledge by offering a free "Introduction to Generative AI" course through its Cloud Skills Boost platform. Let's delve into what makes this course a must for anyone keen on exploring the limitless potential of AI-generated content.


Google Cloud's Introduction to Generative AI course provides an accessible entry point for individuals, whether they are seasoned AI professionals or beginners. The curriculum is meticulously designed to cater to a broad audience, offering a comprehensive understanding of the core concepts behind generative artificial intelligence.

#GenerativeAI #AIInnovation #MachineLearning #DeepLearning #AIResearch #ArtificialIntelligence #CreativeAI #AICommunity #AIDevelopment #AIDesign #DataScience #NeuralNetworks #GANs #TechInnovation #FutureTech #AIApplications #TechTrends #AIProgramming #AIForCreativity #EmergingTech



org.sonar.java.AnalysisException: Your project contains .java files

By TY → Monday, May 17, 2021

When we are using Sonarqube to scan non-java projects like python and go, we will encounter the following error:


org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.


To fix:

Add the following to sonar-project.properties

# to exclude java files
sonar.exclusions=**/*.java 

or set sonar.exclusions in the command line.

sonar-scanner \

  -Dsonar.projectKey=local:myproject \

  -Dsonar.sources=. \

  -Dsonar.host.url=http://localhost:9000 \

  -Dsonar.login=xxxxxx \

  -Dsonar.exclusions=**/*.java


Installing DB2 on ubuntu

By TY → Saturday, October 17, 2015

1. Uncomment the Partner repository lines by editing the /etc/apt/sources.list file
Look for the word "partner" in the file /etc/apt/sources.list
Uncomment the line for (by removing the "#") character
# deb http://archive.canonical.com/ubuntu lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner
If your Ubuntu release is not lucid, add in the two lines above into the sources.list file

2. Update the package list
$ sudo apt-get update

3. Install DB2 using apt-get
$ sudo apt-get install db2exc

Reference:
http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html

Backup and Restore DB2 to Another Machine

By TY →

TL;DR;
Use db2look to export DDL and db2move to export data.

The name of the database is "mydb" as an example
On source machine:
$ mkdir migrate
$ cd migrate
$ db2look -d mydb -e -a -o db2look.sql
$ db2move mydb export
$ cd ..
$ tar cf migrate.tar migrate
$ gzip migrate.tar

Transfer migrate.tar.gz to destination machine.
Note: Make sure that the database is created.
If not create it with the following:
Create database [db name, eg:mydb]

On destination machine:
$ gunzip migrate.tar.gz
$ tar xf migrate.tar
$ cd migrate
$ db2 -tvf db2look.sql
$ db2move mydb load

You may encounter -668 error when your application runs on the restored database. You can fix that with SET INTEGRITY.

If you have cyclic dependencies of the tables when you are trying to do SET INTEGRITY, the solution is at this post "Solving cyclic dependency for DB2 SET INTEGRITY".

References:
https://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002079.html
http://www.ibm.com/developerworks/data/library/techarticle/dm-0403melnyk/

Solving cyclic dependency for DB2 SET INTEGRITY

By TY → Wednesday, October 14, 2015

While I am trying to resolve -668 error for DB2, the solution is to set integrity on the related tables.
However, I ended up trying to set integrity on a set of tables with cyclical dependencies. So the command 
SET INTEGRITY for <table> immediate checked
does not work.

Searching more, I found that the solution is actually the same command, but all the dependent table should be comma separated. Something like the below.

SET INTEGRITY for table_a, table_b, table_c immediate checked

Hope this helps!

DB2 SQL Error: SQLCODE=-668. Fixed with SET INTEGRITY

By TY → Tuesday, October 13, 2015

After I migrated my DB2 data to a new machine, I encountered "DB2 SQL Error: SQLCODE=-668".
At first, I thought that I can do a table reorg to fix it.  However, when I issue the reorg command, the same error code -668 was returned.

After some searching, the solution is to set integrity for the affected tables.

1. To find all the affected tables.
select 'set integrity for '||rtrim(tabschema)||'.'||tabname||' immediate checked' from syscat.tables where status = 'C'

2. Copy and paste the generated statements into db2 console.

3. Repeat a few times to clear all the tables so that the SQL from step 1 returns no more row.

Note, you may experience cyclic dependency on your tables that you are not able to clear. You can check out this post on cyclical dependencies and set integrity for db2.

Moving Docker's Directory

By TY → Sunday, October 11, 2015


We have an AWS instance that is running docker images. The AWS instance came with 8 GB of free space and we have mounted another data partition of 100 GB.

However, by default, the docker images are consuming space from within the 8 GB, which will not be sufficient, so we have got to move docker directory to the data partition that was mounted. The following steps worked for me.

  1. Default directory /var/lib/docker
  2. Stop docker service and move docker to data partition (in this case is "/data", you can mount your data partition anywhere, just replace "/data" with what you have)
    $ sudo stop docker
    $ sudo mv /var/lib/docker /data/docker
    
  3. Edit docker config, look for DOCKER_OPTS, add "-g /data/docker". Docker config can be found at /etc/default/docker.

    Final DOCKER_OPTS should be similar to the following:
    $ cat /etc/default/docker
    # Use DOCKER_OPTS to modify the daemon startup options.
    DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -g /data/docker"
    
  4. Start docker service.

JDK8 java.lang.NoClassDefFoundError: com/sun/tools/javac/code/TypeTags

By TY →

Java build fail after update to jdk8 java.lang.NoClassDefFoundError: com/sun/tools/javac/code/TypeTags

Some projects continue to build successfully while some others failed after upgrading JDK.
Looking deeper into it and comparing the projects, those that failed are projects that are using lombok. It has been a while since I have upgraded lombok version. (which was still at 0.XXX)

After downloading the latest version of lombok and rebuild, the build completes successfully!