Ckeditor Ckfinder https 沒法瀏覽伺服

本日把http轉成https


到後台編纂時發現沒法瀏覽伺服器及上傳圖片


Ckeditor Ckfinder https 沒法瀏覽伺服


到ckeditor目次下,找到config.js

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設

利用Highcharts實現柱狀圖、餅狀圖、曲線圖三圖合一

在數據統計和闡發業務中,有時會碰到客戶需要在一個圖表中將柱狀圖、餅狀圖、曲線圖的都表現出來,便可以從柱狀圖中看出具體數據、又能從曲線圖中看出變化趨向,還能從餅狀圖中看出各部份數據比重。Highcharts可以輕鬆實現三圖合一的結果。

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設
有時辰會需要寫PHP程式去取得指定資料夾內的檔案列表,這三個函式分別是glob、scandir、readdir
 
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設

在搜尋引擎不斷改版網頁不得不進入https
所今後台編纂器圖片上傳也變得不克不及用了
不得已又請教了谷哥大神
多方嘗試後,找到
CKeditor 4.11.1 網頁編輯器與CKfinder 2.6.2.1 圖片上傳可以用

CKeditor 4.11.1 網頁編纂器與CKfinder
CKeditor 4.11.1 網頁編纂器與CKfinder

檔案下載了今後,籠蓋之前檔案
找到 ckeditor/config.js

  1. CKEDITOR.editorConfig = function( config ) {
  2.         // Define changes to default configuration here. For example:
  3.         // config.language = 'fr';
  4.         // config.uiColor = '#AADC6E';
  5. }
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

範例圖片
用jquery做相册

網站架設用jquery做相册



CSS網站架設
  1. body{ text-align:center;}
  2. *{ margin:0; padding:0;}
  3. img{ border:none;}
  4. #container{ width:900px; height:900px; background:#000000; border:1px solid #006633; margin:auto; padding:0;}
  5. #loader{ width:480px; margin:auto; height:500px; background:#FFFFFF; float:left; margin-right:5px;}
  6. #imageOptions{ float:left;}
  7. #imageOptions li{ list-style:none; margin:10px;}
  8. .loading{ background:url(images/spinner.gif) center center no-repeat;}
  9. h3{ line-height:500px;}
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

因搜索引擎改版,網站不能不改https
當網站安裝了SSL後,如何把網址主動轉成https?

在網頁目次-public_html,有一個檔案叫 .htaccess,編纂檔案內容,然後將以下轉向的規則寫在裡面:

寫法1:

  1. RewriteCond %{HTTPS} off
  2. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

在測試 mnist 數字辨識時

代碼起原
https://hackmd.io/@Maxlight/SkuYB0w6_#3-hyperparameter
 

