2019-10-01
Crop Image in C#
var img = Image.FromFile("screenshot.png");
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(new Rectangle(1370, 340, 200, 140), bmpImage. //width distance, height distance, new share width, new shape height
PixelFormat);
bmpCrop.Save("12.jpg");
2019-04-01
How to Avoid Disk100% for Utorrent
1. Make sure you are using uTorrent 2.2.1, because that's the most stable and most allowed torrent client on every torrent site. You can download it from http://utorrent.hu/download/utorrent-2-2-1-2/
2. Open the uTorrent settings (CTRL+P)
3. Tick the preallocate files button and untick all the updating and data sending related things
4. Go to advanced settings
5. Set bt.prio_first_last_piece to true
6. Set diskio.coalesce_write_size to 8388608
7. Set diskio.flush_files to false
8. Set diskio.sparse_files to true
9. Go to cache settings
10. Tick the override default cache, and set the cache size to 368MB
11. Apply and save the settings
12. After restarting uTorrent you will see way less or maybe absolutely no disk overload issues anymore
2018-12-10
Hide IISExpress/Run IIS Express at Background
-----
Dim App,Site------
Site = "BlogMVC"
If Len(Site) < 1 Then
Site = WScript.Arguments(0)
End If
App = """%PROGRAMFILES%\IIS Express\iisexpress""" & _
" /site:" & Site
If Len(Site) > 0 Then
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run App, 0
Set WshShell = Nothing
End If
AND RUN!
2018-07-27
Call Divert Setting
It is available in settings menu of different phone morever you can call on a number provided by service provider to divert calls.
Anyways you can try below numbers as per requirements.
Call diversion when busy:
**67*number#
Divert to the given number
#67#
deactivate call diversion
##67#
Erase call diversion
*#67#
Request status for call diversion
Call diversion in case the handset is turned off or has not coverage:
**62*number#
Divert to the given number
#62#
deactivate call diversion
##62#
Erase call diversion
*#62#
Request status for call diversion
Call diversion for not responding
**61*number**x#
Divert to the given number aber x seconds (x=5,10,15,20,25,30)
#61#
Deactivate call diversion
##61#
Erase call diversion
*#61#
Request status of call diversion
Call diversion for all conditions above:
*#004*number#
Divert to the given number
#004#
Deactivate call diversion
##004#
Erase call diversion
*#004#
Request status for call diversion
Always divert:
*#21*number#
Always divert to given number
#21#
Deactivate call diversion
##21#
Erase call diversion
*#21#
Request status for call diversion
Erase all call diversions:
##002#[dial]
Remove all call diversions
2018-04-24
Getting Current Controller/Action in MVC
@{
var controller = ViewContext.RouteData.GetRequiredString("controller");
var action = ViewContext.RouteData.GetRequiredString("action");
}
https://stackoverflow.com/questions/6398189/getting-current-controller-action-from-within-partial-view
Click Once, Sort by Name, Click Twice Sort by Desc in MVC
ViewBag.NameSortParm = sortOrder == "name" ? "name_desc" : "name";
// Rest of your sortOrder param goes here...
var persons = from s in db.PRT_FEE_PRICES
select s;
switch (sortOrder)
{
case "name":
persons = persons.OrderBy(s => s.NAME);
break;
case "name_desc":
persons = persons.OrderByDescending(s => s.NAME);
break;
// ...
}
2018-04-22
Question: How to pass dot parameter to id in MVC
Solution:
Add following in Web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
https://stackoverflow.com/questions/32392776/can-i-pass-dot-as-parameter-to-id-in-controller-method-in-mvc
Setup VNC on Ubuntu 20.04
sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install tigervnc-standalone-server sudo apt install tightvncserver vncserver...
-
sleep 10 && xset dpms force off ps -aux sudo lsof -i:3389 ssh -L 3389:localhost:5900 -C -N -l rocky localhost sudo iptables -t nat -...
-
Java学习路线排列 第一部分:JavaSE-筑基、结丹Java零基础教程视频(适合Java 0基础,Java初学入门) https://www.bilibili.com/video/BV1Rx411876f 数据结构与算法_适合零基础学习数据结构与算法 https://www...
-
sudo apt update Chrome https://www.google.com/chrome/ DoubleCommand sudo apt install doublecmd-gtk qbittorrent sudo apt-get update &...