8. JRE va JDK ni nima farqi bor? JRE – Java Runtime Environment JDK – Java Development Kit JRE bu faqat dastur bajarilishi uchun kerak bo`lgan muhit, xolos. Dasturchi bo`lmagan oddiy foydalanuvchilarga Java dasturlari bajarilishi uchun JRE yetarli. JDK = JRE + dasturlashga oid qo`shimcha instrumentlar. Bu esa dasturchilarga kerak. Formuladan ko`rinib turibdiki, JDK ning hajmi JREdan katta bo`ladi. U bir marta ko`chirib o`rnatiladi xolos.
9. Dunyoda qancha Java dasturchilar bor?
Oracle kompaniyasi tahminan 9 mln desa, Wikipedia 10 mln atrofida demoqda. NumberOf.net komandasi esa 9.007.346 sonini keltirishgan. Albatta bu statistika qaysidir vaqt uchun. Ayni paytda yana o`sib bormoqda. Javada kod yozishga mo`ljallangan Eclipse (bepul) muhiti bir yilni ichida 7 mln marta ko`chirilgan. Eng mashxur web-konteynerlardan biri bo`lgan Tomcat esa oyiga o`rtacha 550 ming, yiliga esa 6.6 mln marta ko`chirilar ekan. Dunyoda qancha odam ishsiz? Ishlilarning qanchasi dasturchi? Dasturchilarning shunchasi Javachi!
10. Nima uchun aynan Javani o`rganamiz?
Hozirgi kunda dasturlash tillari to`g`risidagi ayrim tortishuvlar quloqqa chalinadi. Bu til yaxshi… Yo`q, mana bunisi… Bu tilda qilingan ishni, bunisida qilib bo`lmas emish, mana bunisi eng tezi emish va hokazo. Bular xato fikrlar. Biz dasturlash tillarini imkoniyati haqida tortishayotkan bir paytda, g`arbliklar boshqa galaktikalarni o`rganib, odamni boshini boshqa tanaga ko`chirishni amallashmoqchi! Keling, bu tortishuvga bitta o`zbekona o`xshatish bilan nuqta qo`yamiz. “Lacetti yaxshi… Yo`q Nexia yo`lga zo`r… Malibu qulay va obro`li… Captiva undanam obro`li… Sparkka yetmaydi baribir va hokazo”. Sezganingizdek, bu xato tortishuv. Hammasini o`z o`rni va maqsadi bor. Dasturlash tillari ham shu kabidir. Javaning ham o`z maqsadi bor. Kerak bo`lsa, bir nechta tillardan foydalanib yagona kompleks dastur yozish mumkin.
package juniper.company.rover.components;
import juniper.company.rover.domains.Roles;
import juniper.company.rover.domains.Users;
import juniper.company.rover.repository.RoleRepository;
import juniper.company.rover.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
import java.util.HashSet;
@Component
public class DataLoader implements CommandLineRunner {
@Autowired
UserRepository userRepository;
@Autowired
RoleRepository roleRepository;
@Autowired
PasswordEncoder passwordEncoder;
@Value("${spring.sql.init.mode}")
private String initMode;
@Override
public void run(String... args) throws Exception {
if (initMode.equals("always")) {
Roles roles=new Roles();
roles.setName("ROLE_ADMIN");
roleRepository.save(roles);
Users users=new Users();
users.setName("Elbek");
users.setPassword(passwordEncoder.encode("112233"));
users.setRoles(roleRepository.findAllByName("ROLE_ADMIN"));
userRepository.save(users);
}
}
}
package juniper.company.rover.configuration;
import juniper.company.rover.domains.Users;
import juniper.company.rover.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.stream.Collectors;
@Service
public class MyUserDetailsService implements UserDetailsService {
@Autowired
private UserRepository userRepository;
@Override
public UserDetails loadUserByUsername(String name) throws UsernameNotFoundException {
if (userRepository.existsByName(name)) {
Users users = userRepository.findByName(name);
return
new UserDetails() {
@Override
public Collection extends GrantedAuthority> getAuthorities() {
return users.getRoles().stream().map(roles -> new SimpleGrantedAuthority(roles.getName())).collect(Collectors.toList());
}
@Override
public String getUsername() {
return users.getName();
}
@Override
public String getPassword() {
return users.getPassword();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
};
}
return null;
}
}
package juniper.company.rover.configuration;
import juniper.company.rover.security.JwtRequestFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.cors.CorsUtils;
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
@Lazy
private UserDetailsService userDetailsService;
@Autowired
private JwtRequestFilter jwtRequestFilter;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(getPasswordEncoder());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.requestMatchers(CorsUtils:: isPreFlightRequest).permitAll()
.antMatchers("/api/v1/admin/**").hasRole("ADMIN")
.antMatchers("/api/v1/buyurtmachi/**").hasRole("ADMIN")
.antMatchers("/api/v1/zakaz/**").hasRole("ADMIN")
.antMatchers("/api/v1/user/saveUser").permitAll()
.antMatchers("/api/v1/roles/saveRole").permitAll()
.antMatchers("/api/v1/jwt/createToken").permitAll()
.antMatchers("/api/v1/materialList/**").hasRole("ADMIN")
.and()
.exceptionHandling()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http
.addFilterBefore(jwtRequestFilter, UsernamePasswordAuthenticationFilter.class);
}
@Bean
PasswordEncoder getPasswordEncoder()
{
return new BCryptPasswordEncoder();
}
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
}
1 KOMPANIYA HAQIDA UMUMIY MA'LUMOT
1.1 Korxonaning tuzilishi va qisqacha tavsifi
1.1-jadval - Korxona shaxsiy kompyuter konfiguratsiyasi
Yo'q.
|
Ism
|
Turi
|
bitta
|
Markaziy protsessor
|
Intel Celeron D protsessor 3,06 gigagertsli
|
2
|
Xotira moduli
|
DDR2 480mb PC2_6400
|
3
|
HDD
|
Hitachi seriyali 80 Gb
|
4
|
video karta
|
VIA/S3G UniChrome Pro IGP
|
5
|
Ovoz kartasi
|
Realtek HD audio
|
6
|
LAN kartasi
|
PALIT
|
7
|
Monitor
|
SamsungSyncmaster
|
sakkiz
|
Klaviatura
|
Sven slim 303
|
to'qqiz
|
Sichqoncha
|
SWOP-35
|
IP Shinshikov A.M. shaxsiy kompyuteriga quyidagi dastur o'rnatilgan :
Kasperskiy antivirusi ; _
WinRar - arxivlovchi;
Microsoft Office 2007 - ofis to'plami ;
GoogleChrome - veb-brauzer ;
Ilova paketlarining ishlashi:
Arxiv dasturlari ( WinRar );
Grafik muharriri ( Paint );
Elektron jadvallar ( MicrosoftExcel );
Ma'lumotlar bazasini boshqarish tizimlari (DBMS) ( MicrosoftAccess );
Musiqa muharrirlari ( WindowsMedia ) va boshqalar.
Do'stlaringiz bilan baham: |