on-internet

How do I encode a complete http url string correctly?

I get a url string from a user and would like to transform it to a legal http url: http://one.two/three?four five should turn into http://one.two/three?four%20five However, URLEncoder does not help, as it encodes the entire string (including the legal ://). Help?

Join the discussion →

If the RAM contents are unpredictable at power-on, how can BIOS start executing from memory address 0xFFFF0?

When a pc first boots up, it starts executing at physical address 0xffff0. This address contains a jmp instruction to the BIOS. Now for my question, I always assume the physical addresses are mapped to RAM. If RAM initially contains garbage values, what exactly puts the jmp instruction in 0xffff0? Is the jmp instruction always the same or is it different for different BIOS's? Does 0xffff0 map from RAM to BIOS then (meaning it's "hard mapped")?

Join the discussion →

What's the point of cache coherency?

On CPUs like x86, which provide cache coherency, how is this useful from a practical perspective? I understand that the idea is to make memory updates done on one core immediately visible on all other cores. This is a useful property. However, one can't rely too heavily on it if not writing in assembly language, because the compiler can store variable assignments in registers and never write them to memory. This means that one must still take explicit steps to make sure that stuff done in other threads is visible in the current thread. Therefore, from a practical perspective, what has cache co

Join the discussion →

jQuery: Difference between position() and offset()

What is the difference between position() and offset()? I tried to do the following in a click event: console.info($(this).position(), $(this).offset()); And they seem to return exactly the same... (The clicked element is within a table cell in a table)

Join the discussion →

Meaning of ffmpeg output (tbc, tbn, tbr) [closed]

I am using ffmpeg to tell me video info. Specifically: ffmpeg -i video.ext I get the output: Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 704x576 [PAR 12:11 DAR 4:3], 9578 kb/s, 25 tbr, 90k tbn, 50 tbc Does anyone know what tbr, tbn and tbc are exactly? I have seen speculation on the net but nothing definitive?

Join the discussion →

How to get selected row of detail grid in Master-Detail GridView?

I'm having a problem on getting the selected rows values of a detail grid. I have master-detail grid in a popup control and it works fine. I also enabled the enable selection to have checkboxes but when i try to run GetSelectedFieldValues on ClientSideEvents of a button it always returns "0". What do i do wrong, i couldn't find it? Here is the detail grid: AutoGenerateColumns="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" OnBeforePerformDataSelect="gv_ParameterTempD_BeforePerformDataSelect" ClientInstanceName="gvC_ParameterTempD"> <dxwgv:GridViewCommandColumn ShowSele

Join the discussion →

How to change the default schemalocation in wsdl file of WCf Service?

Following is the wsdl file of my service: <wsdl:types> <xsd:schema targetNamespace="http://tempuri.org/Imports"> <xsd:import schemaLocation="http://localhost:3789/VideoUpload.svc?xsd=xsd0" namespace="http://tempuri.org/" /> <xsd:import schemaLocation="http://localhost:3789/VideoUpload.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> <xsd:import schemaLocation="http://localhost:3789/VideoUpload.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/UploadVideoProtocol" /> </xsd:schema> </wsdl:types> ----- <wsdl:definitions> <wsdl:service name="VideoUplo

Join the discussion →

Robocopy file transfer backup using SQL server

I have a job running robocopy to copy files from the SQL server to a backup drive. The job runs a CmdExec type job to call a batch file that runs robocopy. My issue is that although the files copy over fine, the error reports do not get registered. I tested this by changing the source file to a bogus drive. It still reports job success. I have narrowed it down to run only robocopy. When the job runs the batch file, the job reports success. The job still reports success even if I only type robocopy in the batch file and nothing else. Here is the code I am running to try out the error handling:

Join the discussion →

Getting changes from another branch

I have a project which uses git and I'd like to start a new branch to add a major new feature. Under the main branch, I'll continue to add bug fixes and minor features. At regular intervals I'd like to pull the changes from the main branch into my "major new feature" branch. What's the best way to do this? Eventually, I'll merge the "major new feature" branch into the main branch.

Join the discussion →

Alternate names for a surrogate key/sequence number/ID column

I have a legacy table that has as a part of its natural key a column named <table_name>_IDENTIFIER and it seems like it would be confusing to create a surrogate key named <table_name>_ID or ID so I'm leaning towards naming it SURROGATE_KEY. All my other tables use the <table_name>_ID syntax. Any better suggestions?

Join the discussion →

Quoting long strings without newlines in Python

