Kisi-kisi Soal UTS dan UAS Elektronika Beserta Jawaban

SOAL A 1) Berikut ini yang termasuk komponen elektronika dengan jenis komponen pasif yaitu ....

Kisi-kisi Soal UTS dan UAS Sistem Terdistribusi Beserta Jawaban

SOAL A 1. Berikut ini yang merupakan karakteristik dari definisi sistem terdistribusi adalah ....

Remove Bios Password and Harddissk (HDD) Laptop

I think to remove the bios password on an average PC is already can, although without having to memorize the password. the system jumpers or removing battery bios. ever see a supervisor, admin, system, HDD, bios, setup password?

Memperbaiki Kick Starter Motor Matic

Motor Matic is a motor that is the easiest to use and most in our homeland. please note that the motor also takes care of very sensitive, just like a computer that also takes care of sensitive anyway.

Gejala Kerusakan Mesin Air Submersible Metabo

Mesin Air Submersible atau yang sering disebut kebanyakan orang (satelit) ini sangat bagus, dengan sistemnya yang canggih dan fleksible. tipe mesin yang berbasis kerja di dalam tanah dan hanya menggunakan satu pipa ini, sangat berguna untuk anda yang memiliki banyak lumpur atau air kuning setelah pengeboran.

Showing posts with label Laravel. Show all posts
Showing posts with label Laravel. Show all posts

02 February 2020

How to fix base url in framework

We can set the base url or url in our framework to be automatically without change it wherever you want to place it in htdocs or localhost.

In CodeIgneter we will set it in application/config/config.php

Place this

$root = "http://".$_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

$config['base_url']    = "$root";

//$config[base_url] = "http://localhost/";

In Laravel we will set it in config/app.php

