Latest Added Tutorials
Certificate create operation as follows:
1. Create v3.ext file having following content:
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = TW
ST = Taiwan
L = Taipei
O = CR
OU = It
CN = html_12
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1=html_12
2. run command
openssl req -new -newkey rsa:2048 -sha256 -days 3650 -nodes -x509 -keyout server.key -out server.crt -config v3.ext -extensions v3_req
3...Continue Reading
13-07-2017
[Route("api/[controller]")]
public class HomeController : Controller
{
private readonly IStringLocalizer<HomeController> _localizer;
public HomeController(IStringLocalizer<HomeController> localizer)
{
_localizer = localizer;
}
[HttpGet("index/{id}")]
public IActionResult Index()
{
return new ObjectResult(_localizer["Hello"]);
}
}
Add Resources folder then, add Controllers.HomeController.tr-TR.resx and Controllers.HomeController.en-EN....Continue Reading
13-06-2017
Category table:
id
adi
url
parent
1
Elektronik
elektronik
NULL
2
Laptop
laptop
1
We can use following codes to extract parent->child category array:
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$categories = DB::table('kategori as k1')
->join('kategori as k2', 'k1.id', '=', 'k2.parent')
->select('k1.adi as parent_adi', 'k1.url as parent_url', 'k2.adi as child_adi', 'k2.url as child_url')
->get();
$parents = array()...Continue Reading
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/TekPencereTest.wsdl</wsdl>...Continue Reading
05-01-2017
Saving base64 encoding string as file, we can use following codes:
Function SaveToBase64 (base64String)
Set Doc = Server.CreateObject("MSXML2.DomDocument")
Set nodeB64 = Doc.CreateElement("b64")
nodeB64.DataType = "bin.base64"
nodeB64.Text = Mid(base64String, InStr(base64String, ",") + 1)
dim bStream
set bStream = server.CreateObject("ADODB.stream")
bStream.type = 1
call bStream.Open()
call bStream.Write( nodeB64.NodeTypedValue )
call bStream.SaveToFile("e:\test.jpg", 2 )
call bStream.close()
set bStre...Continue Reading
08-12-2016
Add .htaccess file into the root directory if not exist and put following codes:
#path/to/project/.htaccess
# Rewrite all requests to subdirectory, except exists file requests
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /web/$1 [QSA,L]
And then modify .htaccess file in the web folder as follows:
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{...
Symfony virtual host configuration in Jelastic Server as follows:
<VirtualHost *:80>
ServerName domain.tld
ErrorLog logs/dummy-host.jelastic.com-error_log
CustomLog logs/dummy-host.jelastic.com-access_log common
DocumentRoot /var/www/webroot/ROOT/web
<Directory /var/www/webroot/ROOT/web>
AllowOverride None
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteR...Continue Reading
22-10-2016
Symfony 3 Configuration in httpd.conf After this configuration we can access the site at http://localhost:8090
<VirtualHost *:8090>
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot C:/xampp/htdocs/symfony/urunTakipSistemi/web
<Directory C:/xampp/htdocs/symfony/urunTakipSistemi/web>
AllowOverride None
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
Rewri...Continue Reading
Apache JMeter get current sampler as follows:
String currentURL = ctx.getCurrentSampler().getUrl().getHost();//accessing current URL
name = vars.get("takipKodu");//regex variable named as takipKodu
// Pass true if you want to append to existing file
// If you want to overwrite, then don't pass the second argument
f = new FileOutputStream(currentURL+".txt", true);
p = new PrintStream(f);
this.interpreter.setOut(p);
print(name);
f.close();...Continue Reading
03-09-2015
The main purpose of this project is to avoid infamous change -> restart and wait -> check development lifecycle. Save&Reload during development should be standard and many other languages (including C#) contain this feature
Currently Tomcat 8.0.23 version is supported.
Before using Hotswap Agent in Tomcat, please visit HotswapAgent web page to install: https://github.com/HotswapProjects/HotswapAgent
Lastly add -XXaltjvm=dcevm -javaagent:C:\Users\myuce\Desktop\hotswap-agent.jar JVM parameters ass follows:
...Continue Reading
To improve performance a JSP application running on Tomcat server, we have to change some configurations in Tomcat.
1. Disable auto deploy feature false in conf/server.xml file in Tomcat location:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false">
2. Change jsp servlet configuration settings located in conf/web.xml file in Tomcat location:
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<...Continue Reading
24-07-2015
The request.setCharacterEncoding("UTF-8"); only sets the encoding of the request body (which is been used by POST requests), not the encoding of the request URI (which is been used by GET requests).
You need to set the URIEncoding attribute to UTF-8 in the <Connector> element of Tomcat's /conf/server.xml to get Tomcat to parse the request URI (and the query string) as UTF-8. This indeed defaults to ISO-8859-1. See also the Tomcat HTTP Connector Documentation.
<Connector ... URIEncoding="UTF-8">
See also:
Unicode -...Continue Reading
10-06-2015
Jsp Page
In Jsp, there is no break element to break foreach loop, so we have used begin, end and var attributes. When parentPage is null, then count variable will be set to end attribute value to break foreach loop as follows:
<section class="in_sec_nrd">
<article class="art_loop_nrd">
Where I am:
<c:forEach begin="0" end="100" var="count">
<c:if test="${not empty parentPage}">
<a title="${parentPage.title}" href="<c:url value="/content/${parentPage.url}" />">
${par...Continue Reading
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="com.codesenior.telif.local.model"/>
<property name="hibernateProperties">
<props>
13-02-2015
If you design mobile web application, your layout should look like as follows:
Css:
//you can use other html elements that needs word-wrap
h1,h2,h3,h4,p,span,label{
word-wrap: break-word;
}
.page {
height: 100%;
padding: 10px;
}
.topic {
text-align: justify;
}
Html:
<div class='page'">
<div class='topic'>
<!--other html elements-->
</div>
</div>...Continue Reading