I am trying to write a long string in Python that gets displayed as the help item of an OptParser option. In my source code .py file, I'd like to place newlines so that my code doesn't spend new lines. However, I don't want those newlines to affect how that string is displayed when the code is run. For example, I want to write: parser.add_option("--my-option", dest="my_option", nargs=2, default=None, help='''Here is a long description of my option. It does many things but I want the shell to decide how to display this explanation. However, I want newlines in this string.''') the above way of d

Join the discussion →

What is the difference between the .*? and .* regular expressions?

I'm trying to split up a string into two parts using a regular expression. The string is formatted as follows: text to extract<number> I've been using (.*?)< and <(.*?)> which work fine, but after reading into regular expressions a little, I've just started to wonder why I need the ? in the expressions. I've only done it like that after finding them through this site. What is the difference?

Join the discussion →

Why does javascript's "in" operator return true when testing if 0 exists in an array that doesn't contain 0?

Why does the "in" operator in Javascript return true when testing if "0" exists in array, even when the array doesn't appear to contain "0"? For example, this returns true, and makes sense: var x = [1,2]; 1 in x; // true This returns false, and makes sense: var x = [1,2]; 3 in x; // false However this returns true, and I don't understand why: var x = [1,2]; 0 in x;

Join the discussion →

JQuery JQGrid local data loading issue

I've got a problem with the following code <script type="text/javascript"> var mydata = [ {id:"1",name:"foo"},{id:"2",name:"bar"} ]; jQuery(document).ready(function() { jQuery("#lgrid").jqGrid({ data: mydata, datatype: "local", height: 150, width:600, rowNum: 10, rowList: [10,20,30], colNames:['id','name'], colModel:[ {name:'id',index:'id', width:60, sorttype:"int"}, {name:'name',index:'name', width:60}], pager: "#pgrid", viewrecords: true, caption: "Contacts" }); }); </script> And In the body .... <table id="lgrid"></table> <div id="pgrid"></div> With this code, I never display the data into

Join the discussion →

how to make a file download then user open index.html?

What I need is when user open, foe example, www.mydomain.com/install , he would be offered to download a file. I made an index file in that folder with <META HTTP-EQUIV="Refresh" CONTENT="0;URL=myfile.sis"> but on some devices instead of downloading, it would attempt to open and display the file in that strange hex(?) format. any idea... thanks! P.S. <?php header("Location: skyeye.sis"); exit; ?> does the same.

Join the discussion →

Is there a tool to auto-format R code for me?

Is there any tool (editor, script, whatever...) available that can automatically reformat R code? It does not need to be customizable but it must be able to recognize statements separated by either semicolons or newlines since this code has both. If it can put all statements on a separate line, consistently indent code blocks and consistently place braces I will be very happy.

Join the discussion →

SFTP transfer file and move file to folder

This is my first post so please excuse my ignorance. I am using a vbscript to zip all .csv type files in a particular folder. After some google searches, I have found a workable vbscript to do this and have enabled a scheduled task to automate this. What I need to do next is to transfer the zip file via sftp and then "move" that zip file into another folder. I believe the former can be achieved using pscp.exe via command line but can someone show me how to do the latter? Basically the zipping will be done twice a day and so it will have a timestamp similar to yyyymmdd0900.zip (for 9am schedule

Join the discussion →

Android VideoView resume and seekTo

I am playing a Video using a VideoView in my app. On the click of a button, it records the current position of the video, and the app opens up the browser with some url. On pressing the back button, the app comes back to video app and resumes the video from where it left off. I looked at the Android Activity lifecycle and saw that onStart() method gets called once the video activity comes to the foreground. So I am creating my layout in onStart() and playing the video by seeking to the current position. My problem is that when the video resumes, it buffers from the start and then seeks to. Sin

Join the discussion →

Way to Remove Invite Limit on FBML Multi-Friend Selector

I tried to look through various resources before posting here, but was having a surprisingly difficult time finding an answer to my question. Sorry in advance if I overlooked it. I'm currently trying to add the FBML Multi-Friend Selector to my Facebook page. It has a limit on the number of friends you can invite at a time ("Add up to 20 of your friends by clicking on their pictures below"). From what I've looked through it sounds like 20 is the max number of friends a user can invite, but then looking at Mint's page, they have a 22 max invite (http://www.facebook.com/mint?ref=ts) I thought it

Join the discussion →

How to number the ls output in unix?

I am trying to write a file with format - "id file_absolute_path" which basically lists down all the files recursively in a folder and give an identifier to each file listed like 1,2,3,4. I can get the absolute path of the files recursively using the following command: ls -d -1 $PWD/**/*/* However, I am unable to give an identifier from the output of the ls command. I am sure this can be done using awk, but can't seem to solve it.

Join the discussion →

Generate an LTPA token?

We have a need to integrate a server with our WebSphere environment that does not support LTPA. I found Working with Lightweight Third Party Authentication (LTPA) by Cosmin Stejerean and corresponding code to decode the information in an LTPA token. However, there's no code explaining the digital signature and how that's generated/validated. Does anyone have any information on how to generate an LTPA token in custom code?

Join the discussion →

Use OpenBSD's malloc, realloc and free in my program

I would like to use OpenBSD's implementation of malloc, realloc and free on my Debian lenny desktop rather than glibc's. Are they simply drop in replacements: will they work on my Linux desktop ? Which are the file(s) that I need and which OpenBSD package contains them ?

Join the discussion →

BindingResult.rejectValue does not find value from ValidationMessages.properties

We're using spring with annotations, and our annotated fields get validated fine and error messages get displayed from ValidationMessages.properties, but for custom validation message from ValidationMessages.properties does not seem to be used. Here's the example: Validatior (also the form): public void validateSpecial(BindingResult result) { if(password != null && !password.equals(passwordConfirm)){ result.rejectValue("passwordConfirm", "emailform.passwordConfirm.passwordsDontMatch", new Object[]{}, "This message is in the code."); ... } ValidationMessages.properties: ... emailform.passwordCo

Join the discussion →
Older stories