on-internet

SVN Question regarding branching and third party vendor branching

We are developing an application which consists of: a source code base given to us by a partner infrequently. This is a somewhat working code, "final" version of something (and we get it in a zip file). They have their own release cycle and version tracking. on the code base above we make our changes. These can be either bugfixes or development of new features. Till now, we managed to create some code mayhem, as a result we would like to put all this in a SVN repository. I would like to ask you what you think is the best practice for this to happen with the less pain. The followings are our th

Join the discussion →

Open Source Alternatives to Reflector? [closed]

Just to ask if anyone knows of an open source alternative to RedGate's Reflector? I'm interested in checking out how a tool similar to Reflector actually works. Note, if you know of a free but not open source alternative to Reflector, you can answer the following related question: Something Better than .NET Reflector? Summary - Updated 11th May 2011 A quick round-up of the various open source projects and tools that have been suggested: Common Compiler Infrastructure (CCI) Mono Cecil ILSpy dnSpy (fork of ILSpy, project appears more active than original) Dotnet IL Editor (DILE) IL.View Monoflec

Join the discussion →

How different programming languages handle division by 0?

Perhaps this is the wrong sort of question to ask here but I am curious. I know that many languages will simply explode and fail when asked to divide by 0, but are there any programming languages that can intelligently handle this impossible sum - and if so, what do they do? Do they keep processing, treating 350/0 as 350, or stop execution, or what?

Join the discussion →

Command-line svn for Windows?

Is there a command-line based version of svn for Windows? Note that I've already tried installing TortoiseSVN, but I still does not have the svn executable available.

Join the discussion →

How to implement Friendly URL in Liferay portal

I have to simplify the URL. I am using liferay portal. URL at present look like this: http://10.11.201.144:8080/web/guest/marketing?p_p_id=EXT_6&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_EXT_6_pageName=aboutus I need to simplify it like: http://10.11.201.144:8080/web/guest/marketing/aboutus or some what easy. Life ray provides Friendly URL option i don't know how to use it.. Please help.

Join the discussion →

Is there any way to convert an integer (3 in decimal form) to its binary equivalent 11 in SQLite?

I am aware that there are functions in Oracle and MS SQL that can do so, so is there any function that does it or is there any way to convert it inside SQLite? My table structure; col1 int primary key col2 in not null <- I want to convert the value of this column into binary an perform a few comparisons for a set sequence of binary combinations The way I am currently employing is taking the data outside into a datatable in C# and converting it externally, but that's wrong apparently.

Join the discussion →

Using github to host public git repositories whilst ensuring that sensitive data files remain untracked

My app is hosted on Heroku and I have a public github repo too. My app has a config file containing my amazon S3 credentials. It's important to ensure that the file gets pushed to heroku but not github. So I was thinking that I could push my master branch to heroku and create a seperate github branch and ensure that it's .gitignore file references my s3.yml file. I could then just do "git push origin github:master" to push the github branch to github.com This works fine for the first commit. But then I switch to my master branch, write some awesome code and then push it all to heroku. I then s

Join the discussion →

Is there a significant overhead by using different versions of sha hashing (hashlib module)

The hashlib Python module provides the following hash algorithms constructors: md5(), sha1(), sha224(), sha256(), sha384(), and sha512(). Assuming I don't want to use md5, is there a big difference in using, say, sha1 instead of sha512? I want to use something like hashlib.shaXXX(hashString).hexdigest(), but as it's just for caching, I'm not sure I need the (eventual) extra overhead of 512... Does this overhead exist, and if so, how big is it?

Join the discussion →

Reusing socket descriptor on connection failure

In my client code, I am following these steps to connect to a socket: Creating a socket sockDesc = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) Connecting it (retry for 'x' time in case of failure) connect(sockDesc, (sockaddr *) &destAddr, sizeof(destAddr)) (After filling the destAddr fields) Using the socket for send()/recv() operation: send(sockDesc, buffer, bufferLen, 0) recv(sockDesc, buffer, bufferLen, 0) close() the socket descriptor and exit close(sockDesc) If during send()/recv() the connection breaks, I found that I could connect by returning to step 2. Is this solution okay? should I cl

Join the discussion →

Loading remote JavaScript file in a page

I've a simple page in which in the head I load several remote JavaScript files (I need them and can't have a local copy). The scripts I load are similar to these: <script type="text/javascript" src="http://mymachine/donald/script1.js"></script> <script type="text/javascript" src="http://mymachine/donald/script2.js"></script> In the first load of the page I got several error messages regarding objects that are related to these two scripts. So I think the page gets rendered BEFORE the scripts are downloaded and executed. If I try to reload the same page (with the cache loaded with the scripts) I

Join the discussion →

Sample code for POST + cookie?

I've been googling for some VB.Net code to authenticate to a web server with the POST method, receive a session ID in a cookie, and then send this cookie along with all GET queries... but all I found is half-working code or C# code, ie. difficult to use for a VB.Net newbie. Would someone have some code handy or some pointer that I could use to get started? Thank you.

Join the discussion →

How many bytes in a JavaScript string?

I have a javascript string which is about 500K when being sent from the server in UTF-8. How can I tell its size in JavaScript? I know that JavaScript uses UCS-2, so does that mean 2 bytes per character. However, does it depend on the JavaScript implementation? Or on the page encoding or maybe content-type?

Join the discussion →

Duplicate image detection algorithms

