วันพฤหัสบดีที่ 26 กุมภาพันธ์ พ.ศ. 2558
elfinder Browser file use getFileCallback [worked]
elfinder Browser file use getFileCallback
//html
//script
$('#select-button').click(function () {
var f = $('#elfinder').elfinder({
url: '/connector', // connector route defined in \App_Start\RouteConfig.cs
lang: 'en',
onlyMimes: ["image"], // display all images
customData: { folder: "teacher", subFolder: null },
height: 490,
docked: false,
dialog: { width: 400, modal: true },
closeOnEditorCallback: true,
getFileCallback: function (url) {
console.log(url.url);
$('#new_file').val(url.url);
// CLOSE ELFINDER HERE
$('#elfinder').remove(); //remove Elfinder
location.reload(); //reload Page for second selection
}
}).elfinder('instance');
});
});
link: http://stackoverflow.com/questions/20400817/close-elfinder-programatically-after-file-selection?answertab=active#tab-top
วันจันทร์ที่ 16 กุมภาพันธ์ พ.ศ. 2558
c# Grade Calculator (Using List Object)
ไม่มีความคิดเห็น:
Posted by
Aagkasit Tontan
at
02:37
Labels:
c#,
Grade Calculator,
Grade Calculator Custom,
Grade Calculator Dynamic,
List,
List Object
//Code
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GradeCalculatorUsingListObject { class Program { static void Main(string[] args) { //add list Grade Listls = new List (); ls.Add(new Grades(49f, "F")); ls.Add(new Grades(49.5f, "D")); ls.Add(new Grades(55f, "D+")); ls.Add(new Grades(60f, "C")); ls.Add(new Grades(65f, "P")); ls.Add(new Grades(70f, "B")); ls.Add(new Grades(75f, "B+")); ls.Add(new Grades(80f, "A")); // //float point = 49f; Console.WriteLine("49.5f : grade : " + CalGrade(49.5f, ls)); Console.WriteLine("0 : grade : " + CalGrade(0, ls)); Console.WriteLine("72 : grade : " + CalGrade(72, ls)); Console.WriteLine("70 : grade : " + CalGrade(70, ls)); Console.WriteLine("43 : grade : " + CalGrade(43, ls)); Console.WriteLine("28 : grade : " + CalGrade(28, ls)); Console.WriteLine("97 : grade : " + CalGrade(97, ls)); Console.WriteLine("23 : grade : " + CalGrade(23, ls)); Console.WriteLine("84 : grade : " + CalGrade(84, ls)); Console.WriteLine("64 : grade : " + CalGrade(64, ls)); Console.WriteLine("72 : grade : " + CalGrade(74, ls)); Console.ReadLine(); } public static string CalGrade(float point, List list) { //int[] arr = { 800, 11, 50, 771, 649, 770, 240, 9 }; int current = 0; int next = 0; for (int write = 0; write < list.Count - 1; write++) { current = write; next = current + 1; //55 <= 56 <= 60 if (list[current].score <= point && point <= list[next].score) { if (list[current].score >= point) { return list[current].grade; } else if (list[next].score <= point) { return list[next].grade; } else if (list[next].score >= point) { return list[current].grade; } } else if (list[current].score > point) { return list[current].grade; } else if (list[current].score <= point && point >= list[next].score) { if (current == (list.Count - 2)) { return list[current + 1].grade; } } } return null; } public class Grades { public float score { set; get; } public string grade { set; get; } public Grades(float score, string grade) { this.score = score; this.grade = grade; } } } }
download code full : https://www.dropbox.com/s/1e41ezbnxl0i5r0/GradeCalculatorUsingListObject.rar?dl=0
Asp.net Mvc4 Could not load file or assembly 'WebGrease"
ไม่มีความคิดเห็น:
Posted by
Aagkasit Tontan
at
00:38
Labels:
Asp.net Mvc4,
Could not load file or assembly
Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
answer worked : http://stackoverflow.com/questions/19851912/could-not-load-file-or-assembly-webgrease-version-1-5-1-25624-culture-neutral
answer worked : http://stackoverflow.com/questions/19851912/could-not-load-file-or-assembly-webgrease-version-1-5-1-25624-culture-neutral
สมัครสมาชิก:
บทความ (Atom)