網站架設
  1. import torch
  2. from torch.utils import data as data_
  3. import torch.nn as nn
  4. from torch.autograd import Variable
  5. import matplotlib.pyplot as plt
  6. import torchvision
  7. import os
  8.  
  9. EPOCH = 1
  10. BATCH_SIZE = 50
  11. LR = 0.001
  12. DOWNLOAD_MNIST = False
  13.  
  14. train_data = torchvision.datasets.MNIST(root = './mnist',train = True,transform = torchvision.transforms.ToTensor(),download = DOWNLOAD_MNIST)
  15.  
  16. print(train_data.train_data.size())
  17. print(train_data.train_labels.size())
  18. plt.ion()
  19. for i in range(11):
  20.   plt.imshow(train_data.train_data[i].numpy(), cmap = 'gray')
  21.   plt.title('%i' % train_data.train_labels[i])
  22.   plt.pause(0.5)
  23. plt.show()
  24.  
  25. train_loader = data_.DataLoader(dataset = train_data, batch_size = BATCH_SIZE, shuffle = True,num_workers = 2)
  26.  
  27. test_data = torchvision.datasets.MNIST(root = './mnist/', train = False)
  28. test_x = torch.unsqueeze(test_data.test_data, dim = 1).type(torch.FloatTensor)[:2000]/255.
  29. test_y = test_data.test_labels[:2000]
  30.  
  31. class CNN(nn.Module):
  32.   def __init__(self):
  33.     super(CNN, self).__init__()
  34.     self.conv1 = nn.Sequential(
  35.         nn.Conv2d(in_channels = 1, out_channels = 16, kernel_size = 5, stride = 1, padding = 2,),# stride = 1, padding = (kernel_size-1)/2 = (5-1)/2
  36.         nn.ReLU(),
  37.         nn.MaxPool2d(kernel_size = 2),
  38.     )
  39.     self.conv2 = nn.Sequential(
  40.         nn.Conv2d(16, 32, 5, 1, 2),
  41.         nn.ReLU(),
  42.         nn.MaxPool2d(2)
  43.     )
  44.     self.out = nn.Linear(32*7*7, 10)
  45.  
  46.   def forward(self, x):
  47.     x = self.conv1(x)
  48.     x = self.conv2(x)
  49.     x = x.view(x.size(0), -1)
  50.     output = self.out(x)
  51.     return output, x
  52.  
  53. cnn = CNN()
  54. print(cnn)
  55.  
  56. optimization = torch.optim.Adam(cnn.parameters(), lr = LR)
  57. loss_func = nn.CrossEntropyLoss()
  58.  
  59. for epoch in range(EPOCH):
  60.   for step, (batch_x, batch_y) in enumerate(train_loader):
  61.     bx = Variable(batch_x)
  62.     by = Variable(batch_y)
  63.     output = cnn(bx)[0]
  64.     loss = loss_func(output, by)
  65.     optimization.zero_grad()
  66.     loss.backward()
  67.     optimization.step()
  68.  
  69.     if step % 50 == 0:
  70.         test_output, last_layer = cnn(test_x)
  71.         pred_y = torch.max(test_output, 1)[1].data.numpy()
  72.         accuracy = float((pred_y == test_y.data.numpy()).astype(int).sum()) / float(test_y.size(0))
  73.         print('Epoch: ', epoch, '| train loss: %.4f' % loss.data.numpy(), '| test accuracy: %.2f' % accuracy)
  74.  
  75. test_output, _ = cnn(test_x[:10])
  76. pred_y = torch.max(test_output, 1)[1].data.numpy()
  77. print(pred_y, 'prediction number')
  78. print(test_y[:10].numpy(), 'real number')
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設 帶排序功能的js masonry瀑布流插件

網站架設 帶排序功能的js masonry瀑布流插件

網站架設 查看演示  下載檔案


扼要教程
sortableJs是一款帶排序功能的js masonry瀑布流插件。sortableJs能夠使元素以卡片情勢顯示,並以masonry瀑布流體式格局進行結構,經由過程點擊分類按鈕,可以將卡片按指定的方式動態排序。

利用方式
在頁面中引入sortable.min.css和sortable.min.js文件。
  1. <link rel="stylesheet" href="path/to/sortable.min.css">
  2. <script src="path/to/sortable.min.js"></script>  
  3.  
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

不管是使用無名、Pixnet、Xuite或Wordpress...等平台,在治理後台新增文章,都邑有一個很像Word的編纂器,透過此編纂器便可輕鬆撰寫文章,而且還可以加粗體變換字體顏色超保持....與圖片上傳等功能,即便完全不懂任何的HTML語法,也可編纂出一個漂亮的文章頁面出來,而且邊製作還會邊顯示後果,這是個相當利便的功能,而這麼棒的功能難不成要自已寫,寫完不只天黑可能都爆肝了,所以要多加善用資源,今天梅干就來分享一個好用的即見即所得HTML文章編纂器CKeditor,與CKfinder上傳元件讓編纂器不只單單可編輯,同時還可上傳檔案乃至直瀏覽伺器服中的檔案,且完全不消寫任何的程式碼,只要設定一下,當即就打造自已專屬的文章編纂器囉!
 

CKeditor(編纂器)/CKfinder(上傳元件)下載:
編纂器:CKeditor
支援語法:PHP、ASP、ASP.NET、CF
元件版本:4.4.5
官方展現:http://ckeditor.com/demo
官方下載:http://ckeditor.com/download

上傳元件:CKfinder
支援語法:PHP、ASP、ASP.NET、CF
元件版本:2.4
官方展示:http://ckfinder.com/demo
官方下載:http://ckfinder.com/download
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

起首可以到FPDF網站下載程式,固然FPDF的網站有教學也值得前去觀看http://www.fpdf.org/

或直接點選這邊下載fpdf16.zip

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()