I am thinking about creating a database system for images where they are stored with compact signatures and then matched against a "query image" that could be a resized, cropped, brightened, rotated or a flipped version of the stored one. Note that I am not talking about image similarity algorithms, but rather strictly about duplicate detection. This would make things a lot simpler. The system wouldn't care if two images have an elephant on them, it would only be important to detect if the two images are in fact the same image. Histogram comparisons simply won't work for cropped query images.

Join the discussion →

Asp.net IIS6 - application pool recycle

I'm running an ASP.NET website on Windows 2003 IIS 6.0 Every 24-28 hours I'm getting the following error: When the error occurrs all users are disconnected from the website. Event Type: Warning Event Source: W3SVC Event Category: None Event ID: 1013 Date: 02/02/2010 Time: 19:29:38 User: N/A A process serving application pool 'DefaultAppPool' exceeded time limits during shut down. The process id was '1660'. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Any idea what does the error means? Is this related to application pool recycle? If so, is it

Join the discussion →

How to close current tab in a browser window?

I want to create a link on a webpage that would close the currently active tab in a browser without closing other tabs in the browser. When the user clicks the close link, an alert message should appear asking the user to confirm with two buttons, "YES" and "NO". If the user clicks "YES", close that page and If "NO", do nothing. How can it be done? Any suggestions?

Join the discussion →

Why is bool 8 bits long in C++?

In C++, why is the bool type 8 bits long (on my system)? Only one bit is enough to hold the Boolean value. I used to believe it was for performance reasons, but then on a 32 bits or 64 bits machine, where registers are 32 or 64 bits wide, what's the performance advantage? Or is it just one of these 'historical' reasons?

Join the discussion →

record output sound in python

i want to programatically record sound coming out of my laptop in python. i found PyAudio and came up with the following program that accomplishes the task: import pyaudio, wave, sys chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = sys.argv[1] p = pyaudio.PyAudio() channel_map = (0, 1) stream_info = pyaudio.PaMacCoreStreamInfo( flags = pyaudio.PaMacCoreStreamInfo.paMacCorePlayNice, channel_map = channel_map) stream = p.open(format = FORMAT, rate = RATE, input = True, input_host_api_specific_stream_info = stream_info, channels = CHANNELS)

Join the discussion →

Why do stacks typically grow downwards?

I know that in the architectures I'm personally familiar with (x86, 6502, etc), the stack typically grows downwards (i.e. every item pushed onto the stack results in a decremented SP, not an incremented one). I'm wondering about the historical rationale for this. I know that in a unified address space, it's convenient to start the stack on the opposite end of the data segment (say) so there's only a problem if the two sides collide in the middle. But why does the stack traditionally get the top part? Especially given how this is the opposite of the "conceptual" model? (And note that in the 650

Join the discussion →

How to generate random strings in Python?

How do you create a random string in Python? I need it to be number then character, repeating until the iteration is done. This is what I created: def random_id(length): number = '0123456789' alpha = 'abcdefghijklmnopqrstuvwxyz' id = '' for i in range(0,length,2): id += random.choice(number) id += random.choice(alpha) return id

Join the discussion →

How can I change a specific RGB color into a specific CMYK color in a PDF file?

If I have a PDF file with objects (text, line-art) in a specific RGB color, and I want to convert those objects to have a specific CMYK color, what libraries are available that will let me do that? Note that I don't need the ability to "map" from arbitrary RGB values to a "suitable" CMYK value - those values are pre-determined. .NET/C# preferred, but I'd consider pretty much anything. Obviously I'd prefer free/open libraries to paid ones, but depending on the licensing model I would consider paid ones too.

Join the discussion →

accepting HTTPS connections with self-signed certificates

I'm trying to make HTTPS connections, using HttpClient lib, but the problem is that, since the certificate isn't signed by a recognized Certificate Authority (CA) like Verisign,GlobalSIgn, etc., listed on the set of Android Trusted Certificates, I keep getting javax.net.ssl.SSLException: Not trusted server certificate. I've seen solutions where you simply accept all certificates, but what if I want to ask the user? I want to get a dialog similar to that of the browser, letting the user decide to continue or not. Preferably I'd like to use the same certificatestore as the browser. Any ideas?

Join the discussion →

How to escape quotes in a string literal inside an event handler attribute?

I'm outputting values from a database (it isn't really open to public entry, but it is open to entry by a user at the company -- meaning, I'm not worried about XSS). I'm trying to output a tag like this: <a href="" onclick="DoEdit('DESCRIPTION');">Click Me</a> DESCRIPTION is actually a value from the database that is something like this: Prelim Assess "Mini" Report I've tried replacing " with \", but no matter what I try, Firefox keeps chopping off my JavaScript call after the space after the word Assess, and it is causing all sorts of issues. I must be missing the obvious answer, but for the

Join the discussion →

What does dimensionality reduction mean?

What does dimensionality reduction mean exactly? I searched for its meaning, I just found that it means the transformation of raw data into a more useful form. So what is the benefit of having data in useful form, I mean how can I use it in a practical life (application)?

Join the discussion →

facebook app getting redirected out canvas view

i am using iframe to render my app from my server. the problem is once i click on a link in my app, i am being redirected to my server. i mean, i remain in tha canvas page for a second, then suddenly instead of viewing it in an iframe on the facebook website, i am redirected the app URL on my server. I am using PHP and MySQL. why is this happening. the firebug info: this is the POST info that firebug is giving. due to the above problem it is also not POSTing to the DB. <html> <body> <script type="text/javascript"> top.location.href = "http://www.facebook.com/login.php?v=1.0&api_key="xxxxx"&nex

Join the discussion →
Older stories