on-internet

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 →

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 →

Why can't I pass a C-style multidimensional array to a function taking an array of int*?

#include<stdio.h> void print(int *arr[], int s1, int s2) { int i, j; for(i = 0; i<s1; i++) for(j = 0; j<s2; j++) printf("%d, ", *((arr+i)+j)); } int main() { int a[4][4] = {{0}}; print(a,4,4); } This works in C, but not in C++. error: cannot convert `int (*)[4]' to `int**' for argument `1' to `void print(int**, int, int)' Why does it not work in C++? What change is needed to be made?

Join the discussion →

How can I make a regular expression to be non-greedy?

I'm using jQuery. I have a string with a block of special characters (begin and end). I want get the text from that special characters block. I used a regular expression object for in-string finding. But how can I tell jQuery to find multiple results when have two special character or more? My HTML content: <div id="container"> <div id="textcontainer"> Cuộc chiến pháp lý giữa [|cơ thử|nghiệm|] thị trường [|test2|đây là test lần 2|] chứng khoán [|Mỹ|day la nuoc my|] và ngân hàng đầu tư quyền lực nhất Phố Wall mới chỉ bắt đầu. </div> </div> And my JavaScript code: $(document).ready(function() {

Join the discussion →

Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected'

We just upgraded our Visual Studio 2008 projects to Visual Studio 2010. All of our assemblies were strong signed using a Verisign code signing certificate. Since the upgrade we continuously get the following error: Cannot import the following key file: companyname.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_3E185446540E7F7A This happens on some developer machines and not others. Some methods used to fix this that worked some of the time

Join the discussion →

Reverse Engineer a .pyo python file

I have 2 .pyo python files that I can convert to .py source files, but they don't compile perfectly as hinted by decompyle's verify. Therefore looking at the source code, I can tell that config.pyo simply had variables in in an array: ADMIN_USERIDS = [116901, 141, 349244, 39, 1159488] I would like to take the original .pyo and disassembly or whatever I need to do inorder to change one of these IDs. Or.... in model.pyo the source indicates a if (productsDeveloperId != self.getUserId()): All I would want to do is hex edit the != to be a == .....Simple with a windows exe program but I can't find

Join the discussion →

Login failed for user 'DOMAIN\MACHINENAME$'

I know this is almost a duplicate of : The error "Login failed for user 'NT AUTHORITY\IUSR'" in ASP.NET and SQL Server 2008 and Login failed for user 'username' - System.Data.SqlClient.SqlException with LINQ in external project / class library but some things don't add up compared to other appliations on my server and I am not sure why. Boxes being used: Web Box SQL Box SQL Test Box My Application: I have an ASP.NET Web Application, which references a class library that uses LINQ-to-SQL. Connection string set up properly in the class library. As per Login failed for user 'username' - System.Da

Join the discussion →

Limiting the number of characters per line with CSS [duplicate]

I have a paragraph of text: <p>Lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum</p> How can I make sure that no more than 30 characters are shown on one line with CSS?

Join the discussion →

What are the elegant ways to do MixIns in Python?

I need to find an elegant way to do 2 kinds of MixIns. First: class A(object): def method1(self): do_something() Now, a MixInClass should make method1 do this: do_other() -> A.method1() -> do_smth_else() - i.e. basically "wrap" the older function. I'm pretty sure there must exist a good solution to this. Second: class B(object): def method1(self): do_something() do_more() In this case, I want MixInClass2 to be able to inject itself between do_something() and do_more(), i.e.: do_something() -> MixIn.method1 -> do_more(). I understand that probably this would require modifying class B - that's o

Join the discussion →

HTML Minification in C#

Tried searching around for a complete library for HTML Minification in C# but haven't been able to locate anything that is useful ? Does anyone here have such a library or know of one ?

Join the discussion →

How do I sign EXE files and DLL files with my code signing certificate?

I purchased a code signing certificate from Thawte and have been going out of my mind with frustration at the whole process. What I have from them are: .spc / .p7b file .pvk file (Note: I do not have a PFX file from them. God knows why, but I have been fighting with their technical support for a week) In any case, I find "help" links on their site and at Microsoft for signcode.exe, which is useless for me, because I can't find that EXE file on my machine. However, I do have signtool.exe. Unfortunately, i am mystified at the command line parameters listed on this Microsoft help site. Specifical

Join the discussion →

Rails - How can I detect if the content_for content was provided?

I want to detect if content was provided for content_for tag in my template, and if not fall back to default value: <title> <% if content_is_provided -%> <%= yield :title -%> <% else -%> 404 - Page Unknown <% end -%> </title> Any easy way to detect this? I tried <% if :title -%> but that didn't do much. thanks.

Join the discussion →

Fastest way to calculate an X-bit bitmask?

I have been trying to solve this problem for a while, but couldn't with just integer arithmetic and bitwise operators. However, I think its possible and it should be fairly easy. What am I missing? The problem: to get an integer value of arbitrary length (this is not relevant to the problem) with it's X least significant bits sets to 1 and the rest to 0. For example, given the number 31, I need to get an integer value which equals 0x7FFFFFFF (31 least significant bits are 1 and the rest zeros). Of course, using a loop OR-ing a shifted 1 to an integer X times will do the job. But that's not the

Join the discussion →

Sending email through proxy using gmail smtp

Trying to send some email in my C# app. I am behind a proxy - which is no doubt why the code isn't working. This is what I have so far: App.Config: <system.net> <defaultProxy enabled="false"> <proxy proxyaddress="xxx.xxx.xxx.xxx"/> </defaultProxy> <mailSettings> <smtp deliveryMethod="Network"> <network host="smtp.gmail.com" port="587"/> </smtp> </mailSettings> </system.net> Code: var username = "..."; var password = "..."; var fromEmail = "..."; var toEmail = "..."; var body = "Test email body"; var subject = "Test Subject Email"; var client = new SmtpClient("smtp.gmail.com", 587) { Credential

Join the discussion →

Connection Error:Oracle.DataAccess.Client.OracleException ORA-12170

This has taken many hours of mine. I have to get this .Net app to run on an XP system. Someone seems to have messed up some files so conn.Open() in the C# is causing this error: Connection Error:Oracle.DataAccess.Client.OracleException ORA-12170: TNS:Connect timeout occurred at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) at Oracle.DataAccess.Cl

Join the discussion →

What Are Collections Implemented As In VB6?

So a collection in VB6 keeps track of a key for each object, and you can look up the object by its key. Does that mean collections are implemented as some sort of hashtable under the hood? I realize you can have multiple items with the same key in a collection, hence the SOME SORT. Anybody know what type data structure a VB6 collection is supposed to represent?

Join the discussion →

WPF item container recycling

I want to implement a custom Canvas that recycles containers when used as an ItemsPanel. So I derived from VirtualizingPanel and override the ArrangeOverride and MeasureOverride. I am doing the generation in MeasureOverride like this: var children = base.InternalChildren; var itemsControl = ItemsControl.GetItemsOwner(this); var itemsCount = itemsControl.Items.Count; IItemContainerGenerator generator = itemsControl.ItemContainerGenerator; var startPos = generator.GeneratorPositionFromIndex(0); using (generator.StartAt(startPos, GeneratorDirection.Forward, true)) { for (int i = 0; i < itemsCount

Join the discussion →
Older stories