logs
stringlengths
104
251k
import socket socket.setdefaulttimeout(30000) sock = socket.socket() sock.connect(('www.google.com', 443)) ssl = socket.ssl(sock)
import socket socket.setdefaulttimeout(30000) sock = socket.socket() sock.connect(('www.google.com', 443)) ssl = socket.ssl(sock)
DATA SEGMENT 'DATA' ERROR_MSG DB 'DS:DX is wrong' MSG DB 0AH, 0DH, 'Hello, Adam', '$' CHAR DB 00H DATA ENDS
do read the count perform mathematical operation interlockedcompareexchange( destination, updated count, old count) until the interlockedcompareexchange returns the success code.
ActiveRecord::MultiparameterAssignmentErrors in WidgetsController#update 1 error(s) on assignment of multiparameter attributes
ActiveRecord::MultiparameterAssignmentErrors in WidgetsController#update 1 error(s) on assignment of multiparameter attributes
*PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB
*PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB
TimerTask ft = new TimerTask(){ public void run(){ if (!isFinished){ urlConn.getInputStream().close(); urlConn.getOutputStream().close(); } } }; (new Timer()).schedule(ft, timeout);
import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.internal.compiler.ClassFile; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.Compiler; import or...
Function ConcatADO(strSQL As String, strColDelim, strRowDelim, ParamArray NameList() As Variant) Dim rs As New ADODB.Recordset Dim strList As String On Error GoTo Proc_Err If strSQL <> "" Then rs.Open strSQL, CurrentProject.Connection strList = rs.GetString(, , strColDelim, strRo...
General-purpose utility class for generating XML (may eventually be expanded to produce more output types) Sample usage: from Ft.Xml import MarkupWriter writer = MarkupWriter(indent=u"yes") writer.startDocument() writer.startElement(u'xsa') writer.startElement(u'vendor') #Element with simple text (#PCDATA) content wr...
General-purpose utility class for generating XML (may eventually be expanded to produce more output types) Sample usage: from Ft.Xml import MarkupWriter writer = MarkupWriter(indent=u"yes") writer.startDocument() writer.startElement(u'xsa') writer.startElement(u'vendor') #Element with simple text (#PCDATA) content wr...
>>> import tempfile, shutil >>> f = tempfile.TemporaryFile(mode ='w+t') >>> f.write('foo') >>> shutil.copy(f.name, 'bar.txt') Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> shutil.copy(f.name, 'bar.txt') File "C:\Python25\lib\shutil.py", line 80, in copy copyfile(src, dst) Fil...
<configuration> <system.web> <sessionState timeout="60" /> ... other elements omitted ... </system.web> ... other elements omitted .... </configuration>
import urllib2, cStringIO, zipfile try: remotezip = urllib2.urlopen(url) zipinmemory = cStringIO.StringIO(remotezip.read()) zip = zipfile.ZipFile(zipinmemory) for fn in zip.namelist(): if fn.endswith(".ranks"): ranks_data = zip.read(fn) for line in ranks_data.split("\n")...
public class CountToSelectedTextConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if ((int)value == 1) return "item selected"; else return "...
try { fileOpen("no real file Name"); String s = "GO TROJANS"; } catch (Exception) { print(s); }
EventManager.RegisterClassHandler(typeof(ListBox), ListBox.SelectionChanged, new SelectionChangedEventHandler(this.OnListBoxSelectionChanged));
from socket import * from time import sleep class Sender: def __init__(self, server): self.port = 1975 self.server = server self.buffer = 102400 def sendPacket(self, packet): sock = socket(AF_INET, SOCK_DGRAM) sock.settimeout(10.75) sock.sendto(packet, (self.serve...
xrange(2**32-1, 2**32+1) # When long is 32 bits, OverflowError: Python int too large to convert to C long range(2**32-1, 2**32+1) # OK --> [4294967295L, 4294967296L]
Msg 213, Level 16, State 1, Procedure companies_contactInfo_updateTerritories, Line 20 Insert Error: Column name or number of supplied values does not match table definition.
Msg 213, Level 16, State 1, Procedure companies_contactInfo_updateTerritories, Line 20 Insert Error: Column name or number of supplied values does not match table definition.
BOOL IsUacEnabled( ) { LPCTSTR pszSubKey = _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"); LPCTSTR pszValue = _T("EnableLUA"); DWORD dwType = 0; DWORD dwValue = 0; DWORD dwValueSize = sizeof( DWORD ); if ( ERROR_SUCCESS != SHGetValue( HKEY_LOCAL_MACHINE, pszSubKey, pszValu...
public foo(..) { try { ... } catch (NullReferenceException ex) { DoSmth(e); } catch (ArgumentExcetion ex) { DoSmth(e); } catch (Exception ex) { DoSmth(e); } }
public void connect() throws ConnectionException { try { File conf = new File("blabla"); ... } catch (FileNotFoundException ex) { LOGGER.error("log message", ex); throw new ConnectionException("The configuration file was not found", ex); } }
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { LogException(e.Exception); } static void LogException(Exception ex) { YYYExceptionHandling.HandleException(ex, YYYExceptionHandling.ExceptionPolicyType.YYY_Policy, YYYExceptionHandling.ExceptionPriority.Medium,...
Set db = CurrentDb Set qdf = db.QueryDefs("AddHospital") qdf.Parameters!txtHospital = Trim(Me.HospName) qdf.ReturnsRecords = False qdf.Execute dbFailOnError intResult = qdf.RecordsAffected
Set db = CurrentDb Set qdf = db.QueryDefs("AddHospital") qdf.Parameters!txtHospital = Trim(Me.HospName) qdf.ReturnsRecords = False qdf.Execute dbFailOnError intResult = qdf.RecordsAffected
void lock() { #ifdef WIN32 EnterCriticalSection(...) #endif #ifdef POSIX pthread_mutex_lock(...) #endif }
Public void Sum_Negative_Number_As_1st_Param_Exception_Thrown() Public void Sum_Negative_Number_As_2nd_Param_Exception_Thrown () Public void Sum_Simple_Values_Calculated ()
Public void Sum_Negative_Number_As_1st_Param_Exception_Thrown() Public void Sum_Negative_Number_As_2nd_Param_Exception_Thrown () Public void Sum_Simple_Values_Calculated ()
public void init(ServletConfig servletConfig) throws ServletException{ super.init(servletConfig); String path = servletConfig.getServletContext().getRealPath("/WEB-INF")
#define RAISE_ERROR_STL(p_strMessage) \ do \ { \ try ...
public class NotForAnyoneElse { public NotForAnyoneElse() { if (typeof(NotForAnyoneElse).Assembly.GetName().GetPublicKeyToken() != Assembly.GetEntryAssembly().GetName().GetPublicKeyToken()) { throw new SomeException(...); } } }
[DataContract] public class ValidationFault { [DataMember] public Dictionary<string, string> Errors { get; private set; } [DataMember] public bool Fatal { get; private set; } [DataMember] public Guid SeriesIdentifier { get; private set; } public ValidationFault(Guid id, string argument, s...
static void TryCatchFinally() { StreamReader sr = null; try { sr = new StreamReader(path); Console.WriteLine(sr.ReadToEnd()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } finally { if (sr != null) { sr.Close(); ...
DECLARE input_string VARCHAR2(16) := 'tigertigertigert'; raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(input_string); key_string VARCHAR2(8) := 'scottsco'; raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(key_string); encrypted_raw RAW(2048); encrypted_string ...
public int ExportInfoID { get { return Convert.ToInt32(hfID.Value); } set { try { hfID.Value = value.ToString(); } catch(Exception) { hfID.Value="-1"; } } }
if ((ERROR_01 == numError) || (ERROR_07 == numError) || (ERROR_0A == numError) || (ERROR_10 == numError) || (ERROR_15 == numError) || (ERROR_16 == numError) || (ERROR_20 == numError)) { fire_special_event(); }
Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: XmlException Exception message: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into...
Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: XmlException Exception message: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into...
string html = new Func<string>(() => { string webpage; try { using(WebClient downloader = new WebClient()) { webpage = downloader.DownloadString(url); } } catch(WebException) { Console.WriteLine("Download failed."); } return webpage; })();
>>> import jinja2 >>> print jinja2.Environment().compile('{% for row in data %}{{ row.name | upper }}{% endfor %}', raw=True) from __future__ import division from jinja2.runtime import LoopContext, Context, TemplateReference, Macro, Markup, TemplateRuntimeError, missing, concat, escape, markup_join, unicode_join name ...
public void ProcessRequest(HttpContext context) { string report = null; int managerId = -1; int planId = -1; GetParametersFromSession(context.Session, out report, out managerId, out planId); if (report == null || managerId == -1 || planId == -1) { return; } CultureInfo currentCu...
# wrong way: if os.path.exists(directory_to_remove): # race condition is here. os.path.rmdir(directory_to_remove) # right way: try: os.path.rmdir(directory_to_remove) except OSError: # directory didn't exist, good. pass
# wrong way: if os.path.exists(directory_to_remove): # race condition is here. os.path.rmdir(directory_to_remove) # right way: try: os.path.rmdir(directory_to_remove) except OSError: # directory didn't exist, good. pass
Public Function Ldap_Store_Manual_Registration(ByVal userName As String, ByVal firstMiddleName As String, ByVal lastName As String, ByVal password As String) Dim entry As DirectoryEntry = OpenLDAPconnection() 'OpenLDAPconnection() is DirectoryEntry(domainName, userId, password, AuthenticationTypes.SecureSocketsLay...
if (proposedFilename.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) != -1) { MessageBox.Show("The filename is invalid"); return; }
>>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int' >>> datetime.time(11, 34, 59) + datetime.timedelta(0, 3) TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta' >>> datetime.time(11, 34, 59) + datetime.time(0, 0, 3) TypeError: unsu...
>>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int' >>> datetime.time(11, 34, 59) + datetime.timedelta(0, 3) TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta' >>> datetime.time(11, 34, 59) + datetime.time(0, 0, 3) TypeError: unsu...
try{ db.UpdateAll(somevalue); } catch (Exception ex) { logger.Exception(ex, "UpdateAll method failed"); throw; } finally { db.Close(); }
try{ try { IDatabase db = DatabaseFactory.CreateDatabase(); db.UpdateAll(somevalue); } finally{ db.Close(); } } catch (DatabaseAlreadyClosedException dbClosedEx) { logger.Exception(dbClosedEx, "Database connection was closed already."); } catch (Exception ex) { logger.Exc...
try{ db.UpdateAll(somevalue); } catch (Exception ex) { logger.Exception(ex, "UpdateAll method failed"); throw; } finally { db.Close(); }
try{ try { IDatabase db = DatabaseFactory.CreateDatabase(); db.UpdateAll(somevalue); } finally{ db.Close(); } } catch (DatabaseAlreadyClosedException dbClosedEx) { logger.Exception(dbClosedEx, "Database connection was closed already."); } catch (Exception ex) { logger.Exc...
void doSth(Object foo) throws Exception{ Method m = foo.getClass().getMethod("foo", String.class); m.invoke(foo, "baz"); }
public static int compile(String javaFileName) { ByteArrayOutputStream os = new ByteArrayOutputStream(); PrintWriter w = new PrintWriter(os); int res = com.sun.tools.javac.Main.compile(new String[]{"-d", "./", javaFileName}, w); if (res != 0) throw new ExecutionException("Compilation failed!...
set errorformat=%*\\d>%f(%l)\ :\ %t%[A-z]%#\ %m set errorformat=\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m set errorformat=%f(%l,%c):\ error\ %n:\ %f
set errorformat=%*\\d>%f(%l)\ :\ %t%[A-z]%#\ %m set errorformat=\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m set errorformat=%f(%l,%c):\ error\ %n:\ %f
public static void ForEach<T>(this IEnumerable<T> col, Action<T> action) { if (action == null) { throw new ArgumentNullException("action"); } foreach (var item in col) { action(item); } }
file_interface = ('read', 'readline', 'seek') class InterfaceException(Exception): pass def implements_interface(obj, interface): d = dir(obj) for item in interface: if item not in d: raise InterfaceException("%s not implemented." % item) return True >>> import StringIO >>> s = StringIO.StringIO(...
jQuery.fn.ddnav = function() { this.wrap(""); this.each(function() { var sel = document.createElement('select'); jQuery(this).find("li.label, li a").each(function() { jQuery("<option>").val(this.href ? this.href : '').html(jQuery(this).html()).appe...
())) WARNING: LOOP: missing forms after DO: permitted by CLtL2, forbidden by ANSI CL. Real time: 0.969 sec. Run time: 0.969 sec. Space: 10409084 Bytes GC: 15, GC time: 0.172 sec. NIL [3]>
<?xml version="1.0"?> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
public class UnsafeUtil { public static Unsafe unsafe; private static long fieldOffset; private static UnsafeUtil instance = new UnsafeUtil(); private Object obj; static { try { Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); ...
[ERROR,9/19 15:31:08] java.net.BindException: Only one usage of each socket address (protocol/network address/port) is normally permitted [TRACE,9/19 15:31:08] java.net.BindException: Only one usage of each socket address (protocol/network address/port) is normally permitted [TRACE,9/19 15:31:08] at java.net.Pla...
# Python 2 syntax try: some_operation() except SomeError, e: if is_fatal(e): raise handle_nonfatal(e) # Python 3 syntax try: some_operation() except SomeError as e: if is_fatal(e): raise handle_nonfatal(e)
expat reports error code 5 description: Invalid document end line: 1 column: 1 byte index: 0 total bytes: 0 data beginning 0 before byte index:
expat reports error code 5 description: Invalid document end line: 1 column: 1 byte index: 0 total bytes: 0 data beginning 0 before byte index:
public static int ForEach<T>(this IEnumerable<T> list, Action<int, T> action) { if (action == null) throw new ArgumentNullException("action"); var index = 0; foreach (var elem in list) action(index++, elem); return index; }
using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential, Pack=1)] internal struct TokPriv1Luid { public int Count; public long Luid; public int Attr; } [DllImport("kernel32.dll", ExactSpelling=true) ] internal static extern IntPtr GetCurrentProcess(); [DllImport("advapi32.dll", ExactSpe...
/** * Return an int containing the wrapped line index at the given position * @param component JTextPane * @param int pos * @return int */ public int getLineNumber(JTextPane component, int pos) { int posLine; int y = 0; try { Rectangle caretCoords = component.modelToView(pos);...
/** * Returns the hash value of the given chars * * Uses the default hash algorithm described above * * @param in * the byte[] to hash * @return a byte[] of hashed values */ public static byte[] getHashedBytes(byte[] in) { MessageDigest msg; t...
def f(x): try: return { 'a': 1, 'b': 2, }[x] except KeyError: return 'default'
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll The thread 0x60c has exited with code 0 (0x0). The program '[3588] ALMSSecurityManager.vshost.exe: Managed' has exited with code -532459699 (0xe0434f4d).
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll The thread 0x60c has exited with code 0 (0x0). The program '[3588] ALMSSecurityManager.vshost.exe: Managed' has exited with code -532459699 (0xe0434f4d).
Message: Cannot register out parameter. Caused by: java.sql.SQLException: Cannot register out parameter. Class: SessionExpirationFilter
Message: Cannot register out parameter. Caused by: java.sql.SQLException: Cannot register out parameter. Class: SessionExpirationFilter
def defaultdict(default_factory, *args, **kw): class defaultdict(dict): def __missing__(self, key): if default_factory is None: raise KeyError(key) return self.setdefault(key, default_factory()) def __getitem__(self, key): ...
public class Customer : IDataErrorInfo { public string FirstName { get; set; } public string LastName { get; set; } public string Error { get { throw new NotImplementedException(); } } public string this[string columnName] { get ...
try { try { $issue = new DM_Issue($core->db->escape_string($_GET['issue'])); } catch(DM_Exception $e) { throw new Error_Page($tpl, ERR_NOT_FOUND, $e->getMessage()); } } catch(Error_Page $e) { die($e); }
<mx:ComboBox id="quicklinksMenu" change="quicklinkHandler(quicklinksMenu.selectedItem.data);" click="event.stopImmediatePropagation();" itemRenderer="renderers.QuickLinkItemRenderer" width="100%"/>
public PersonSumTag extends TagSupport { private List personList; public List getPersonList(){ return personList; } public void setPersonList(List personList){ this.personList = personList; } public int doStartTag() throws JspException { try { int sum = 0; for(Ite...
milen@dev:~$ psql Welcome to psql 8.2.7, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit milen=> create table EscapeTest (text varchar(50));...
public static void closeEverything(ResultSet rs, Statement stmt, Connection con) { if (rs != null) { try { rs.close(); } catch (SQLException e) { } } if (stmt != null) { try { stmt.close(); } catch (SQLException e) { } } ...
public static Boolean TryStrToGuid(String s, out Guid value) { try { value = new Guid(s); return true; } catch (FormatException) { value = Guid.Empty; return false; } }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] private class MEMORYSTATUSEX { public uint dwLength; public uint dwMemoryLoad; public ulong ullTotalPhys; public ulong ullAvailPhys; public ulong ullTotalPageFile; public ulong ullAvailPageFile; public ulong ullTotalVir...
unsigned int change_endian(unsigned int x) { unsigned char *ptr = (unsigned char *)&x; return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]; }
> ./a.out car[3]=-1869558540 a.out(4100) malloc: *** error for object 0x8fe01037: Non-aligned pointer being freed *** set a breakpoint in malloc_error_break to debug >
string connectionString = ConfigurationManager.AppSettings("ConnectionString") if (connectionString == null) { throw new MissingConfigSettingException("ConnectionString"); }
string connectionString = ConfigurationManager.AppSettings("ConnectionString") if (connectionString == null) { throw new MissingConfigSettingException("ConnectionString"); }
<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3" emptySessionPath="true" enableLookups="false" redirectPort="8443" maxThreads="320" connectionTimeout="45000" />
@columns = qw/Name Address Telephone/; if ($columns[$param]) { $query = "select * from contacts where $columns[$param] = ?"; } else { die "Invalid column!"; } run_sql($query, $search);
public WMPMediaRating() { var remote = new WMPRemote.RemotedWindowsMediaPlayer(); _WMP = remote.Player; _WMP.MediaChange += new _WMPOCXEvents_MediaChangeEventHandler(_WMP_MediaChange); }
import java.io.IOException; import de.schlichtherle.io.FileOutputStream; import de.schlichtherle.util.zip.ZipEntry; import de.schlichtherle.util.zip.ZipOutputStream; public class Main { public static void main(final String[] args) throws IOException { for (String encoding : new String[] { "IBM437", "UTF...
import java.io.IOException; import de.schlichtherle.io.FileOutputStream; import de.schlichtherle.util.zip.ZipEntry; import de.schlichtherle.util.zip.ZipOutputStream; public class Main { public static void main(final String[] args) throws IOException { for (String encoding : new String[] { "IBM437", "UTF...
function check_size($font_size, $font, $text, $width, $height) { if (!is_string($text)) { throw new Exception('Invalid type for $text'); } $box = imagettfbbox($font_size, 0, $font, $text); $box['width'] = abs($box[2] - $box[0]); if ($box[0] < -1) { $box...
>>> unicode(r) Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
>>> unicode(r, 'utf-8') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: coercing to Unicode: need string or buffer, ReturnsEncoded found
>>> unicode(r) Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)