$root = "http://".$_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
return [
    'debug' => env('APP_DEBUG', false),
    //'url' => 'http://localhost',
      'url' => $root,
.......


So this is easy to fix all problem in your drive/ PC and your hosting wherever you want.

Share:

Install Laravel 5.0 and Whoops, looks like something went wrong

You have any problem with composer install in laravel-master for Laravel 5. Please follow this:

F:\xampp\htdocs\master\laravel-master>composer install
←[32mLoading composer repositories with package information←[39m
←[32mUpdating dependencies (including require-dev)←[39m
←[32mPackage operations: 59 installs, 0 updates, 0 removals←[39m
  - Installing ←[32msymfony/css-selector←[39m (←[33mv3.3.6←[39m): Loading from c
ache
  - Installing ←[32mtijsverkoyen/css-to-inline-styles←[39m (←[33m2.2.0←[39m): Lo
ading from cache
  - Installing ←[32mdoctrine/inflector←[39m (←[33mv1.1.0←[39m): Loading from cac
he
  - Installing ←[32msymfony/polyfill-mbstring←[39m (←[33mv1.5.0←[39m): Loading f
rom cache
  - Installing ←[32msymfony/var-dumper←[39m (←[33mv3.3.6←[39m): Loading from cac
he
  - Installing ←[32mjakub-onderka/php-console-color←[39m (←[33m0.1←[39m): Loadin
g from cache
  - Installing ←[32mjakub-onderka/php-console-highlighter←[39m (←[33mv0.3.2←[39m
): Loading from cache
  - Installing ←[32mdnoegel/php-xdg-base-dir←[39m (←[33m0.1←[39m): Loading from
cache
  - Installing ←[32mnikic/php-parser←[39m (←[33mv3.1.0←[39m): Loading from cache

  - Installing ←[32mpsr/log←[39m (←[33m1.0.2←[39m): Loading from cache
  - Installing ←[32msymfony/debug←[39m (←[33mv3.3.6←[39m): Loading from cache
  - Installing ←[32msymfony/console←[39m (←[33mv3.3.6←[39m): Loading from cache
  - Installing ←[32mpsy/psysh←[39m (←[33mv0.8.11←[39m): Loading from cache
  - Installing ←[32mvlucas/phpdotenv←[39m (←[33mv2.4.0←[39m): Loading from cache

  - Installing ←[32msymfony/routing←[39m (←[33mv3.3.6←[39m): Loading from cache
  - Installing ←[32msymfony/process←[39m (←[33mv3.3.6←[39m): Loading from cache
  - Installing ←[32msymfony/http-foundation←[39m (←[33mv3.3.6←[39m): Loading fro
m cache
  - Installing ←[32msymfony/event-dispatcher←[39m (←[33mv3.3.6←[39m): Loading fr
om cache
  - Installing ←[32msymfony/http-kernel←[39m (←[33mv3.3.6←[39m): Loading from ca
che
  - Installing ←[32msymfony/finder←[39m (←[33mv3.3.6←[39m): Loading from cache
  - Installing ←[32mswiftmailer/swiftmailer←[39m (←[33mv5.4.8←[39m): Loading fro
m cache
  - Installing ←[32mparagonie/random_compat←[39m (←[33mv2.0.10←[39m): Loading fr
om cache
  - Installing ←[32mramsey/uuid←[39m (←[33m3.7.0←[39m): Loading from cache
  - Installing ←[32msymfony/translation←[39m (←[33mv3.3.6←[39m): Loading from ca
che
  - Installing ←[32mnesbot/carbon←[39m (←[33m1.22.1←[39m): Loading from cache
  - Installing ←[32mmtdowling/cron-expression←[39m (←[33mv1.2.0←[39m): Loading f
rom cache
  - Installing ←[32mmonolog/monolog←[39m (←[33m1.23.0←[39m): Loading from cache
  - Installing ←[32mleague/flysystem←[39m (←[33m1.0.41←[39m): Loading from cache

  - Installing ←[32merusev/parsedown←[39m (←[33m1.6.3←[39m): Loading from cache
  - Installing ←[32mlaravel/framework←[39m (←[33mv5.4.33←[39m): Loading from cac
he
  - Installing ←[32mlaravel/tinker←[39m (←[33mv1.0.2←[39m): Loading from cache
  - Installing ←[32mfzaninotto/faker←[39m (←[33mv1.7.1←[39m): Loading from cache

  - Installing ←[32mhamcrest/hamcrest-php←[39m (←[33mv1.2.2←[39m): Loading from
cache
  - Installing ←[32mmockery/mockery←[39m (←[33m0.9.9←[39m): Loading from cache
  - Installing ←[32msymfony/yaml←[39m (←[33mv3.3.6←[39m): Loading from cache
  - Installing ←[32msebastian/version←[39m (←[33m2.0.1←[39m): Loading from cache

  - Installing ←[32msebastian/resource-operations←[39m (←[33m1.0.0←[39m): Loadin
g from cache
  - Installing ←[32msebastian/recursion-context←[39m (←[33m2.0.0←[39m): Loading
from cache
  - Installing ←[32msebastian/object-enumerator←[39m (←[33m2.0.1←[39m): Loading
from cache
  - Installing ←[32msebastian/global-state←[39m (←[33m1.1.1←[39m): Loading from
cache
  - Installing ←[32msebastian/exporter←[39m (←[33m2.0.0←[39m): Loading from cach
e
  - Installing ←[32msebastian/environment←[39m (←[33m2.0.0←[39m): Loading from c
ache
  - Installing ←[32msebastian/diff←[39m (←[33m1.4.3←[39m): Loading from cache
  - Installing ←[32msebastian/comparator←[39m (←[33m1.2.4←[39m): Loading from ca
che
  - Installing ←[32mdoctrine/instantiator←[39m (←[33m1.0.5←[39m): Loading from c
ache
  - Installing ←[32mphpunit/php-text-template←[39m (←[33m1.2.1←[39m): Loading fr
om cache
  - Installing ←[32mphpunit/phpunit-mock-objects←[39m (←[33m3.4.4←[39m): Loading
 from cache
  - Installing ←[32mphpunit/php-timer←[39m (←[33m1.0.9←[39m): Loading from cache

  - Installing ←[32mphpunit/php-file-iterator←[39m (←[33m1.4.2←[39m): Loading fr
om cache
  - Installing ←[32msebastian/code-unit-reverse-lookup←[39m (←[33m1.0.1←[39m): L
oading from cache
  - Installing ←[32mphpunit/php-token-stream←[39m (←[33m1.4.11←[39m): Loading fr
om cache
  - Installing ←[32mphpunit/php-code-coverage←[39m (←[33m4.0.8←[39m): Loading fr
om cache
  - Installing ←[32mwebmozart/assert←[39m (←[33m1.2.0←[39m): Loading from cache
  - Installing ←[32mphpdocumentor/reflection-common←[39m (←[33m1.0←[39m): Loadin
g from cache
  - Installing ←[32mphpdocumentor/type-resolver←[39m (←[33m0.3.0←[39m): Loading
from cache
  - Installing ←[32mphpdocumentor/reflection-docblock←[39m (←[33m3.2.2←[39m): Lo
ading from cache
  - Installing ←[32mphpspec/prophecy←[39m (←[33mv1.7.0←[39m): Loading from cache

  - Installing ←[32mmyclabs/deep-copy←[39m (←[33m1.6.1←[39m): Loading from cache

  - Installing ←[32mphpunit/phpunit←[39m (←[33m5.7.21←[39m): Loading from cache
symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/console suggests installing symfony/filesystem ()
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsyS
H a lot happier :))
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSI
X extension as well.)
psy/psysh suggests installing ext-readline (Enables support for arrow-key histor
y navigation, and showing and manipulating command history.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to
 work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. Y
ou'll want this if your PHP install doesn't already support readline or libedit.
)
symfony/routing suggests installing doctrine/annotations (For using the annotati
on loader)
symfony/routing suggests installing symfony/config (For using the all-in-one rou
ter or any loader)
symfony/routing suggests installing symfony/dependency-injection (For loading ro
utes from a service)
symfony/routing suggests installing symfony/expression-language (For using expre
ssion matching)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/class-loader ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
paragonie/random_compat suggests installing ext-libsodium (Provides a modern cry
pto API that can be used to generate random bytes.)
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use
 with the RandomLibAdapter)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium exten
sion for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for u
se with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting
UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\U
uid\Uuid as Doctrine field type.)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for g
enerating UUIDs with ramsey/uuid)
symfony/translation suggests installing symfony/config ()
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages
to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages
 to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an A
MQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a M
ongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log message
s to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages
to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log m
essages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log m
essages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages
to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages
to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to
 a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to u
se S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to u
se S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use W
indows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem
adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allo
ws you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to u
se Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SF
TP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use
WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to
use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use
 Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you t
o use Dropbox storage for PHP 5 applications)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS q
ueue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns
and drop SQLite columns (~2.5).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mai
lgun and Mandrill mail drivers and the ping methods on schedules (~6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to us
e the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to us
e the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo tr
ansport (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanst
alk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis c
ache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use
the Pusher broadcast driver (~2.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most
of the crawler integration testing tools (~3.2).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required
to psr7 bridging features (0.2.*).)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.1)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
←[32mWriting lock file←[39m
←[32mGenerating optimized autoload files←[39m
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
←[32mGenerating optimized class loader←[39m
←[32mThe compiled services file has been removed.←[39m


so in you browser show
Whoops, looks like something went wrong


This the trick about that

copy the .env.example to .env
I propose to use the editor to make it easy.
make sure APP_ENV=local is in there
It should then show you the detailed error messaging.

So after that you will know the problem is about
(1/1) RuntimeException The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Then you must write in terminal with

php artisan key:generate

F:\xampp\htdocs\master\laravel-master>php artisan key:generate
←[32mApplication key [base64:yW7slxavrbUFOqpndxTdJODZNyS/151uaZ9PWI/yGZ0=] set s
uccessfully.←[39m

Share:

How to fix You can also run `php --ini` inside terminal to see which files are used by PH P in CLI mode

You have any problem with this since install laravel with composer install, let's see

  Problem 1
    - intervention/image 2.4.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.9 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.8 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.7 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.6 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.5 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.4 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.3 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.2 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.14 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.3.13 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.3.12 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.3.11 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.3.10 requires ext-fileinfo * -> the requested PHP ext
ension fileinfo is missing from your system.
    - intervention/image 2.3.1 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.3.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.2.2 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.2.1 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - intervention/image 2.2.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
    - Installation request for intervention/image ~2.2 -> satisfiable by interve
ntion/image[2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.10, 2.3.11, 2.3.12, 2.3.13, 2
.3.14, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9, 2.4.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - F:\xampp\php\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PH
P in CLI mode.



This you must to go to your php.ini and edit it in commented line:
; Laravel drop comment
extension=php_fileinfo.dll

drop the comment in
;extension=php_fileinfo.dll
to be
extension=php_fileinfo.dll

Then save it and go again with composer install in you directory with terminal or cmd
Share:

How To Make String, Char, Varchar To be Auto Increment in MySQL with PHP

Making varchar or string or char to be automatically add as auto increment, is't impossible?

Yah inilah yang dicari-cari selama ini jika anda ingin menambahkan atau membuat primary key dalam table dari tipe data char/ varchar/ string lalu ingin menjadikannya otomatis layaknya auto increment, berikut ini adalah salah satu contoh jika anda membuat primary key secara otomatis menambahkan kode sesuai dengan keinginan kita atau sering disebut dengan custom.

Kita asumsikan membuat ini dengan Framework dengan memiliki 1 tabel dengan format berikut:

CREATE TABLE `tb_supplier` (
  `id_supplier` char(5) NOT NULL,
  `nm_supplier` varchar(20) DEFAULT NULL,
  `no_hp` varchar(12) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id_supplier`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of tb_supplier
-- ----------------------------
INSERT INTO `tb_supplier` VALUES ('S0001', 'Supervisor', '1238123', 'email@gmail.com');
INSERT INTO `tb_supplier` VALUES ('S0002', 'minyak', '08998600083', 'justpoypoy@gmail.com');




kemudian buatlah sebuah class dalam Models seperti ini

function kodebaru() {
        $q = $this->db->query("SELECT id_supplier, substr(id_supplier, 2, 4) as id_baru FROM tb_supplier ORDER BY id_supplier DESC LIMIT 1") -> row();
        if(!empty($q)){
            $f = str_replace($q->id_supplier, 'S', '5.'.$q->id_baru);
            $b = (float)$f+0.0001;
            if(strlen(utf8_decode($b))==6){
                $k = substr($b,2,4);
            }else if(strlen(utf8_decode($b))==5){
                $t = str_replace($b, $b, $b.'0');
                $k = substr($t,2,4);
            }else if(strlen(utf8_decode($b))==4){
                $t = str_replace($b, $b, $b.'00');
                $k = substr($t,2,4);
            }else if(strlen(utf8_decode($b))==3){
                $t = str_replace($b, $b, $b.'000');
                $k = substr($t,2,4);
            }else{
                $k = 'err';
            }
         
            $kb = 'S'.$k;
        }else{
            $kb = 'S0001';
        }
        return $kb;
        }



Setelah itu masukkan dalam Controllers

          $this->data['row']   = $this -> M_supplier -> kodebaru();
          $this -> load -> view('your template',$this -> data);


Yang paling terakhir masukkan dalam Views untuk form tambah atau Add seperti ini


               
               



Dan hasilnya pasti akan sesuai dengan format yang ada, alasan kenapa menggunakan float yaitu titik beratnya pada banyaknya nol yang harus selalu ada. jika dirubah dengan integer maka nol tersebut akan hilang, kemudian ada rules tambahan yang membuatnya sempurna.
Semoga dapat bermanfaat.

Call us to make it's easy for making web. Thank you
Share:

Blog Archive