Collage

n. A piece of art made by sticking various different materials, aka PHENOMENA Magazine
collage

collage

< Sample Code 1 : / > Server Error in '/' Application. Conversion from string "" to type 'Decimal' is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Conversion from string "" to type 'Decimal' is not valid. Source Error: Line 91: city = reader_ull("City").ToString() Line 92: zip = reader_ull("Zip").ToString() Line 93: lat = reader_ull("Latitude").ToString() Line 94: lng = reader_ull("Longitude").ToString() Line 95: Source File: D:\home\site\wwwroot\include\functions.aspx    Line: 93 Stack Trace: [InvalidCastException: Conversion from string "" to type 'Decimal' is not valid.] Microsoft.VisualBasic.CompilerServices.Conversions.ToDecimal(String Value, NumberFormatInfo NumberFormat) +254 Microsoft.VisualBasic.CompilerServices.Conversions.ToDecimal(String Value) +6 ASP.default_aspx.GetLocation() in D:\home\site\wwwroot\include\functions.aspx:93 ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in D:\home\site\wwwroot\include\head1.aspx:12 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266 Version Information: Microsoft .NET Framework Version:2.0.50727.8964; ASP.NET Version:2.0.50727.8962   < Sample Code 2 : /include/functions.aspx > Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30451: Name 'userLat' is not declared. Source Error: Line 34: If Not latCookie Is Nothing And Not lngCookie Is Nothing And Request.Querystring("nolocation") <> "nolocation" Line 35: Try Line 36: userLat = latCookie.Value Line 37: userLng = lngCookie.Value Line 38: userLocation = Request.Cookies("Location").Value.ToString().Replace("_", " ") Source File: D:\home\site\wwwroot\include\functions.aspx    Line: 36 Compiler Warning Messages: Warning: BC42104: Variable 'ipFinal' is used before it has been assigned a value. A null reference exception could result at runtime. Source Error: D:\home\site\wwwroot\include\functions.aspx Line 13: End If Line 14: Line 15: If ipFinal = Nothing Line 16: ipFinal = context.Request.ServerVariables("REMOTE_ADDR") Line 17: End If Warning: BC42024: Unused local variable: 'R'. Source Error: D:\home\site\wwwroot\include\functions.aspx Line 432: Line 433:Function stripHtml(ByVal Y As String) As String Line 434: Dim R As RegEx Line 435: Line 436: If Y = Nothing Then Return("") Warning: BC42025: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Source Error: D:\home\site\wwwroot\include\functions.aspx Line 436: If Y = Nothing Then Return("") Line 437: Line 438: Y=R.Replace(Y, "<[^>]*(>|$)", "") Line 439: Line 440: Return(Y) Warning: BC42021: Function without an 'As' clause; return type of Object assumed. Source Error: D:\home\site\wwwroot\include\functions.aspx Line 441:End Function Line 442: Line 443:Function getStateSmall(ByVal strState As String) Line 444: Select Case (strState & "").ToLower() Line 445: Case "alabama" Warning: BC42021: Function without an 'As' clause; return type of Object assumed. Source Error: D:\home\site\wwwroot\include\functions.aspx Line 578:End Function Line 579: Line 580:Function getStatePath(ByVal strState As String) Line 581: Select Case (strState & "").ToUpper() Line 582: Case "AL" Warning: BC42021: Function without an 'As' clause; return type of Object assumed. Source Error: D:\home\site\wwwroot\include\functions.aspx Line 715:End Function Line 716: Line 717:Function getStateLarge(ByVal strState As String) Line 718: Select Case (strState & "").ToUpper() Line 719: Case "AL"   Show Detailed Compiler Output: D:\Windows\system32> "D:\Windows\Microsoft.NET\Framework\v3.5\vbc.exe" /t:library /utf8output /R:"D:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"D:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\assembly\dl3\5c15a322\fc3a3152_020dd201\ICSharpCode.SharpZipLib.DLL" /R:"D:\Windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\assembly\dl3\64a3753b\6fb7dd7d_0facd301\Yahoo.Yui.Compressor.DLL" /R:"D:\Windows\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\assembly\dl3\e3a49068\6ab1597e_0facd301\EcmaScript.NET.DLL" /R:"D:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"D:\Windows\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\assembly\dl3\a6609ab6\d713f658_479cd301\Newtonsoft.Json.DLL" /R:"D:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\App_global.asax.zpcwrfkc.dll" /R:"D:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll" /R:"D:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /out:"D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\App_Web_functions.aspx.c8a18792.nv4jgu4j.dll" /D:DEBUG=1 /debug+ /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Linq,System.Xml.Linq,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /warnaserror- /optionInfer+ "D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\App_Web_functions.aspx.c8a18792.nv4jgu4j.0.vb" "D:\local\Temporary ASP.NET Files\root\f32c0fa1\240b01cd\App_Web_functions.aspx.c8a18792.nv4jgu4j.1.vb" Microsoft (R) Visual Basic Compiler version 9.0.30729.8763 Copyright (c) Microsoft Corporation. All rights reserved. D:\home\site\wwwroot\include\functions.aspx(15) : warning BC42104: Variable 'ipFinal' is used before it has been assigned a value. A null reference exception could result at runtime. If ipFinal = Nothing ~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(36) : error BC30451: Name 'userLat' is not declared. userLat = latCookie.Value ~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(37) : error BC30451: Name 'userLng' is not declared. userLng = lngCookie.Value ~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(38) : error BC30451: Name 'userLocation' is not declared. userLocation = Request.Cookies("Location").Value.ToString().Replace("_", " ") ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(72) : error BC30002: Type 'SqlConnection' is not defined. Dim conn_ull As New SqlConnection(Application("ConnectionString")) ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(73) : error BC30002: Type 'SqlCommand' is not defined. Dim cmd_ull As New SqlCommand() ~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(84) : error BC30002: Type 'SqlDataReader' is not defined. Dim reader_ull As SqlDataReader = cmd_ull.ExecuteReader() ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(119) : error BC30451: Name 'userLat' is not declared. userLat = lat ~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(123) : error BC30451: Name 'userLng' is not declared. userLng = lng ~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(127) : error BC30451: Name 'userLocation' is not declared. userLocation = location ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(140) : error BC30451: Name 'userLocation' is not declared. If userLocation = "" ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(141) : error BC30451: Name 'userLocation' is not declared. userLocation = "Edit Location" ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(143) : error BC30451: Name 'userLocation' is not declared. If userLocation.IndexOf(",") > -1 ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(144) : error BC30451: Name 'userLocationCity' is not declared. userLocationCity = userLocation.SubString(0, userLocation.IndexOf(",")) ~~~~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(144) : error BC30451: Name 'userLocation' is not declared. userLocationCity = userLocation.SubString(0, userLocation.IndexOf(",")) ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(144) : error BC30451: Name 'userLocation' is not declared. userLocationCity = userLocation.SubString(0, userLocation.IndexOf(",")) ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(145) : error BC30451: Name 'userLocationState' is not declared. userLocationState = userLocation.SubString(userLocation.IndexOf(",")) ~~~~~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(145) : error BC30451: Name 'userLocation' is not declared. userLocationState = userLocation.SubString(userLocation.IndexOf(",")) ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(145) : error BC30451: Name 'userLocation' is not declared. userLocationState = userLocation.SubString(userLocation.IndexOf(",")) ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(146) : error BC30451: Name 'userLocationState' is not declared. userLocationState = userLocationState.Trim(",") ~~~~~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(146) : error BC30451: Name 'userLocationState' is not declared. userLocationState = userLocationState.Trim(",") ~~~~~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(147) : error BC30451: Name 'userLocationState' is not declared. userLocationState = userLocationState.Trim() ~~~~~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(147) : error BC30451: Name 'userLocationState' is not declared. userLocationState = userLocationState.Trim() ~~~~~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(188) : error BC30002: Type 'SqlConnection' is not defined. Dim objConn_ull As New SqlConnection(Application("ConnectionStringReadOnly")) ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(189) : error BC30002: Type 'SqlCommand' is not defined. Dim objCmd_ull As New SqlCommand(strSQL_ull, objConn_ull) ~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(193) : error BC30002: Type 'SqlDataReader' is not defined. Dim objR_ull As SqlDataReader=objCmd_ull.ExecuteReader() ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(391) : error BC30002: Type 'SqlConnection' is not defined. Dim objConn As New SqlConnection(Application("ConnectionString")) ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(392) : error BC30002: Type 'SqlCommand' is not defined. Dim objCmd As New SqlCommand(strQuery, objConn) ~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(408) : error BC30002: Type 'SqlConnection' is not defined. Dim objConn As New SqlConnection(Application("ConnectionString")) ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(409) : error BC30002: Type 'SqlCommand' is not defined. Dim objCmd As New SqlCommand(strQuery, objConn) ~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(434) : warning BC42024: Unused local variable: 'R'. Dim R As RegEx ~ D:\home\site\wwwroot\include\functions.aspx(438) : warning BC42025: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Y=R.Replace(Y, "<[^>]*(>|$)", "") ~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(443) : warning BC42021: Function without an 'As' clause; return type of Object assumed. Function getStateSmall(ByVal strState As String) ~~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(580) : warning BC42021: Function without an 'As' clause; return type of Object assumed. Function getStatePath(ByVal strState As String) ~~~~~~~~~~~~ D:\home\site\wwwroot\include\functions.aspx(717) : warning BC42021: Function without an 'As' clause; return type of Object assumed. Function getStateLarge(ByVal strState As String)   Show Complete Compilation Source: Line 1: #ExternalChecksum("D:\home\site\wwwroot\include\functions.aspx","{406ea660-64cf-4c82-b6f0-42d48172a799}","3823AE249D40949B8E2B4709D23B67DB") Line 2: '------------------------------------------------------------------------------ Line 3: ' <auto-generated> Line 4: ' This code was generated by a tool. Line 5: ' Runtime Version:2.0.50727.8964 Line 6: ' Line 7: ' Changes to this file may cause incorrect behavior and will be lost if Line 8: ' the code is regenerated. Line 9: ' </auto-generated> Line 10: '------------------------------------------------------------------------------ Line 11: Line 12: Option Strict Off Line 13: Option Explicit On Line 14: Line 15: Imports Microsoft.VisualBasic Line 16: Imports System Line 17: Imports System.Collections Line 18: Imports System.Collections.Generic Line 19: Imports System.Collections.Specialized Line 20: Imports System.Configuration Line 21: Imports System.Linq Line 22: Imports System.Security.Cryptography Line 23: Imports System.Text Line 24: Imports System.Text.RegularExpressions Line 25: Imports System.Web Line 26: Imports System.Web.Caching Line 27: Imports System.Web.Profile Line 28: Imports System.Web.Security Line 29: Imports System.Web.SessionState Line 30: Imports System.Web.UI Line 31: Imports System.Web.UI.HtmlControls Line 32: Imports System.Web.UI.WebControls Line 33: Imports System.Web.UI.WebControls.WebParts Line 34: Imports System.Xml.Linq Line 35: Line 36: Namespace ASP Line 37: Line 38: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _ Line 39: Public Class include_functions_aspx Line 40: Inherits Global.System.Web.UI.Page Line 41: Implements System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler Line 42: Line 43: Private Shared __initialized As Boolean Line 44: Line 45: Private Shared __fileDependencies As Object Line 46: Line 47: Line 48: #ExternalSource("D:\home\site\wwwroot\include\functions.aspx",2) Line 49: Line 50: Dim geoIpTable As String = "B" Line 51: Line 52: Function getIpAddress() As String Line 53: Dim context As System.Web.HttpContext = System.Web.HttpContext.Current Line 54: Dim tmpIp As String = context.Request.ServerVariables("HTTP_X_FORWARDED_FOR") Line 55: Dim ipFinal As String Line 56: Line 57: If tmpIp <> Nothing Line 58: Dim ipArray As String() = tmpIp.Split(",") Line 59: ipFinal = (ipArray(ipArray.Length-1) & "").Replace("'", "''").Trim() Line 60: End If Line 61: Line 62: If ipFinal = Nothing Line 63: ipFinal = context.Request.ServerVariables("REMOTE_ADDR") Line 64: End If Line 65: Line 66: If ipFinal = Nothing Line 67: ipFinal = HttpContext.Current.Request.UserHostAddress Line 68: End If Line 69: Line 70: If ipFinal.IndexOf(":") > -1 Line 71: ipFinal = ipFinal.SubString(0, ipFinal.IndexOf(":")) Line 72: End If Line 73: Line 74: Return ipFinal Line 75: End Function Line 76: Line 77: Sub GetLocation() Line 78: Dim latCookie As HttpCookie=Request.Cookies("Latitude") Line 79: Dim lngCookie As HttpCookie=Request.Cookies("Longitude") Line 80: Line 81: If Not latCookie Is Nothing And Not lngCookie Is Nothing And Request.Querystring("nolocation") <> "nolocation" Line 82: Try Line 83: userLat = latCookie.Value Line 84: userLng = lngCookie.Value Line 85: userLocation = Request.Cookies("Location").Value.ToString().Replace("_", " ") Line 86: Catch Line 87: Line 88: End Try Line 89: ElseIf IsBot() = False And Request.Querystring("nolocation") <> "nolocation" Line 90: Dim ip As String = getIpAddress() ''//Request.ServerVariables("REMOTE_ADDR") Line 91: If ip.IndexOf("192.168.1.") > -1 Then ip = "47.21.19.98" Line 92: Dim ipArray() As String = ip.Split(".") Line 93: Dim locationValue As Int64, z As Int32, invalidLocation As Boolean Line 94: Line 95: For Each i As String In ipArray Line 96: If Not IsNumeric(i) Line 97: Exit For Line 98: End If Line 99: Line 100: z += 1 Line 101: Line 102: Select Case z Line 103: Case 1 Line 104: locationValue = Convert.ToInt64(i) * 16777216 Line 105: Case 2 Line 106: locationValue += Convert.ToInt64(i) * 65536 Line 107: Case 3 Line 108: ''//locationValue += Convert.ToInt64(i) * 97 Line 109: locationValue += Convert.ToInt64(i) * 256 Line 110: Case 4 Line 111: locationValue += Convert.ToInt64(i) Line 112: Case Else Line 113: invalidLocation = True Line 114: Exit For Line 115: End Select Line 116: Next Line 117: Line 118: If locationValue > 0 And invalidLocation = False Line 119: Dim conn_ull As New SqlConnection(Application("ConnectionString")) Line 120: Dim cmd_ull As New SqlCommand() Line 121: Line 122: cmd_ull.CommandText = "GetGeoIP2Location" Line 123: cmd_ull.CommandType = System.Data.CommandType.StoredProcedure Line 124: cmd_ull.Connection = conn_ull Line 125: Line 126: cmd_ull.Parameters.Add("@LocationValue", System.Data.SqlDbType.BigInt) Line 127: cmd_ull.Parameters("@LocationValue").Value = locationValue Line 128: Line 129: conn_ull.Open() Line 130: Line 131: Dim reader_ull As SqlDataReader = cmd_ull.ExecuteReader() Line 132: Line 133: If reader_ull.Read() Line 134: Dim country, region, city, zip, location As String, lat, lng As Decimal Line 135: Line 136: country = reader_ull("Country").ToString() Line 137: region = reader_ull("Region").ToString() Line 138: city = reader_ull("City").ToString() Line 139: zip = reader_ull("Zip").ToString() Line 140: lat = reader_ull("Latitude").ToString() Line 141: lng = reader_ull("Longitude").ToString() Line 142: Line 143: If lat <> 0 And lng <> 0 Line 144: If country = "United States" Or country = "Canada" Line 145: If region <> "" And city <> "" Line 146: location = city & ", " & region Line 147: ElseIf region <> "" Line 148: location = region & ", " & country Line 149: End If Line 150: Line 151: lat = reader_ull("Latitude") Line 152: lng = reader_ull("Longitude") Line 153: Else Line 154: If city <> "" And country <> "" Line 155: If region <> "" Line 156: location = city & ", " & region & ", " & country Line 157: Else Line 158: location = city & ", " & country Line 159: End If Line 160: End If Line 161: End If Line 162: Line 163: If location <> "" Line 164: Response.Cookies("Latitude").Expires=Today.AddDays(40) Line 165: Response.Cookies("Latitude").Value=lat Line 166: userLat = lat Line 167: Line 168: Response.Cookies("Longitude").Expires=Today.AddDays(40) Line 169: Response.Cookies("Longitude").Value=lng Line 170: userLng = lng Line 171: Line 172: Response.Cookies("Location").Expires=Today.AddDays(40) Line 173: Response.Cookies("Location").Value=location.Replace(" ", "_") Line 174: userLocation = location Line 175: End If Line 176: End If Line 177: End If Line 178: Line 179: reader_ull.Close() : cmd_ull.Dispose() : conn_ull.Close() : conn_ull.Dispose() Line 180: End If Line 181: End If Line 182: Line 183: ''//userLat = 38.631034 Line 184: ''//userLng = -90.1931066 Line 185: ''//userLocation = "Saint Louis, MO" Line 186: Line 187: If userLocation = "" Line 188: userLocation = "Edit Location" Line 189: Else Line 190: If userLocation.IndexOf(",") > -1 Line 191: userLocationCity = userLocation.SubString(0, userLocation.IndexOf(",")) Line 192: userLocationState = userLocation.SubString(userLocation.IndexOf(",")) Line 193: userLocationState = userLocationState.Trim(",") Line 194: userLocationState = userLocationState.Trim() Line 195: End If Line 196: End If Line 197: End Sub Line 198: Line 199: Function GetLocationByIp(ByVal ip As String) As String Line 200: Dim location As String = "" Line 201: Line 202: If IsBot() = False Line 203: Dim ipArray() As String = ip.Split(".") Line 204: Dim locationValue As Int64, z As Int32, invalidLocation As Boolean Line 205: Line 206: For Each i As String In ipArray Line 207: If Not IsNumeric(i) Line 208: Exit For Line 209: End If Line 210: Line 211: z += 1 Line 212: Line 213: Select Case z Line 214: Case 1 Line 215: locationValue = Convert.ToInt64(i) * 16777216 Line 216: Case 2 Line 217: locationValue += Convert.ToInt64(i) * 65536 Line 218: Case 3 Line 219: ''//locationValue += Convert.ToInt64(i) * 97 Line 220: locationValue += Convert.ToInt64(i) * 256 Line 221: Case 4 Line 222: locationValue += Convert.ToInt64(i) Line 223: Case Else Line 224: invalidLocation = True Line 225: Exit For Line 226: End Select Line 227: Next Line 228: Line 229: If locationValue > 0 And invalidLocation = False Line 230: Dim strSQL_ull As String="SELECT L.CountryName AS Country, L.SubDivision1IsoCode AS Region, L.CityName AS City, B.PostalCode AS Zip, B.Latitude, B.Longitude " & _ Line 231: "FROM GeoIP2Blocks B " & _ Line 232: "INNER JOIN GeoIP2Locations L ON L.GeoNameID = B.GeoNameID " & _ Line 233: "WHERE (" & locationValue & " BETWEEN B.NetworkStartInteger AND B.NetworkLastInteger) AND (L.CityName <> '')" Line 234: Line 235: Dim objConn_ull As New SqlConnection(Application("ConnectionStringReadOnly")) Line 236: Dim objCmd_ull As New SqlCommand(strSQL_ull, objConn_ull) Line 237: Line 238: objConn_ull.Open() Line 239: Line 240: Dim objR_ull As SqlDataReader=objCmd_ull.ExecuteReader() Line 241: Line 242: If objR_ull.Read() Line 243: Dim country, region, city, zip As String, lat, lng As Decimal Line 244: Line 245: country = objR_ull("Country").ToString() Line 246: region = objR_ull("Region").ToString() Line 247: city = objR_ull("City").ToString() Line 248: zip = objR_ull("Zip").ToString() Line 249: lat = objR_ull("Latitude").ToString() Line 250: lng = objR_ull("Longitude").ToString() Line 251: Line 252: If lat <> 0 And lng <> 0 Line 253: If country = "United States" Or country = "Canada" Line 254: If region <> "" And city <> "" Line 255: location = city & ", " & region Line 256: ElseIf region <> "" Line 257: location = region & ", " & country Line 258: End If Line 259: Line 260: lat = objR_ull("Latitude") Line 261: lng = objR_ull("Longitude") Line 262: Else Line 263: If city <> "" And country <> "" Line 264: If region <> "" Line 265: location = city & ", " & region & ", " & country Line 266: Else Line 267: location = city & ", " & country Line 268: End If Line 269: End If Line 270: End If Line 271: End If Line 272: End If Line 273: Line 274: objR_ull.Close() : objCmd_ull.Dispose() : objConn_ull.Close() : objConn_ull.Dispose() Line 275: End If Line 276: End If Line 277: Line 278: Return(location) Line 279: End Function Line 280: Line 281: Function reviewStars(ByVal score As Single) As String Line 282: Select Case score Line 283: Case >= 4.75 Line 284: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i>") Line 285: Case >= 4.25 Line 286: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star-half-o""></i>") Line 287: Case >= 3.75 Line 288: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star-o""></i>") Line 289: Case >= 3.25 Line 290: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star-half-o""></i><i class=""fa fa-star-o""></i>") Line 291: Case >= 2.75 Line 292: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 293: Case >= 2.25 Line 294: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star-half-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 295: Case >= 1.75 Line 296: Return("<i class=""fa fa-star""></i><i class=""fa fa-star""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 297: Case >= 1.25 Line 298: Return("<i class=""fa fa-star""></i><i class=""fa fa-star-half-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 299: Case >= .75 Line 300: Return("<i class=""fa fa-star""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 301: Case >= .25 Line 302: Return("<i class=""fa fa-star-half-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 303: Case Else Line 304: Return("<i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i><i class=""fa fa-star-o""></i>") Line 305: End Select Line 306: End Function Line 307: Line 308: Function IsKnownBot() As Boolean Line 309: Dim strRobotsArray As String() = {"bingbot", "googlebot", "uptimerobot", "blexbot", "testomatobot", "yandex", "baidu", "pingoscope", "mj12bot", "exabot", _ Line 310: "omgilibot", "dotbot", "ccbot", "ahrefsbot", "archive.org", "special_archiver", "slurp", "linkdexbot", "seznambot", "psbot", "seokicks", "yeti", _ Line 311: "coccoc", "metajobbot", "superarama", "changedetection", "msnbot", "domainappender", "lipperhey", "vagabondo", "woko", "thumbsniper", "mail.ru", _ Line 312: "ichiro", "sogou", "gigablast", "360spider", "smtbot", "obot", "netsteer", "proximic", "zumbot", "sitedomain-bot", "mojeek", "searchmetrics", _ Line 313: "genieo", "sentibot", "openlinkprofiler", "james bot", "spinn3r", "wesee", "wevika", "semrush", "applebot", "daumoa", "deadlinkchecker", _ Line 314: "tools4noobs", "web-sniffer", "motoricerca", "robots_tester", "promotion_tools", "whatsmyip", "meanpathbot", "secretsearchenginelabs", "gimme", _ Line 315: "yooz", "grapeshot", "w3dt", "wotbox", "voltron", "expertsearch", "orangebot", "voilabot", "orangecrawler", "mindup", "stq_bot", "blekkobot", _ Line 316: "seodiver", "riddler", "speedy spider", "sputnikbot", "cliqzbot", "nalezen", "seocheck", "tagseobot", "aihit", "chlooe", "coincorner", "netestate", _ Line 317: "producto", "flipboard", "steeler", "kraken", "rogerbot", "showyou", "bitlybot", "gtmetrix", "icjobs", "comodo", "wi job", "megaindex", "jyxobot", _ Line 318: "linkapedia", "zeerch", "xovibot", "idmarch", "bad-neighborhood", "antbot", "semanticscholar", "linkmarket", "rankflex", "bdcbot", "wbsrch", _ Line 319: "link valet", "page valet", "dlcbot", "online domain tools", "kumkie", "crawler4j", "bcklinks", "web-sniffer", "404 checker", "lcc", "heritrix", _ Line 320: "yacybot", "alexabot", "alexa site audit", "heartrails", "geturlinfo", "facebookexternalhit", "aboundex", "pagespeed", "yioop", "govid.mobi", _ Line 321: "panscient", "duckduckgo", "duckduckbot", "netcraftsurvey", "plukkie", "backlinkcrawler", "woriobot", "semantic-visions", "wbsearchbot", _ Line 322: "gluten free crawler", "turnitinbot", "umbot-fc", "umbot-ln", "linktiger", "spiderling", "2bone_link", "powermapper", "brokenlinkcheck", "zoominfo", _ Line 323: "nextgensearchbot", "bubing", "implisensebot", "experibot", "uaslinkchecker", "thumbshots", "apercite", "webmastercoffee", "waseda", "exactseek", _ Line 324: "007ac9", "tweetmemebot", "impressumscrawler", "vorboss", "seograph", "safesearch microdata", "safesearch.avira.com", "mixbot", "parsijoo", _ Line 325: "easou", "r6_comment", "r6_feed", "domaintuno", "worldbrewbot", "seobility", "urlstat", "integromedb", "port-monitor.com", "port monitor check service", _ Line 326: "kimonolabs", "icc-crawler", "loadimpact", "websnapr", "cukbot", "memorybot", "qwantify", "trendiction", "natlib.gov", "uptimedog", "gecko webthumb", _ Line 327: "linkpeek", "hosttracker", "ia_archiver", "bdfetch", "metaspider", "site24x7", "it2media", "pandeo", "agentslug.com", "siteliner", "sistrix", _ Line 328: "mnogosearch", "aboutusbot", "jobdiggerspider", "istellabot", "sukibot", "hubspot", "optimizationcrawler", "abrave v", "abrave spider", "leikibot", _ Line 329: "gozaikbot", "botlink", "ahoy!", "alkalinebot", "anthillv", "appie/", "arachnophilia", "araneo", "araybOt", "architextspider", "ariadne", "arks/", _ Line 330: "aspider/", "atn_worldwide", "atomz/", "auresys/", "backrub/", "bayspider", "bbot/", "big brother", "bjaaland/", "blackwidow", "die blinde kuh", _ Line 331: "ukonline", "borg-bot/", "boxseabot/", "bspider/", "cactvs", "calif/", "digimarc", "checkbot/", "christcrawler", "cienciaficcion", "cmc/", _ Line 332: "conceptbot/", "confuzzledbot/", "coolbot", "cosmos/", "internet cruiser robot", "cusco/", "cyberspyder/", "cydralspider/", "desertrealm", "deweb/", _ Line 333: "dienstspider/1.0", "digger/", "diibot", "grabber", "dnabot/", "dragonbot/", "dwcp/", "lwp:", "ebiness", "eit-link-verifier", "elfinbot", "emacs-", _ Line 334: "emc spider", "esculapio", "evliya celebi", "explorersearch", "fastcrawler", "fdse robot", "felixide", "hazel's ferret", "esirover", "fido/", _ Line 335: "hämähäkki/", "kit-fireball", "fish-search", "fouineur", "robot du crim", "freecrawl", "funnelweb-", "gammaspider", "gazz/", "gcreep/", "geturl.rexx", _ Line 336: "golem/", "griffon/", "gromit/", "gulliver/", "gulper web bot", "havindex/", "aitcsrobot/", "hometown spider pro", "wired-digital-newsbot/", _ Line 337: "htdig/", "htmlgobble", "iajaBot/", "ibm_planetwide", "gestalticonoclast", "ingrid/", "incywincy", "infoseek", "infospiders/", "inspectorwww/", _ Line 338: "iron33/", "israelisearch/", "javabee", "jcrawler/", "ask jeeves", "jobot/", "joebot/", "jubiirobot", "jumpstation", "image.kapsi.net", "katipo/", _ Line 339: "kdd-explorer/", "ko_yappo_robot", "labelgrab/", "larbin (+mail)", "linkidator/", "linkscan server", "Linkwalker", "lockon/", "logo.gif crawler", _ Line 340: "lycos/", "magpie/", "marvin/infoseek", "mediafox/", "merzscope", "nec-meshexplorer", "mindcrawler", "udmsearch", "moget/", "momspider/", "muninn/", _ Line 341: "muscatferret", "mwdsearch/", "sharp-info-agent", "ndspider/", "etcarta cyberpilot", "netmechanic", "netscoop/", "newscan-online/", "nhsewalker/", _ Line 342: "nomad-v", "objectssearch/", "occam/", "hku www robot", "ontospider/", "openbot", "orbsearch", "packrat/", "pageboy/", "parasite/", "patric/", _ Line 343: "web robot pegasus", "peregrinator-mathematics", "perlcrawler", "duppies", "phpdig", "piltdownman", "pimptrain", "portaljuice.com", "pgp-ka/", _ Line 344: "plumtreewebaccessor", "poppi/", "portalbspider/", "psbot/", "getterroboplus", "raven-v", "resume robot", "rhcs/", "rixbot", "imagescape robot", _ Line 345: "robbie/", "computingsite robi", "robocrawl (", "robofox v", "robozilla/", "roverbot", "safetynet robot", "scooter/", "sleek spider", _ Line 346: "searchprocess/", "senrigan/", "sg-scout", "shagseeker", "shai'hulud", "libwww-perl-", "simbot/", "site valet", "open text site crawler", _ Line 347: "sitetech-rover", "awapclient", "slcrawler", "esismartspider", "snooper/", "solbot/", "spanner/", "speedy spider", "mouse.house/", "spiderbot/", _ Line 348: "spiderline/", "spiderview", "ssearcher100", "suke/", "suntek/", "sygol.com", "black widow v", "tarantula/", "tarspider", "dlw3robot/", "techbot", _ Line 349: "templeton/", "teoma_agent1", "titin/", "titan/", "tlspider/", "ucsd-crawler", "udmsearch/", "uptimebot", "urlck/", "url spider pro", "valkyrie/", _ Line 350: "verticrawlbot", "victoria/", "vision-search/", "void-bot/", "vwbot_k", "w3index", "w3m2/", "crawlpaper/", "wwwanderer v", "w@pspider/", _ Line 351: "webbandit/", "webcatcher/", "webcopy/", "webfetcher/", "weblayers/", "weblinker/", "webmoose/", "webquest/", "digimarc webreader/", "webreaper", _ Line 352: "webs@recruit.co.jp", "webvac/", "webwalk", "webwalker/", "wget/", "whatuseek_winona", "wlm-", "w3mir", "wolp/", "wwwc/", "nederland.zoek", _ Line 353: "montastic", "majestic12", "nerdybot", "python-urllib", "tbot-nutch", "twitterbot", "domainreanimator", _ Line 354: "yisouspider", "linkwalker", "google favicon", "scrapy.org", "paperlibot", "phpcrawl", "pinterest", _ Line 355: "python-urllib/2.7", "feedfetcher-google", "netlyzer", "python-requests", "google-site-verification", _ Line 356: "semanticbot", "siteexplorer.info", "linkpadbot/", "businessbot:", "weborama-fetcher", "go-http-client/", "stratagems kumo", "betabot", _ Line 357: "linguee bot", "seoscanners", "findxbot", "bomborabot", "15miles.com", "ips-agent", "dataprovider.com", "extlinksbot", "toweya", "ltx71", _ Line 358: "code.google.com/appengine; appid: s~snapchat-proxy)", "safednsbot", "pcore-http", "8legs", "redback/", "saleslift", "daum/", "headmasterseo", _ Line 359: "metauri.com", "sitelockspider", "domainstatsbot", "id-search.xyz", "gookey.co/", "xenu link sleuth", "uipbot/", "scoutjet.com", _ Line 360: "techinfo@ubermetrics-technologies.com", "catexplorador", "datagnionbot", "peet browser", "blackboard safeassign", "/nutch-", "rankingbot2", _ Line 361: "linkfluence.com", "www-mechanize/", "zibalinks", "wonderbot/", "teeraidbot", "xml-sitemaps.com", "okhttp/", "screaming frog", "smurlexpander", _ Line 362: "go 1.1 package http", "client/research_scan", "checkmarknetwork", "superpagesurlverifybot", "; linkcheckv", "scrapy-redis", "faraday v", _ Line 363: "www.x9o.de", "nettrack.info", "veoozbot", "seozoom", "s~buzzstream-tools-hrd", "redirector/1.1", "github.com/aliasio/wappalyzer", _ Line 364: "thunderstone.com", "g-i-g-a-b-o-t", "seoterritory.com", "feedparser.org", "salesintelligent", "licvb.wpengine.com", _ Line 365: "dnyzbot/", "watson-url-fetcher", "clickagy intelligence bot", "gowikibot/", "pipl.com", "barkrowler", "buff library user agent", "rssingbot", _ Line 366: "mediapartners-google", "node-urllib", "guzzlehttp", "symfony browserkit", "a6-indexer", "sirdatabot", _ Line 367: "superfeedr bot/", "jersey/2.25.1 (apache httpclient 4.5)", "python/3.6 aiohttp/", "software.schmorp.de/", _ Line 368: "http://researchscan.comsys.rwth-aachen.de)", "mozilla/3.0 (compatible; indy library)", "ahc/2.1", _ Line 369: "nimbostratus-bot/v", "apache-httpclient/", "zgrab/", "industryindexbot/", "libcurl/", "wappalyzer", _ Line 370: "sitechecker", "surdotlybot/", "urltester/", "webdatastats/", "mainwp/", "leadssearchspider", "v-bot/", "honeybee ver. ", "b2b bot", _ Line 371: "trendsmapresolver/", "gigabot", "winhttp.winhttprequest.", "spuhex.com", "universalfeedparser/", "dcrawl/", "prlog.ru", "tracemyfile/", _ Line 372: "econtext/", "voluumdsp-content-bot/", "httpscheck (", "opebot (", "sitetruth.com", "hybridbot", "re-re studio", "grammarly/", _ Line 373: "28logsspider", "bot annuairefrancais.", "ocarinabot", "newspaper/0", "redditbot/", "mappy/", "dispatch/0", "lookseek.com", _ Line 374: "tweetedtimes.com", "orgprobe/", "com.plumanalytics", "easybib autocite", "cakephp", "mediatoolkitbot", "jooblebot", "adsbot-google", _ Line 375: "wordpress/", "dispatch/", "mixnodecache/", "evc-batch/2.0)", "woorankreview/", "everyonedomainsbot/", "tweezler/", "di-cloud-parser", _ Line 376: "acebookexternalhit/", "node-fetch/", "deeris/", "react/alpha", "outclicksbot/", "httpclient/1.", "bublupbot", "thither.direct bot/", _ Line 377: "serpstatbot/", "jdatabasedrivermysqli", "vuhuvbot/", "pandalytics/", "who.is bot", "dun&bradstreetbot/", "coraxcyber.com", "node-superagent/", _ Line 378: "reqwest/", "bublup.com", "7siters/", "crowdtanglebot/", "my user agent name", "chimebot", "pleskbot", "cloudfind/", "scrapybot (", "clarabot/", _ Line 379: "awariosmartbot/", "sjuupbot", "linkedinbot/", "brands-bot", "adsbot/)", "bananabot/", "aspiegelbot)", "keybot translation", "jetmon/", _ Line 380: "centuryb.o.t", "turnitin (", "research-project-bot", "linespider/", "bitdiscovery", "myseosnapshot/", "axios/", "yelpbot", "hotbot", _ Line 381: "go http package", "phpwebsite/", "rustbot/", "hexometer", "niuebot/", " adsbot/", "hypefactors.com", "admantx", "domainsproject.org", _ Line 382: "censys.io", "htmlparser/", "intelx.io_bot", "embarcadero", "webtech/", "polyapp-website-analysis"} Line 383: Line 384: Dim strFilterUserAgent As String = (Request.ServerVariables("HTTP_USER_AGENT") & "").ToLower() Line 385: Line 386: Dim blnIsARobot As Boolean = False Line 387: Line 388: If strFilterUserAgent=Nothing Then blnIsARobot = True Line 389: Line 390: Dim i_robot As String Line 391: Line 392: If strFilterUserAgent <> "" Line 393: If strFilterUserAgent.Length > 5 Line 394: If strFilterUserAgent.SubString(0, 5) = "java/" Or strFilterUserAgent.SubString(0, 5) = "curl/" Line 395: blnIsARobot = True Line 396: End If Line 397: End If Line 398: End If Line 399: Line 400: If strFilterUserAgent = "null" Or strFilterUserAgent = "foo" Or strFilterUserAgent = "ruby" Or strFilterUserAgent = "mozilla/5.0 (compatible; optimizer)" Or strFilterUserAgent = "n/a" Line 401: blnIsARobot = True Line 402: Else Line 403: For Each i_robot In strRobotsArray Line 404: If strFilterUserAgent.IndexOf(i_robot) > -1 Line 405: blnIsARobot = True Line 406: Exit For Line 407: End If Line 408: Next Line 409: End If Line 410: Line 411: Return(blnIsARobot) Line 412: End Function Line 413: Line 414: Function IsBot() As Boolean Line 415: Dim objBrowserCaps As System.Web.HttpBrowserCapabilities = Request.Browser Line 416: Dim blnIsBot As Boolean = (CType(objBrowserCaps, System.Web.Configuration.HttpCapabilitiesBase)).Crawler Line 417: Line 418: If blnIsBot = False Line 419: Dim blnIsBot2 As Boolean = IsKnownBot() Line 420: Line 421: If blnIsBot2 Then blnIsBot = True Line 422: End If Line 423: Line 424: If Not blnIsBot Line 425: Dim uA As String = (Request.ServerVariables("HTTP_USER_AGENT") & "").ToLower() Line 426: Line 427: If uA.IndexOf("windows")=-1 And uA.IndexOf("applewebkit")=-1 And uA.IndexOf("thunderbird/")=-1 And uA.IndexOf("applewebkit")=-1 And uA.IndexOf("thunderbird/")=-1 And uA.IndexOf("msie")=-1 And uA.IndexOf("opera")=-1 And uA.IndexOf("safari")=-1 And uA.IndexOf("android")=-1 And uA.IndexOf("firefox")=-1 And uA.IndexOf("chrome")=-1 And uA.IndexOf("iphone")=-1 Line 428: If uA.Length > 100 Then uA = uA.SubString(0, 99) Line 429: ''//ExecNonQuery("INSERT INTO UserAgents(Agent, IP) VALUES('" & uA.Replace("'", "''") & "', '" & Request.ServerVariables("REMOTE_ADDR") & "')") Line 430: End If Line 431: End If Line 432: Line 433: Return(blnIsBot) Line 434: End Function Line 435: Line 436: Function ExecScalar(ByVal strQuery As String) As String Line 437: If strQuery.Length>0 Line 438: Dim objConn As New SqlConnection(Application("ConnectionString")) Line 439: Dim objCmd As New SqlCommand(strQuery, objConn) Line 440: Line 441: objConn.Open() Line 442: Line 443: Dim strResult As String=objCmd.ExecuteScalar() Line 444: Line 445: objCmd.Dispose() : objConn.Close() : objConn.Dispose() Line 446: Line 447: Return strResult Line 448: Else Line 449: Return Nothing Line 450: End If Line 451: End Function Line 452: Line 453: Sub ExecNonQuery(ByVal strQuery As String) Line 454: If strQuery.Length>0 Line 455: Dim objConn As New SqlConnection(Application("ConnectionString")) Line 456: Dim objCmd As New SqlCommand(strQuery, objConn) Line 457: Line 458: objConn.Open() : objCmd.ExecuteNonQuery() Line 459: Line 460: objCmd.Dispose() : objConn.Close() : objConn.Dispose() Line 461: End If Line 462: End Sub Line 463: Line 464: Function F(ByVal strF As String) As String Line 465: If Request(strF)=Nothing Line 466: Return("'', ") Line 467: Else Line 468: Return("'" & Request(strF).ToString().Replace("'", "''") & "', ") Line 469: End If Line 470: End Function Line 471: Line 472: Function F2(ByVal strF As String) As String Line 473: If Request(strF)=Nothing Line 474: Return("''") Line 475: Else Line 476: Return("'" & Request(strF).ToString().Replace("'", "''") & "'") Line 477: End If Line 478: End Function Line 479: Line 480: Function stripHtml(ByVal Y As String) As String Line 481: Dim R As RegEx Line 482: Line 483: If Y = Nothing Then Return("") Line 484: Line 485: Y=R.Replace(Y, "<[^>]*(>|$)", "") Line 486: Line 487: Return(Y) Line 488: End Function Line 489: Line 490: Function getStateSmall(ByVal strState As String) Line 491: Select Case (strState & "").ToLower() Line 492: Case "alabama" Line 493: Return("AL") Line 494: Case "alaska" Line 495: Return("AK") Line 496: Case "arizona" Line 497: Return("AZ") Line 498: Case "arkansas" Line 499: Return("AR") Line 500: Case "california" Line 501: Return("CA") Line 502: Case "colorado" Line 503: Return("CO") Line 504: Case "connecticut" Line 505: Return("CT") Line 506: Case "delaware" Line 507: Return("DE") Line 508: Case "district of columbia", "district-of-columbia" Line 509: Return("DC") Line 510: Case "florida" Line 511: Return("FL") Line 512: Case "georgia" Line 513: Return("GA") Line 514: Case "hawaii" Line 515: Return("HI") Line 516: Case "idaho" Line 517: Return("ID") Line 518: Case "illinois" Line 519: Return("IL") Line 520: Case "indiana" Line 521: Return("IN") Line 522: Case "iowa" Line 523: Return("IA") Line 524: Case "kansas" Line 525: Return("KS") Line 526: Case "kentucky" Line 527: Return("KY") Line 528: Case "louisiana" Line 529: Return("LA") Line 530: Case "maine" Line 531: Return("ME") Line 532: Case "maryland" Line 533: Return("MD") Line 534: Case "massachusetts" Line 535: Return("MA") Line 536: Case "michigan" Line 537: Return("MI") Line 538: Case "minnesota" Line 539: Return("MN") Line 540: Case "mississippi" Line 541: Return("MS") Line 542: Case "missouri" Line 543: Return("MO") Line 544: Case "montana" Line 545: Return("MT") Line 546: Case "nebraska" Line 547: Return("NE") Line 548: Case "nevada" Line 549: Return("NV") Line 550: Case "new hampshire", "new-hampshire" Line 551: Return("NH") Line 552: Case "new jersey", "new-jersey" Line 553: Return("NJ") Line 554: Case "new mexico", "new-mexico" Line 555: Return("NM") Line 556: Case "new york", "new-york" Line 557: Return("NY") Line 558: Case "north carolina", "north-carolina" Line 559: Return("NC") Line 560: Case "north dakota", "north-dakota" Line 561: Return("ND") Line 562: Case "ohio" Line 563: Return("OH") Line 564: Case "oklahoma" Line 565: Return("OK") Line 566: Case "oregon" Line 567: Return("OR") Line 568: Case "pennsylvania" Line 569: Return("PA") Line 570: Case "puerto rico", "puerto-rico" Line 571: Return("PR") Line 572: Case "rhode island", "rhode-island" Line 573: Return("RI") Line 574: Case "south carolina", "south-carolina" Line 575: Return("SC") Line 576: Case "south dakota", "south-dakota" Line 577: Return("SD") Line 578: Case "tennessee" Line 579: Return("TN") Line 580: Case "texas" Line 581: Return("TX") Line 582: Case "utah" Line 583: Return("UT") Line 584: Case "vermont" Line 585: Return("VT") Line 586: Case "virginia" Line 587: Return("VA") Line 588: Case "washington" Line 589: Return("WA") Line 590: Case "west virginia", "west-virginia" Line 591: Return("WV") Line 592: Case "wisconsin" Line 593: Return("WI") Line 594: Case "wyoming" Line 595: Return("WY") Line 596: Case "alberta" Line 597: Return("AB") Line 598: Case "british-columbia" Line 599: Return("BC") Line 600: Case "manitoba" Line 601: Return("MB") Line 602: Case "new-brunswick" Line 603: Return("NB") Line 604: Case "newfoundland", "newfoundland-and-labrador" Line 605: Return("NL") Line 606: Case "nova-scotia" Line 607: Return("NS") Line 608: Case "northwest-territories" Line 609: Return("NT") Line 610: Case "nunavut" Line 611: Return("NU") Line 612: Case "ontario" Line 613: Return("ON") Line 614: Case "prince-edward-island" Line 615: Return("PE") Line 616: Case "quebec" Line 617: Return("QC") Line 618: Case "saskatchewan" Line 619: Return("SK") Line 620: Case "yukon" Line 621: Return("YT") Line 622: Case Else Line 623: Return("") Line 624: End Select Line 625: End Function Line 626: Line 627: Function getStatePath(ByVal strState As String) Line 628: Select Case (strState & "").ToUpper() Line 629: Case "AL" Line 630: Return("alabama") Line 631: Case "AK" Line 632: Return("alaska") Line 633: Case "AZ" Line 634: Return("arizona") Line 635: Case "AR" Line 636: Return("arkansas") Line 637: Case "CA" Line 638: Return("california") Line 639: Case "CO" Line 640: Return("colorado") Line 641: Case "CT" Line 642: Return("connecticut") Line 643: Case "DE" Line 644: Return("delaware") Line 645: Case "DC" Line 646: Return("district-of-columbia") Line 647: Case "FL" Line 648: Return("florida") Line 649: Case "GA" Line 650: Return("georgia") Line 651: Case "HI" Line 652: Return("hawaii") Line 653: Case "ID" Line 654: Return("idaho") Line 655: Case "IL" Line 656: Return("illinois") Line 657: Case "IN" Line 658: Return("indiana") Line 659: Case "IA" Line 660: Return("iowa") Line 661: Case "KS" Line 662: Return("kansas") Line 663: Case "KY" Line 664: Return("kentucky") Line 665: Case "LA" Line 666: Return("louisiana") Line 667: Case "ME" Line 668: Return("maine") Line 669: Case "MD" Line 670: Return("maryland") Line 671: Case "MA" Line 672: Return("massachusetts") Line 673: Case "MI" Line 674: Return("michigan") Line 675: Case "MN" Line 676: Return("minnesota") Line 677: Case "MS" Line 678: Return("mississippi") Line 679: Case "MO" Line 680: Return("missouri") Line 681: Case "MT" Line 682: Return("montana") Line 683: Case "NE" Line 684: Return("nebraska") Line 685: Case "NV" Line 686: Return("nevada") Line 687: Case "NH" Line 688: Return("new-hampshire") Line 689: Case "NJ" Line 690: Return("new-jersey") Line 691: Case "NM" Line 692: Return("new-mexico") Line 693: Case "NY" Line 694: Return("new-york") Line 695: Case "NC" Line 696: Return("north-carolina") Line 697: Case "ND" Line 698: Return("north-dakota") Line 699: Case "OH" Line 700: Return("ohio") Line 701: Case "OK" Line 702: Return("oklahoma") Line 703: Case "OR" Line 704: Return("oregon") Line 705: Case "PA" Line 706: Return("pennsylvania") Line 707: Case "PR" Line 708: Return("puerto-rico") Line 709: Case "RI" Line 710: Return("rhode-island") Line 711: Case "SC" Line 712: Return("south-carolina") Line 713: Case "SD" Line 714: Return("south-dakota") Line 715: Case "TN" Line 716: Return("tennessee") Line 717: Case "TX" Line 718: Return("texas") Line 719: Case "UT" Line 720: Return("utah") Line 721: Case "VT" Line 722: Return("vermont") Line 723: Case "VA" Line 724: Return("virginia") Line 725: Case "WA" Line 726: Return("washington") Line 727: Case "WV" Line 728: Return("west-virginia") Line 729: Case "WI" Line 730: Return("wisconsin") Line 731: Case "WY" Line 732: Return("wyoming") Line 733: Case "AB" Line 734: Return("alberta") Line 735: Case "BC" Line 736: Return("british-columbia") Line 737: Case "MB" Line 738: Return("manitoba") Line 739: Case "NB" Line 740: Return("new-brunswick") Line 741: Case "NL" Line 742: Return("newfoundland") Line 743: Case "NS" Line 744: Return("nova-scotia") Line 745: Case "NT" Line 746: Return("northwest-territories") Line 747: Case "NU" Line 748: Return("nunavut") Line 749: Case "ON" Line 750: Return("ontario") Line 751: Case "PE" Line 752: Return("prince-edward-island") Line 753: Case "QC" Line 754: Return("quebec") Line 755: Case "SK" Line 756: Return("saskatchewan") Line 757: Case "YT" Line 758: Return("yukon") Line 759: Case Else Line 760: Return("") Line 761: End Select Line 762: End Function Line 763: Line 764: Function getStateLarge(ByVal strState As String) Line 765: Select Case (strState & "").ToUpper() Line 766: Case "AL" Line 767: Return("Alabama") Line 768: Case "AK" Line 769: Return("Alaska") Line 770: Case "AZ" Line 771: Return("Arizona") Line 772: Case "AR" Line 773: Return("Arkansas") Line 774: Case "CA" Line 775: Return("California") Line 776: Case "CO" Line 777: Return("Colorado") Line 778: Case "CT" Line 779: Return("Connecticut") Line 780: Case "DE" Line 781: Return("Delaware") Line 782: Case "DC" Line 783: Return("District of Columbia") Line 784: Case "FL" Line 785: Return("Florida") Line 786: Case "GA" Line 787: Return("Georgia") Line 788: Case "HI" Line 789: Return("Hawaii") Line 790: Case "ID" Line 791: Return("Idaho") Line 792: Case "IL" Line 793: Return("Illinois") Line 794: Case "IN" Line 795: Return("Indiana") Line 796: Case "IA" Line 797: Return("Iowa") Line 798: Case "KS" Line 799: Return("Kansas") Line 800: Case "KY" Line 801: Return("Kentucky") Line 802: Case "LA" Line 803: Return("Louisiana") Line 804: Case "ME" Line 805: Return("Maine") Line 806: Case "MD" Line 807: Return("Maryland") Line 808: Case "MA" Line 809: Return("Massachusetts") Line 810: Case "MI" Line 811: Return("Michigan") Line 812: Case "MN" Line 813: Return("Minnesota") Line 814: Case "MS" Line 815: Return("Mississippi") Line 816: Case "MO" Line 817: Return("Missouri") Line 818: Case "MT" Line 819: Return("Montana") Line 820: Case "NE" Line 821: Return("Nebraska") Line 822: Case "NV" Line 823: Return("Nevada") Line 824: Case "NH" Line 825: Return("New Hampshire") Line 826: Case "NJ" Line 827: Return("New Jersey") Line 828: Case "NM" Line 829: Return("New Mexico") Line 830: Case "NY" Line 831: Return("New York") Line 832: Case "NC" Line 833: Return("North Carolina") Line 834: Case "ND" Line 835: Return("North Dakota") Line 836: Case "OH" Line 837: Return("Ohio") Line 838: Case "OK" Line 839: Return("Oklahoma") Line 840: Case "OR" Line 841: Return("Oregon") Line 842: Case "PA" Line 843: Return("Pennsylvania") Line 844: Case "PR" Line 845: Return("Puerto Rico") Line 846: Case "RI" Line 847: Return("Rhode Island") Line 848: Case "SC" Line 849: Return("South Carolina") Line 850: Case "SD" Line 851: Return("South Dakota") Line 852: Case "TN" Line 853: Return("Tennessee") Line 854: Case "TX" Line 855: Return("Texas") Line 856: Case "UT" Line 857: Return("Utah") Line 858: Case "VT" Line 859: Return("Vermont") Line 860: Case "VA" Line 861: Return("Virginia") Line 862: Case "WA" Line 863: Return("Washington") Line 864: Case "WV" Line 865: Return("West Virginia") Line 866: Case "WI" Line 867: Return("Wisconsin") Line 868: Case "WY" Line 869: Return("Wyoming") Line 870: Case "AB" Line 871: Return("Alberta") Line 872: Case "BC" Line 873: Return("British Columbia") Line 874: Case "MB" Line 875: Return("Manitoba") Line 876: Case "NB" Line 877: Return("New Brunswick") Line 878: Case "NL" Line 879: Return("Newfoundland") Line 880: Case "NS" Line 881: Return("Nova Scotia") Line 882: Case "NT" Line 883: Return("Northwest Territories") Line 884: Case "NU" Line 885: Return("Nunavut") Line 886: Case "ON" Line 887: Return("Ontario") Line 888: Case "PE" Line 889: Return("Prince Edward Island") Line 890: Case "QC" Line 891: Return("Quebec") Line 892: Case "SK" Line 893: Return("Saskatchewan") Line 894: Case "YT" Line 895: Return("Yukon") Line 896: Case Else Line 897: Return("") Line 898: End Select Line 899: End Function Line 900: Line 901: Function SitesStateArray() As String(,) Line 902: Dim statesArray(,) As String = {{"7", "AL", "Alabama"}, {"36", "AK", "Alaska"}, {"84", "AZ", "Arizona"}, {"37", "AR", "Arkansas"}, _ Line 903: {"2", "CA", "California"}, {"45", "CO", "Colorado"}, {"8", "CT", "Connecticut"}, {"3", "DE", "Delaware"}, {"4", "FL", "Florida"}, _ Line 904: {"92", "GA", "Georgia"}, {"38", "HI", "Hawaii"}, {"43", "ID", "Idaho"}, {"51", "IL", "Illinois"}, {"58", "IN", "Indiana"}, _ Line 905: {"57", "IA", "Iowa"}, {"55", "KS", "Kansas"}, {"76", "KY", "Kentucky"}, {"56", "LA", "Louisiana"}, {"44", "ME", "Maine"}, _ Line 906: {"46", "MD", "Maryland"}, {"10", "MA", "Massachusetts"}, {"52", "MI", "Michigan"}, {"26", "MN", "Minnesota"}, {"42", "MS", "Mississippi"}, _ Line 907: {"77", "MO", "Missouri"}, {"41", "MT", "Montana"}, {"35", "NE", "Nebraska"}, {"5", "NV", "Nevada"}, {"39", "NH", "New Hampshire"}, _ Line 908: {"13", "NJ", "New Jersey"}, {"34", "NM", "New Mexico"}, {"20", "NY", "New York"}, {"15", "NC", "North Carolina"}, _ Line 909: {"40", "ND", "North Dakota"}, {"54", "OH", "Ohio"}, {"49", "OK", "Oklahoma"}, {"16", "OR", "Oregon"}, {"50", "PA", "Pennsylvania"}, _ Line 910: {"53", "RI", "Rhode Island"}, {"18", "SC", "South Carolina"}, {"33", "SD", "South Dakota"}, {"28", "TN", "Tennessee"}, _ Line 911: {"27", "TX", "Texas"}, {"47", "UT", "Utah"}, {"30", "VT", "Vermont"}, {"6", "VA", "Virginia"}, {"48", "WA", "Washington"}, _ Line 912: {"31", "WV", "West Virginia"}, {"24", "WI", "Wisconsin"}, {"32", "WY", "Wyoming"}} Line 913: Line 914: Return statesArray Line 915: End Function Line 916: Line 917: #End ExternalSource Line 918: Line 919: Line 920: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Line 921: Public Sub New() Line 922: MyBase.New Line 923: Dim dependencies() As String Line 924: CType(Me,Global.System.Web.UI.Page).AppRelativeVirtualPath = "~/include/functions.aspx" Line 925: If (Global.ASP.include_functions_aspx.__initialized = false) Then Line 926: dependencies = New String(0) {} Line 927: dependencies(0) = "~/include/functions.aspx" Line 928: Global.ASP.include_functions_aspx.__fileDependencies = Me.GetWrappedFileDependencies(dependencies) Line 929: Global.ASP.include_functions_aspx.__initialized = true Line 930: End If Line 931: Me.Server.ScriptTimeout = 30000000 Line 932: End Sub Line 933: Line 934: Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile Line 935: Get Line 936: Return CType(Me.Context.Profile,System.Web.Profile.DefaultProfile) Line 937: End Get Line 938: End Property Line 939: Line 940: Protected ReadOnly Property ApplicationInstance() As ASP.global_asax Line 941: Get Line 942: Return CType(Me.Context.ApplicationInstance,ASP.global_asax) Line 943: End Get Line 944: End Property Line 945: Line 946: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Line 947: Private Sub __BuildControlTree(ByVal __ctrl As include_functions_aspx) Line 948: Line 949: #ExternalSource("D:\home\site\wwwroot\include\functions.aspx",1) Line 950: Me.InitializeCulture Line 951: Line 952: #End ExternalSource Line 953: End Sub Line 954: Line 955: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Line 956: Protected Overrides Sub FrameworkInitialize() Line 957: MyBase.FrameworkInitialize Line 958: Me.__BuildControlTree(Me) Line 959: Me.AddWrappedFileDependencies(Global.ASP.include_functions_aspx.__fileDependencies) Line 960: Me.Request.ValidateInput Line 961: End Sub Line 962: Line 963: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Line 964: Public Overrides Function GetTypeHashCode() As Integer Line 965: Return 5381 Line 966: End Function Line 967: Line 968: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Line 969: Public Overrides Sub ProcessRequest(ByVal context As System.Web.HttpContext) Line 970: MyBase.ProcessRequest(context) Line 971: End Sub Line 972: End Class Line 973: End Namespace Line 974:   Version Information: Microsoft .NET Framework Version:2.0.50727.8964; ASP.NET Version:2.0.50727.8962 / jester
John Doe · June 14, 2023, 10:59 a.m.
지난해 11월 가수 이승기씨가 18년간 몸담아온 후크엔터테인먼트로부터 음원 사용료를 받지 못했다고 폭로하며 시작된 ‘이승기 사태’는 곧바로 정치권의 연예인 권리 보호 논의로 이어졌다. 연예인 소속사의 수익 정산 내역을 의무 공개하는 내용의 이승기법(대중문화예술산업발전법 개정안)이 발의됐고, 지난 4월 21일 국회 문화체육관광위원회 문턱까지 넘었다. ... 그래 여기까지만 하면 좋다 이거야. 근데 문제는?? 쟁점이 된 부분은 청소년 연예인의 근로 시간과 관련한 내용이다. 소속사와의 투명한 정산 관계 보장이라는 당초 목적과 달리 국회 논의를 거치면서 추가된 내용이다. 애초 이 내용은 이승기 사태가 터지기 전인 지난해 5월 유정주 더불어민주당 의원이 발의한 법안에 있던 내용인데, 국회 심사 과정에서 병합됐다. 이승기법이 주목받자 숟가락 얹기식으로 포함 된 내용 중 하나. 법안은 현행 ‘15세 미만은 주 35시간, 15세 이상은 주 40시간’으로 규정된 청소년 연예인 노동시간 상한 규정을 세분화하고 단축했다. ‘12세 미만은 주 25시간(일 6시간), 12세 이상 15세 미만은 주 30시간(일 7시간), 15세 이상은 주 35시간(일 7시간)’으로 규정했다. 또 ‘15세 이상은 당사자 간 합의에 따라 일주일에 최대 6시간까지 근로 시간을 연장할 수 있다’는 현행 조항도 ‘5시간’으로 줄였다.   홍익표 국회 문화체육관광 위원장이 지난 4월 21일 서울 여의도 국회에서 열린 문화체육관광위원회 전체회의에서 의사봉을 두드리고 있다. 뉴스1   이렇게 36살 이승기와 관련도 없는 청소년 연예인 근로 시간 문제가 느닷없이 추가돼 국회에서 논의되자, 업계에선 즉각 반발이 터져 나왔다. 한국음악콘텐츠협회·한국연예제작자협회·한국매니지먼트연합·한국음반산업협회·한국음악레이블산업협회 등 5개 단체는 지난달 16일 성명서를 내고 “업계와 논의 없이 의결된 대중문화예술산업발전법 개정안에 대해 유감을 표한다”고 밝혔다. 이들은 또 “연령을 세분화해 청소년 연예인의 용역 제공 시간을 제한하는 이번 개정안은 현실을 외면한 ‘대중문화산업 발전 저해 법안’”이라고도 주장했다. ...   유정주 더불어민주당 의원이 발의한 법안. 더듬당이 민식이법 만들어서 좋아진 사람??? 응 한명도없죠?? 검수완박법 만들어서 살림살이 나아진 사람??? 응 한명도없죠?? 개쓰레기 5030 정책도 마찬가지. 교통사고는 전혀 안 줄어들고, 오히려 기름값만 더 들고. 세금만 참 개같이 걷는 중이죠? 아이들이 차에 뛰어드는 민식이 놀이하고, 검찰들은 일에 치여 수사 밀리고 재판 지연되고 피해자만 피보는 중이죠? 양곡관리법, 노랑봉투법, 간호사법, 사회적 경제기본법 죄다 피해가 우려되는데 입법폭주 하고있는 중이죠? 더듬당이 사라져야 나라가 살아요. 입법이 정상화 돼요.   가정 파괴시키는 민식이법!!! 아무 짝에도 쓸모없는 5030속도 제한 정책!!! 노조만을 위한 노란 봉투법!!! 의료계 갈라치기로 환자들만 피해보는 간호사법!!! 소득주도 성장으로 자영업자들과 중산층 붕괴 시킨 무능 좌파들!!! 부동산 임대차 3법으로 집 없는 서민들을 더욱더 서럽게 만들고 전세사기 환경 조성한 더듬어 만진당 부터 공중분해가 답이죠??   최저시급 겁나게 올려놓고 지는 무료봉사 알바생 구하던 늙은이도 있었음. 역시 개좆같은 법은 전부 더불어공산당으로부터 나온다는 건 팩트다. 내년 총선에서 시궁창보다 더럽고 후쿠시마처리수보다 역겨운 더불어공산당을 반드시 몰아내야 한다.   17살 이서 울린 36살 이승기? 국회 추진 '이승기법' 황당 파장 소속사로부터 정산을 제대로 받지 못하고 돈을 떼이는 연예인을 막기 위해 추진되는 일명 ‘이승기법’에 대해 연예계에서 우려의 목소리가 나오고 있다. 지난해 11월 가수 이승기씨가 18년간 몸담아온 후크엔터테인먼트로부터 https://n.news.naver.com/mnews/article/025/0003284536
John Doe · June 3, 2023, 6:11 a.m.
I tried the below code on my Mac, and it worked perfectly fine. I don't need to login again. from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait chrome_options = Options() chrome_options.add_experimental_option("detach", True) chrome_options.add_argument("user-data-dir=/tmp/oriel") # chrome_options.add_argument("--start-maximized") browser = webdriver.Chrome(options=chrome_options) wait = WebDriverWait(browser, 10) url = "https://oriel.com" browser.get(url) browser.implicitly_wait(1) print(browser.title) For window you can try changing the path as below chrome_options.add_argument("user-data-dir=C:\\Users\\Oriel\\AppData\\Local\\Google\\Chrome\\User Data\\Default")   Ref. Using selenium: How to keep logged in after closing Driver in Python I want to get my Whatsapp web (web.whatsapp.com) logged in, at the second time opening the Whatsapp web on chrome driver. Following is my code based on Python need your help. from selenium import https://stackoverflow.com/questions/45651879/using-selenium-how-to-keep-logged-in-after-closing-driver-in-python How to start ChromeDriver with existing login GroupsSign inGroupsSelenium UsersConversationsLabelsAboutSend feedbackHelpPrivacy • TermsHow to start ChromeDriver with existing login 11741 viewsChromeJavaSkip to first unread messageTiếu Thủyunread,Nov 26, 2014, 11:59:10 PM11/26/14Reply to auth https://groups.google.com/g/selenium-users/c/CL8kdxhgdj0
John Doe · June 2, 2023, 3:23 a.m.
selenium
Check this out!   <!DOCTYPE html> <html> <head> <title>Move (drag/pan) and zoom object (image or div) in pure js</title> <style> html, body { margin: 0; padding: 0; } #zoomContainer { width: 100vw; height: 100vh; overflow: hidden; position: relative; } #zoomImage { position: absolute; cursor: move; transition: transform 0.3s; max-width: 100%; max-height: 100%; top: 0; left: 0; width: 100%; height: 100%; } .zoomButton { position: fixed; top: 20px; padding: 10px; font-size: 16px; background-color: #ffffff; border: none; cursor: pointer; } #zoomInButton { left: 20px; } #zoomOutButton { left: 60px; } </style> </head> <body> <div id="zoomContainer"> <img id="zoomImage" src="bg.jpg" alt="zoom image" /> </div> <button id="zoomInButton" class="zoomButton">zoom in</button> <button id="zoomOutButton" class="zoomButton">zoom out</button> <script> document.addEventListener('DOMContentLoaded', function() { var zoomContainer = document.getElementById('zoomContainer'); var zoomImage = document.getElementById('zoomImage'); var zoomLevel = 1; var minZoomLevel = 1; var maxZoomLevel = 2; var zoomIncrement = 0.2; var isDragging = false; let newPosX = 0, newPosY = 0, startPosX = 0, startPosY = 0; function updateZoomedImage() { var imageWidth = zoomImage.offsetWidth; var imageHeight = zoomImage.offsetHeight; var newImageWidth = imageWidth * zoomLevel; var newImageHeight = imageHeight * zoomLevel; var left = zoomImage.offsetLeft; var top = zoomImage.offsetTop; zoomImage.style.transform = 'scale(' + zoomLevel + ')'; zoomImage.style.width = newImageWidth + 'px'; zoomImage.style.height = newImageHeight + 'px'; // Restrict images from leaving containers if (Math.abs(zoomImage.offsetLeft - newPosX) >= Math.abs((parseInt(zoomImage.style.width, 10) - window.innerWidth) / 2)) { left = 0; } if (Math.abs(zoomImage.offsetTop - newPosY) >= Math.abs((parseInt(zoomImage.style.height, 10) - window.innerHeight) / 2)) { top = 0; } zoomImage.style.left = left + 'px'; zoomImage.style.top = top + 'px'; // when the user clicks down on the element zoomImage.addEventListener('mousedown', function(e) { e.preventDefault(); // get the starting position of the cursor startPosX = e.clientX; startPosY = e.clientY; document.addEventListener('mousemove', mouseMove); document.addEventListener('mouseup', function() { document.removeEventListener('mousemove', mouseMove); }); }); } function zoomIn() { if (zoomLevel < maxZoomLevel) { zoomLevel += zoomIncrement; zoomLevel = Math.min(zoomLevel, maxZoomLevel); updateZoomedImage(); } if (zoomLevel === maxZoomLevel) { document.getElementById('zoomInButton').disabled = true; } document.getElementById('zoomOutButton').disabled = false; } function zoomOut() { if (zoomLevel > minZoomLevel) { zoomLevel -= zoomIncrement; zoomLevel = Math.max(zoomLevel, minZoomLevel); updateZoomedImage(); } if (zoomLevel === minZoomLevel) { document.getElementById('zoomOutButton').disabled = true; } document.getElementById('zoomInButton').disabled = false; if (zoomLevel === 1) { zoomImage.style.cursor = 'move'; } } function mouseMove(e) { // calculate the new position newPosX = startPosX - e.clientX; newPosY = startPosY - e.clientY; // with each move we also want to update the start X and Y startPosX = e.clientX; startPosY = e.clientY; // Restrict images from leaving containers if (Math.abs(zoomImage.offsetLeft - newPosX) >= Math.abs((parseInt(zoomImage.style.width, 10) - window.innerWidth) / 2) || Math.abs(zoomImage.offsetTop - newPosY) >= Math.abs((parseInt(zoomImage.style.height, 10) - window.innerHeight) / 2) ) { return; } // set the element's new position: zoomImage.style.left = (zoomImage.offsetLeft - newPosX) + "px"; zoomImage.style.top = (zoomImage.offsetTop - newPosY) + "px"; } function initialize() { var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; zoomContainer.style.width = windowWidth + 'px'; zoomContainer.style.height = windowHeight + 'px'; updateZoomedImage(); document.getElementById('zoomInButton').addEventListener('click', zoomIn); document.getElementById('zoomOutButton').addEventListener('click', zoomOut); } initialize(); window.addEventListener('resize', function() { initialize(); }); }); </script> </body> </html>   Result: Edit fiddle - JSFiddle - Code Playground Close Start with a boilerplate: jQuery Vue React React + JSX Preact TypeScript CoffeeScript SCSS CSS Grid Bootstrap PostCSS Show boilerplate bar less often? Links: ?? Roadmap (vote for features) ? Bug tracker ? Docs ? Service status Support JSFiddle and g https://jsfiddle.net/xxxvvvxxx/ygwqxcpm/   Ref. How to drag an element using javascript While building out a new image generator, I needed a way to drag and move HTML elements inside of another element. Take a look at what I was building below: This is actually the new Post Image Genera... https://devdojo.com/tnylea/how-to-drag-an-element-using-javascript
John Doe · June 2, 2023, 1:22 a.m.
John Doe · May 30, 2023, 8:06 p.m.
1. Write a Python program to check whether a given number is a narcissistic number or not. For example, 371 is a narcissistic number; it has three digits, and if we cube each digits 33 + 73 + 13 the sum is 371. Other 3-digit narcissistic numbers are 153 = 13 + 53 + 33 370 = 33 + 73 + 03 407 = 43 + 03 + 73. def is_narcissistic_num(num): return num == sum([int(x) ** len(str(num)) for x in str(num)]) for x in range(100, 1000): if is_narcissistic_num(x): print(x) Result: 153 370 371 407   2. Print a customized calendar. import calendar import re yy = int(input("Enter the year number: ")) mm = int(input("Enter the month number: ")) calendar.setfirstweekday(calendar.SUNDAY) x = calendar.month(yy, mm, 3) pattern = rf" {yy}\n" x = re.sub(pattern, "{}----------------------------\n".format(pattern), x) print(x) Result: Enter the year number: 2023 Enter the month number: 5 May 2023 ---------------------------- Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Process finished with exit code 0 Ref. Print a calendar starting from today's date I want to print a calendar of the current month but starting from today's date in python. Is there any way I can do this? Only thing I thought to try was : import calendar y = int(input(&quot;Input... https://stackoverflow.com/questions/62861105/print-a-calendar-starting-from-todays-date   3. Use Python turtle to plot a function. import turtle as t def line(x1,y1,x2,y2): t.up() t.goto(x1,y1) t.down() t.goto(x2,y2) return line(0,300,0,0) line(0,0,300,0) t.goto(0,0) t.shape("turtle") t.color("red") for x in range(0, 151): y = pow(x, 2) + 1 t.goto(x, y * 0.01) t.done() Result:   4. Replace Python list of blank elements with a specific value (list comprehension) z_list = ['oriel', 'indifference', '', 'hypomania', '', 'my'] z_list = ['xxx' if x == '' else x for x in z_list] print(z_list)   5. The prime numbers from 1 to 100 num=0 while num <= 100: cnt = 0 i = 1 while i<=num: if num % i == 0: cnt += 1 i += 1 if cnt == 2: print(num, end=" ") num += 1 Result: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
John Doe · May 22, 2023, 2:42 a.m.
Sample code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <script src='https://code.jquery.com/jquery-1.9.1.js'></script> <style> * { box-sizing: border-box; margin: 0px; } .scene { width: 100%; height: 100vh; perspective: 1000px; } .cube { width: 100%; height: 100vh; position: relative; transform-style: preserve-3d; transform: translateZ(-50vh); transition: transform 1s; } .cube.show-front { transform: translateZ(-50vh) rotateY( 0deg); } .cube.show-bottom { transform: translateZ(-50vh) rotateX( 90deg); } .cube__face { position: absolute; width: 100%; height: 100vh; font-size: 40px; font-weight: bold; color: white; text-align: center; } .cube__face--front { background: hsla( 0, 100%, 50%, 0.7); transform: rotateY( 0deg) translateZ(50vh); } .cube__face--bottom { background: hsla(300, 100%, 50%, 0.7); transform: rotateX(-90deg) translateZ(50vh); } #ajax-loading-screen { background-color: transparent; width: 100%; height: 100%; position: fixed; top: 0; left: 0; display: block; z-index: 1000000000; } #ajax-loading-screen .mask-top { top: 0; left: 0; height: 50%; width: 100%; } #ajax-loading-screen .mask-right { top: 0; right: 0; height: 100%; width: 50%; } #ajax-loading-screen .mask-bottom { bottom: 0; right: 0; height: 50%; width: 100%; } #ajax-loading-screen .mask-left { top: 0; left: 0; height: 100%; width: 50%; } #ajax-loading-screen[data-effect="center_mask_reveal"] span { position: absolute; background: #fff; z-index: 100; -webkit-transition: 0.8s cubic-bezier(0.12,0.75,0.4,1); transition: 0.8s cubic-bezier(0.12,0.75,0.4,1); } #ajax-loading-screen.loaded .mask-top { -webkit-transform: translateY(-100%) translateZ(0); -ms-transform: translateY(-100%) translateZ(0); transform: translateY(-100%) translateZ(0); } #ajax-loading-screen.loaded .mask-right { -webkit-transform: translateX(100%) translateZ(0); -ms-transform: translateX(100%) translateZ(0); transform: translateX(100%) translateZ(0); } #ajax-loading-screen.loaded .mask-bottom { -webkit-transform: translateY(100%) translateZ(0); -ms-transform: translateY(100%) translateZ(0); transform: translateY(100%) translateZ(0); } #ajax-loading-screen.loaded .mask-left { -webkit-transform: translateX(-100%) translateZ(0); -ms-transform: translateX(-100%) translateZ(0); transform: translateX(-100%) translateZ(0); } </style> </head> <body> <div id="ajax-loading-screen" data-effect="center_mask_reveal"> <span class="mask-top"></span> <span class="mask-right"></span> <span class="mask-bottom"></span> <span class="mask-left"></span> </div> <div class="scene"> <div class="cube"> <div class="cube__face cube__face--front">ORIEL</div> <div class="cube__face cube__face--bottom">INDIFFERENCE</div> </div> </div> <script> var currentClass = ''; var cube = document.querySelector('.cube'); var showClass = ''; window.addEventListener('wheel', function(event) { if ( currentClass ) { cube.classList.remove( currentClass ); } if (event.deltaY < 0) { showClass = 'show-front'; } else if (event.deltaY > 0) { showClass = 'show-bottom'; } cube.classList.add( showClass ); currentClass = showClass; }); $(function() { $("#ajax-loading-screen").addClass("loaded"); setTimeout(function() { $("#ajax-loading-screen").hide(); }, 800); }); </script> </body> </html>   Result: Edit fiddle - JSFiddle - Code Playground Close Start with a boilerplate: jQuery Vue React React + JSX Preact TypeScript CoffeeScript SCSS CSS Grid Bootstrap PostCSS Show boilerplate bar less often? Links: ?? Roadmap (vote for features) ? Bug tracker ? Docs ? Service status Support JSFiddle and g https://jsfiddle.net/xxxvvvxxx/j4619srL/   Ref. https://codepen.io/desandro/pen/KRWjzm
John Doe · May 21, 2023, 10:37 p.m.
from turtle import Turtle, Screen screen = Screen() screen.bgcolor("lightgreen") turtle1 = Turtle(shape='turtle') turtle1.color('red') turtle1.speed("slow") # = 3 turtle1.penup() turtle2 = Turtle(shape='arrow') turtle2.color('blue') turtle2.speed(4) # "slow" (3) < 4 < "normal" (6) turtle2.penup() # user input function perimeter = screen.numinput("Track Perimeter", "Please enter the perimeter:", default=2000, minval=500, maxval=3000) def full_track_crawl(turtle, shortside, longside): speed = turtle.speed() turtle.pendown() for j in range (2): for i in range(0, int(shortside), speed): turtle.forward(speed) yield(0) turtle.left(90) for i in range(0, int(longside), speed): turtle.forward(speed) yield(0) turtle.left(90) turtle.penup() # set the track def drawTrack(perimeter, ratio): shortside = (perimeter / 2.0) / (ratio + 1) longside = ratio * shortside screen.setup(shortside * 2 + 60, longside + 40) turtle1.setposition(-shortside - 10, -longside / 2) turtle2.setposition(10, -longside / 2) generator1 = full_track_crawl(turtle1, shortside, longside) generator2 = full_track_crawl(turtle2, shortside, longside) while (next(generator1, 1) + next(generator2, 1) < 2): pass drawTrack(perimeter, 2) screen.exitonclick()   Result:   Ref. How to move multiple turtles at the same time? I have an assignment which is asked to set two turtles in a race track (same size but separate track). I am able to make them move, but the second one moves only when the first one moved a half of ... https://stackoverflow.com/questions/40050438/how-to-move-multiple-turtles-at-the-same-time
John Doe · May 21, 2023, 9:56 p.m.
발로 만든 게임.ㅋㅋ import turtle as t import random as r import tkinter as tk from tkinter import messagebox def nemo(w, h, c): t.fillcolor(c) t.begin_fill() t.fd(w) t.rt(90) t.fd(h) t.rt(90) t.fd(w) t.rt(90) t.fd(h) t.end_fill() def button(x, y, b_c, msg): t.pu() t.goto(x, y) t.seth(0) nemo(b_w, b_h, b_c) t.goto(x + b_w/2, y - b_h) t.pencolor('white') t.write(msg, align = 'center', font=("Arial", 30, "normal")) b_w = 200; b_h = 60 rock_x = 300; rock_y = 200 scissors_x = 300; scissors_y = 300 paper_x = 300; paper_y = 100 q_x = 300; q_y = -200 c_x = -500; c_y = 300; p_x = -100; p_y = 300 t.speed(500) win = t.Screen() win.setup(1200, 800) button(scissors_x, scissors_y, 'blue', 'Scissors') button(rock_x, rock_y, 'blue', 'Rock') button(paper_x, paper_y, 'blue', 'Paper') button(q_x, q_y, 'black', 'QUIT') button(c_x, c_y, 'red', 'Computer') button(p_x, p_y, 'green', 'Player') t.addshape('imgs/scissors.gif') t.addshape('imgs/rock.gif') t.addshape('imgs/paper.gif') t.title("ORIEL") com = t.Turtle('imgs/paper.gif') player = t.Turtle('imgs/paper.gif') com.pu(); player.pu() com.goto(-400, 0); player.goto(0, 0) t.pu() t.goto(999,999) pw = 0; p = 2 cw = 0; c = 2 def game(c, p): global cw global pw if p == 0: if c == 0: com.shape('imgs/scissors.gif') elif c == 1: com.shape('imgs/rock.gif') cw += 1 else: com.shape('imgs/paper.gif') pw += 1 elif p == 1: if c == 0: com.shape('imgs/scissors.gif') pw += 1 elif c == 1: com.shape('imgs/rock.gif') else: com.shape('imgs/paper.gif') cw += 1 elif p == 2: if c == 0: com.shape('imgs/scissors.gif') cw += 1 elif c == 1: com.shape('imgs/rock.gif') pw += 1 else: com.shape('imgs/paper.gif') if pw == 2 or cw == 2: if pw == 2: print("I won the game. {}:{}".format(pw, cw)) elif cw == 2: print("I lost the game. {}:{}".format(pw, cw)) msg_box = tk.messagebox.askquestion('ORIEL', 'Do you want to continue?', icon='info') if msg_box == 'yes': pw=0; cw=0 else: win.bye() def check(x, y): if(x >= rock_x and x <= rock_x+b_w and y <= rock_y and y >= rock_y-b_h): p = 1 player.shape('imgs/rock.gif') c = r.randint(0, 2) game(c, p) elif(x >= scissors_x and x <= scissors_x+b_w and y <= scissors_y and y >= scissors_y-b_h): p = 0 player.shape('imgs/scissors.gif') c = r.randint(0, 2) game(c, p) elif(x >= paper_x and x <= paper_x+b_w and y <= paper_y and y >= paper_y-b_h): p = 2 player.shape('imgs/paper.gif') c = r.randint(0, 2) game(c, p) elif(x >= q_x and x <= q_x+b_w and y <= q_y and y >= q_y-b_h): win.bye() else: t.goto(999,999) win.onclick(check) t.done()
John Doe · May 15, 2023, 8:23 p.m.
python game