Search Results

Search found 167 results on 7 pages for 'igor zevaka'.

Page 4/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Extending Python’s int type to accept only values within a given range

    - by igor
    I would like to create a custom data type which basically behaves like an ordinary int, but with the value restricted to be within a given range. I guess I need some kind of factory function, but I cannot figure out how to do it. myType = MyCustomInt(minimum=7, maximum=49, default=10) i = myType(16) # OK i = myType(52) # raises ValueError i = myType() # i == 10 positiveInt = MyCustomInt(minimum=1) # no maximum restriction negativeInt = MyCustomInt(maximum=-1) # no minimum restriction nonsensicalInt = MyCustomInt() # well, the same as an ordinary int Any hint is appreciated. Thanks!

    Read the article

  • xp_smtp_sendmail blank space added to html randomly

    - by Igor Timofeyev
    I have a proc where I generate small html doc with a link and send it out via xp_smtp_sendmail proc. Link is generated based on query results and is long. This works in most cases. However, sometimes the link gets broken due to spaces being inserted into querystring variable names, i.e. &Na me=John. This might vary between email clients(same link works in Gmail, but might not work in comcast due to spaces. The space seems to be randomly inserted, so in each broken email link space might break other querystring variables. When I do PRINT from proc the link is clean, no spaces. Here's my sample of the mail proc being executed within main proc(that gets query results and generates html for @Message). The space seems to be inserted regardless of whether I encode the url or not. Thank you in advance for your help. I can send a cleaner version of the code if it's not displayed properly here. ....query results above SET @Message = NULL SET @Message = @Message + + '<br/>Dear ' + @FirstName + ' ' + @LastName + ',' + '<br/><br/>Recently you took "' + @Title + '". ' + 'In response to the question "What is it?" ' + 'you responded "' + @Response + '".' + '<br/><br/>Following up on previous mailing' + '<br/><br/>Please click on the link below' + '<br/><br/><a href="' + @Link + '">Please click here</a>' + '<br/><br/>plain text' + '<br/><br/>plain text,' + '<br/><br/>plain text<br/> plain text<br/> plain text<br/> plain text<br/> plain text<br/> plain text EXEC @rc = master.dbo.xp_smtp_sendmail @FROM = '[email protected]', @FROM_NAME = 'Any User', @TO = @Email, @priority = N'NORMAL', @subject = N'My email', @message = @Message, @messagefile = N'', @type = N'text/html', @attachment = N'', @attachments = N'', @codepage = 0, @server = 'smtp.server.any'

    Read the article

  • How to decipher this code?

    - by Igor
    $o="QAAAOzh3b3cnYGJzWG9iZmNidQAgLy48Jzg5Cg0KDQGjbmlka3IAAGNiJy9TQkpXS0ZTQldGU08ABScpJyAoYGZra2J1fikEACADXIQABPFhaGhzBPU="; eval(base64_decode("JGxsbD0wO2V2YWwoYmFzZTY0X2RlY29kZSgiSkd4c2JHeHNiR3hzYkd4c1BTZGlZWE5sTmpSZlpHVmpiMlJsSnpzPSIpKTskbGw9MDtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd3OUoyOXlaQ2M3IikpOyRsbGxsPTA7JGxsbGxsPTM7ZXZhbCgkbGxsbGxsbGxsbGwoIkpHdzlKR3hzYkd4c2JHeHNiR3hzS0NSdktUcz0iKSk7JGxsbGxsbGw9MDskbGxsbGxsPSgkbGxsbGxsbGxsbCgkbFsxXSk8PDgpKyRsbGxsbGxsbGxsKCRsWzJdKTtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd4c2JHdzlKM04wY214bGJpYzciKSk7JGxsbGxsbGxsbD0xNjskbGxsbGxsbGw9IiI7Zm9yKDskbGxsbGw8JGxsbGxsbGxsbGxsbGwoJGwpOyl7aWYoJGxsbGxsbGxsbD09MCl7JGxsbGxsbD0oJGxsbGxsbGxsbGwoJGxbJGxsbGxsKytdKTw8OCk7JGxsbGxsbCs9JGxsbGxsbGxsbGwoJGxbJGxsbGxsKytdKTskbGxsbGxsbGxsPTE2O31pZigkbGxsbGxsJjB4ODAwMCl7JGxsbD0oJGxsbGxsbGxsbGwoJGxbJGxsbGxsKytdKTw8NCk7JGxsbCs9KCRsbGxsbGxsbGxsKCRsWyRsbGxsbF0pPj40KTtpZigkbGxsKXskbGw9KCRsbGxsbGxsbGxsKCRsWyRsbGxsbCsrXSkmMHgwZikrMztmb3IoJGxsbGw9MDskbGxsbDwkbGw7JGxsbGwrKykkbGxsbGxsbGxbJGxsbGxsbGwrJGxsbGxdPSRsbGxsbGxsbFskbGxsbGxsbC0kbGxsKyRsbGxsXTskbGxsbGxsbCs9JGxsO31lbHNleyRsbD0oJGxsbGxsbGxsbGwoJGxbJGxsbGxsKytdKTw8OCk7JGxsKz0kbGxsbGxsbGxsbCgkbFskbGxsbGwrK10pKzE2O2ZvcigkbGxsbD0wOyRsbGxsPCRsbDskbGxsbGxsbGxbJGxsbGxsbGwrJGxsbGwrK109JGxsbGxsbGxsbGwoJGxbJGxsbGxsXSkpOyRsbGxsbCsrOyRsbGxsbGxsKz0kbGw7fX1lbHNlJGxsbGxsbGxsWyRsbGxsbGxsKytdPSRsbGxsbGxsbGxsKCRsWyRsbGxsbCsrXSk7JGxsbGxsbDw8PTE7JGxsbGxsbGxsbC0tO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd4c2JEMG5ZMmh5SnpzPSIpKTskbGxsbGw9MDtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkQwaVB5SXVKR3hzYkd4c2JHeHNiR3hzYkNnMk1pazciKSk7JGxsbGxsbGxsbGw9IiI7Zm9yKDskbGxsbGw8JGxsbGxsbGw7KXskbGxsbGxsbGxsbC49JGxsbGxsbGxsbGxsbCgkbGxsbGxsbGxbJGxsbGxsKytdXjB4MDcpO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkM0OUpHeHNiR3hzYkd4c2JHd3VKR3hzYkd4c2JHeHNiR3hzYkNnMk1Da3VJajhpT3c9PSIpKTtldmFsKCRsbGxsbGxsbGwpOw==")); return;?>

    Read the article

  • A good file path builder library for C#?

    - by Igor Brejc
    System.IO.Path in .NET is notoriously clumsy to work with. In my various projects I keep encountering the same usage scenarios which require repetitive, verbose and thus error-prone code snippets that use Path.Combine, Path.GetFileName, Path.GetDirectoryName, String.Format, etc. Scenarios like: changing the extension for a given file name changing the directory path for a given file name building a file path using string formatting (like "Package{0}.zip") building a path without resorting to using hard-coded directory delimiters like \ (since they don't work on Linux on Mono) etc etc Before starting to write my own PathBuilder class or something similar: is there a good (and proven) open-source implementation of such a thing in C#?

    Read the article

  • Episerver Scheduled Job fails (scheduler service)

    - by Igor
    Our scheduled jobs started failing since yesterday with the following error message: CustomUpdate.Execute - System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.Security.Roles.GetRolesForUser(String username) at EPiServer.Security.PrincipalInfo.CreatePrincipal(String username) The scheduled job uses anonymous execution and logs in programmatically using the following call: if (PrincipalInfo.CurrentPrincipal.Identity.Name == string.Empty) { PrincipalInfo.CurrentPrincipal = PrincipalInfo.CreatePrincipal(ApplicationSettings.ScheduledJobUsername); } I have put in some more logging around PrincipalInfo.CreatePrincipal call which is in Episerver.Security and noticed that PrincipalInfo.CreatePrincipal calls System.Web.Security.Roles.GetRolesForUser(username) and Roles.GetRolesForUser(username) returns an empty string array. There were no changes code wise or on the server (updates, etc). I checked that the user name used to run the task is in the database and has roles associated with it. I checked that applicationname is set up correctly and is associated with the user If i run the job manually using the same user it executes with no issues (i know there is a difference between running the job manually and using the scheduler) I also tried creating a new user, that didn’t work either. Has anyone come across the same or similar issue? Any thoughts how to resolve this issue?

    Read the article

  • structured vs. unstructured data in db

    - by Igor
    the question is one of design. i'm gathering a big chunk of performance data with lots of key-value pairs. pretty much everything in /proc/cpuinfo, /proc/meminfo/, /proc/loadavg, plus a bunch of other stuff, from several hundred hosts. right now, i just need to display the latest chunk of data in my UI. i will probably end up doing some analysis of the data gathered to figure out performance problems down the road, but this is a new application so i'm not sure what exactly i'm looking for performance-wise just yet. i could structure the data in the db -- have a column for each key i'm gathering. the table would end up being O(100) columns wide, it would be a pain to put into the db, i would have to add new columns if i start gathering a new stat. but it would be easy to sort/analyze the data just using SQL. or i could just dump my unstructured data blob into the table. maybe three columns -- host id, timestamp, and a serialized version of my array, probably using JSON in a TEXT field. which should I do? am i going to be sorry if i go with the unstructured approach? when doing analysis, should i just convert the fields i'm interested in and create a new, more structured table? what are the trade-offs i'm missing here?

    Read the article

  • MySQL unique clustered constraint not constraining as expected

    - by igor
    I'm creating a table with: CREATE TABLE movies ( id INT AUTO_INCREMENT PRIMARY KEY, name CHAR(255) NOT NULL, year INT NOT NULL, inyear CHAR(10), CONSTRAINT UNIQUE CLUSTERED (name, year, inyear) ); (this is jdbc SQL) Which creates a MySQL table with a clustered index, "index kind" is "unique", and spans the three clustered columns: full size However, once I dump my data (without exceptions thrown), I see that the uniqueness constraint has failed: SELECT * FROM movies WHERE name = 'Flawless' AND year = 2007 AND inyear IS NULL; gives: id, name, year, inyear 162169, 'Flawless', 2007, NULL 162170, 'Flawless', 2007, NULL Does anyone know what I'm doing wrong here?

    Read the article

  • POST data getting lost: Content Length = 0

    - by Igor K
    I've been trying to find a solution for ages with no success. On our app, customers submit a form and on the next page we process it. Sometimes though the data never arrives. This seems to happen for just a few of our customers. Seems to happen with IE7 and using a proxy. Here's some headers, note the HTTP_VIA: X-REWRITE-URL: /process.asp?r=699743 APPL_MD_PATH: /LM/W3SVC/31555/ROOT APPL_PHYSICAL_PATH: C:\inetpub\vhosts\mysite.com\httpdocs\ AUTH_PASSWORD: AUTH_TYPE: AUTH_USER: CERT_COOKIE: CERT_FLAGS: CERT_ISSUER: CERT_KEYSIZE: CERT_SECRETKEYSIZE: CERT_SERIALNUMBER: CERT_SERVER_ISSUER: CERT_SERVER_SUBJECT: CERT_SUBJECT: CONTENT_LENGTH: 0 CONTENT_TYPE: application/x-www-form-urlencoded GATEWAY_INTERFACE: CGI/1.1 HTTPS: off HTTPS_KEYSIZE: HTTPS_SECRETKEYSIZE: HTTPS_SERVER_ISSUER: HTTPS_SERVER_SUBJECT: INSTANCE_ID: 31555 INSTANCE_META_PATH: /LM/W3SVC/31555 LOCAL_ADDR: XXX.XXX.XXX.XXX LOGON_USER: PATH_INFO: /process.asp PATH_TRANSLATED: C:\inetpub\vhosts\mysite.com\httpdocs\process.asp QUERY_STRING: r=699743 REMOTE_ADDR: YYY.YYY.YYY.YYY REMOTE_HOST: YYY.YYY.YYY.YYY REMOTE_USER: REQUEST_METHOD: POST SCRIPT_NAME: /process.asp SERVER_NAME: www.mysite.com SERVER_PORT: 80 SERVER_PORT_SECURE: 0 SERVER_PROTOCOL: HTTP/1.1 SERVER_SOFTWARE: Microsoft-IIS/7.0 URL: /process.asp HTTP_CONNECTION: Keep-Alive HTTP_PRAGMA: no-cache HTTP_VIA: 1.1 WEBCACHE-2 HTTP_CONTENT_LENGTH: 0 HTTP_CONTENT_TYPE: application/x-www-form-urlencoded HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* HTTP_ACCEPT_LANGUAGE: en-gb HTTP_COOKIE: ASPSESSIONIDQCKSDCTS=FENMPCMDCHEOENGOJPGDGPLN; HTTP_HOST: www.mysite.com HTTP_REFERER: http://www.mysite.com/theform.asp HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022) HTTP_UA_CPU: x86 HTTP_X_REWRITE_URL: /process.asp?r=699743

    Read the article

  • Need to skip newline char (\n) from input file

    - by igor
    I am reading in a file into an array. It is reading each char, the problem arises in that it also reads a newline in the text file. This is a sudoku board, here is my code for reading in the char: bool loadBoard(Square board[BOARD_SIZE][BOARD_SIZE]) { ifstream ins; if(openFile(ins)){ char c; while(!ins.eof()){ for (int index1 = 0; index1 < BOARD_SIZE; index1++) for (int index2 = 0; index2 < BOARD_SIZE; index2++){ c=ins.get(); if(isdigit(c)){ board[index1][index2].number=(int)(c-'0'); board[index1][index2].permanent=true; } } } return true;} return false; } like i said, it reads the file, displays on screen, just not in correct order when it encounters the \n

    Read the article

  • how to atomically claim a row or resource using UPDATE in mysql

    - by Igor
    i have a table of resources (lets say cars) which i want to claim atomically. if there's a limit of one resource per one user, i can do the following trick: UPDATE cars SET user = 'bob' WHERE user IS NULL LIMIT 1 SELECT * FROM cars WHERE user IS bob that way, i claim the resource atomically and then i can see which row i just claimed. this doesn't work when 'bob' can claim multiple cars. i realize i can get a list of cars already claimed by bob, claim another one, and then SELECT again to see what's changed, but that feels hackish. What I'm wondering is, is there some way to see which rows i just updated with my last UPDATE? failing that, is there some other trick to atomically claiming a row? i really want to avoid using SERIALIZABLE isolation level. If I do something like this: 1 SELECT id FROM cars WHERE user IS NULL 2 <here, my PHP or whatever picks a car id> 3 UPDATE cars SET user = 'bob' WHERE id = <the one i picked> would REPEATABLE READ be sufficient here? in other words, could i be guaranteed that some other transactions won't claim the row my software has picked during step 2?

    Read the article

  • In Django how display all of the values aftere the for loop is finished instead of displaying them one by one

    - by Igor
    Hello, In my django project in the view I call the last 6 values in the column and send them to the template. I then would like to pass into google charts api those 6 values and have a graph. At the moment for some reason I get 6 different graphs. {% for foodbag in foodbags %} <img src="http://chart.apis.google.com/chart?chxl=0:|0|1|2|3|4|5|6&chxr=2,0,0&chxs=0,1,676767,10.5,1,l,676767|2,676767,5.5,0,l,676767&chxt=x,y&chs=300x170&cht=bvg&chco=76A4FB&chd=t:{{foodbag.12}},0&chma=0,5|5,5&chdlp=t&chtt=Food+Bags"/> {% endfor %} I'm not sure how to replace string chd=t:{{foodbag.12}}, with the 6 values I am trying to extract from foodbags. I would really appreciate the help. Thank you

    Read the article

  • Is there a solution that lets Node.js act as an HTTP reverse proxy?

    - by Igor Zinov'yev
    Our company has a project that right now uses nginx as a reverse proxy for serving static content and supporting comet connections. We use long polling connections to get rid of constant refresh requests and let users get updates immediately. Now, I know there is a lot of code already written for Node.js, but is there a solution that lets Node.js act as a reverse proxy for serving static content as nginx does? Or maybe there is a framework that allows to quickly develop such a layer using Node.js?

    Read the article

  • Embedded non-relational (nosql) data store

    - by Igor Brejc
    I'm thinking about using/implementing some kind of an embedded key-value (or document) store for my Windows desktop application. I want to be able to store various types of data (GPS tracks would be one example) and of course be able to query this data. The amount of data would be such that it couldn't all be loaded into memory at the same time. I'm thinking about using sqlite as a storage engine for a key-value store, something like y-serial, but written in .NET. I've also read about FriendFeed's usage of MySQL to store schema-less data, which is a good pointer on how to use RDBMS for non-relational data. sqlite seems to be a good option because of its simplicity, portability and library size. My question is whether there are any other options for an embedded non-relational store? It doesn't need to be distributable and it doesn't have to support transactions, but it does have to be accessible from .NET and it should have a small download size. UPDATE: I've found an article titled SQLite as a Key-Value Database which compares sqlite with Berkeley DB, which is an embedded key-value store library.

    Read the article

  • Need to make sure value is within 0-255

    - by igor
    This is probably really easy, but I'm lost on how to "make sure" it is in this range.. So basically we have class Color and many functions to implement from it. this function I need is: Effects: corrects a color value to be within 0-255 inclusive. If value is outside this range, adjusts to either 0 or 255, whichever is closer. This is what I have so far: static int correctValue(int value) { if(value<0) value=0; if(value>255) value=255; } Sorry for such a simple question ;/

    Read the article

  • Subdomain URL Rewriting and Web Apps

    - by Igor K
    So a lot of web apps have the customer choose their own subdomain, ie mycompany.webapp.com Presumably, every subdomain works off the same set of files and the unique subdomain is perhaps stored as a session object. So how does the URL rewriting work? If someone goes to mycompany.webapp.com, you have to rewrite their unique address to a dynamic page to set the session variable, ie webapp.com/mypage.php?cusomer=mycompany But then when you redirected, you'd be at webapp.com/theappdirectory/ and not mycompany.webapp.com/ So how do they do it?

    Read the article

  • ASP.NET MVC CookieTempDataProvider: any experience?

    - by Igor Brejc
    UPDATE: looks like I've misunderstood what TempData is for and what it isn't. It definitively shouldn't be used to "keep certain session-wide data" as I asked initially (see ASP.NET MVC TempData Is Really RedirectData why). I've modified the question accordingly. Has anyone used CookieTempDataProvider for TempData storage? Are there any caveats to watch out for (apart from keeping the session storage small)? Any issues with using it on Web farms?

    Read the article

  • `strip`ing the results of a split in python

    - by Igor
    i'm trying to do something pretty simple: line = "name : bob" k, v = line.lower().split(':') k = k.strip() v = v.strip() is there a way to combine this into one line somehow? i found myself writing this over and over again when making parsers, and sometimes this involves way more than just two variables. i know i can use regexp, but this is simple enough to not really have to require it...

    Read the article

  • Creating client-side dynamic dependent controls , interactive user interface

    - by igor
    Hello everyone! I am looking for client-side javascript plugin for jquery(prefered, or maybe other framework) or other javascript framework, that implements dynamic, interactive user interface (fig. 1) Requirements: 1) user interface shall be dynamic (client-side, javascript). 2) the displaying of the next control shall be dependent on input of previous control(s) 3) the dependency shall be implemented in declarative form (settings, mapping, xml...) 4) this scope of controls shall be supported: dropdown list - fixed list (static, list of items has fixed scope of items) edit input (loop-up) - dynamic list, dependent on user input dropdown list - fixed list (dynamic, list of items dependent on previous input) static structure controls to display dynamic data. 5) this scope of dependencies shall be implemented: one-way: one to one one-way: one to many 6) this scope of dependency actions shall be implemented: hide (remove) control show (add) control show disabled set default value 7) controls shall be filled in by using ajax requests to the server-side application (json, xml...) Any thoughts, references, I would appreciate any assistance. Fig. 1. Interactive user interface

    Read the article

  • How to check which files I fopen'ed on Windows?

    - by Igor Oks
    I received a "Too many open files" error when tried to do fopen (C++, Windows XP). Probably it happened because somewhere in my program I open files without closing them. Is there a way on Windows to see a list of all open file descriptors (or all files that my program fopened)?

    Read the article

  • Good articles to read on SSL and HTTPS?

    - by Igor Romanov
    I had a problem with accepting invalid SSL certificate in my iPhone program. That problem is solved now, however I came to understanding that I have very abstract idea on how exactly the whole thing is working: how web browser is verifying that received certificate is really for host it communicates to and not faked by same party in the middle? if browser talks to some 3rd party (CA?) to do certificate check? and many other questions... Would someone please recommend good source of information with in-depth enough description of how all parts click together?

    Read the article

  • How to do UDP without port forwarding

    - by igor
    Hi all, I am creating an application in C#, It should send data with UDP. Everything works fine until, I try to communicate with a PC that is on the internet behind a router. How do I fix this so that I can use UDP without port forwarding?

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >