can you convert this perl code to python code :
$list = $ARGV[0];
open (PASSFILE, "$list") || die "[-] Can't open the List of password file !";
@strings = ;
close PASSFILE;
Thanks
I have turned on "Treat warnings as errors" for my VS project which mean that I get errors for missing documentation (nice reminder for this particular project).
However, part of the code is generated by a custom tool which does not insert xml documentation so I'm looking for away to ignore the missing xml documentation for the generated code only, not for the entire project. I have no influence on the actual file generated and cannot really insert anything in the file (as it is regenerated frequently by the tool) so I looking for something existing outside the generated file (the classes that are generated are partial, if that helps)
I have one problem.
I have one button and one textarea in a frame.I want to show the source code in that textarea when I click on button. show source code of URL that I want to show.
help pleas!
I want to display some dozens of highlighted snippets (of code) on a presentation, I though of pasting the relevant snippets in a editor, capturing the screen and cropping the image to the code.
Is there an easier way to do this? An editor? Maybe a Pastie-like website that can export direclty to PNG?
Thanks in advance!
Is there a way that a javascript function can read the javascript source code in an html page, so that the function can do some checking job on the javascript source code?
I recently started using SourceMonitor to review my (and others) code.
Though i understand other parameters judged by the tool, i don't know how does it calculates the complexity of the code. As in, what all parameters does it considers to read to a complexity number?
Any feedback/suggestion would be of help. Thanks.
What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying.
I'm interested in seeing the answers using any and all programming languages. Let's try to keep one answer per language, edit the previous to correct or simplify. If you can't edit, comment?
Hello,
I visited this site and i really liked the code colorer used by it (apart from that CSS3 article on speech bubbles).
I went through the source code of that page but could not find which syntax highlighter is being used there.
Does any one have an idea?
Hi, I have been creating a cross browser compatible ( = ie 6 + standards complaint browsers ) Online Instant Messenger
What I would like to know is what licensing would I need to protect my code? how would i go about getting a license and where from?
My code is in PHP, and jQuery.
Regards,
Phil
Hi all,
This is probably a really dumb question but i'll ask anyway.
I was wondering if there was any reason as to why a form wouldn't display its code when i click "view code" from the right click context menu in vb6?
It was working awhile ago so i'm kind of stumped.
Thanks
Hello,
I use code-generation for my data access layer and Doxygen for documentation. My problem is that I can't add Xml comments on the generated classes since they will be overwritten as soon as I re-generate the code. To be more precise I can add Xml comments to my custom methods (which are in a separate file as partial classes) but I can't do it on data properties.
Any suggestions?
I am trying to use Code Contract's Code Snippets but since I turned Resharper back on it doesn't recognize them. On the other hand, it is recognizing some snippets I've implemented myself in the past.
Any ideia of what might be the problem? I'm specifically trying to use cr and ce, which I think, don't collide with any other snippets (at least from what I see in the intellisense).
I'm using R# 5 with VS 2010
Thanks
I've looked at CodeLocker (poorly styled and relatively unflexible, but free) and Source Code Library (Overzone software - very nicely styled, looks flexible, but very expensive - $80).
Ideally, I'm looking for a relatively simple, inexpensive program (not an online website) that I can save text data (source code) with a title and keywords, maybe even a description. It would also have some type of search functionality.
Can I convert my VB code to C++? How can I do it?
This is my VB code:
Dim OpenFileDialog1 As New OpenFileDialog
With OpenFileDialog1
.CheckFileExists = True
.ShowReadOnly = False
.Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg"
.FilterIndex = 2
If .ShowDialog = DialogResult.OK Then
' Load the specified file into a PictureBox control.
PictureBox1.Image = Image.FromFile(.FileName)
End If
End With
I would like to change the formatting on my BASH prompt from this:
[email protected]:~/some/very/annoying/long/path$
to something like this:
[email protected]:~/some/very/annoying/long/path
$
The idea is that I would be able to type a reasonably long command on one line without it wrapping to the next line so quickly.
I have a server running an older version of Ubuntu and with /var stored on a separate partition on a separate hard drive. I am attempting to update Ubuntu to 10.04, but I still want to store /var on a separate partition and hard drive. However, I don't want to format the drive which currently contains /var, as it has important data.
Is there some way to have 10.04 set up the new /var on this separate drive at installation, without formatting the drive and losing the old /var?
I have a problem on conditional formatting with date and time.
I hava a cell A1 that has date and time and I want to conditionally format its adjecent cell if the value of cell A1 is greater than 3 days compared to today, then cell A2 should show as "Follow-up Required" and cell colour should turn red no. if cell value of A1 is less than 3 days compared to today, no action is required.
Please help.
Regards,
Kiran
i need functionality of this tool in Autohotkey keyboard shortcut. If i would select all code and press AHK key combination then code should be set like this tool does. single line/ multiline.
Need to AHK script for both multiline and single line
http://www.newmediacampaigns.com/files/posts/css-formatting/clean.php
while formatting and reinstalling windowsxp, normally when the drivers are being installed it restarts on its own, but this time instead of restart it shutdown. Can anyone please let me know what the actual problem is ???
I am using the AndroMDA plugin for maven to generate code from an uml diagram made in MagicDraw.
When the code is generated, AndroMDA desings the JPA annotation for the persitence layer. I think that at the compilation process AndroMDA uses Naming Strategies to determine the Table and Column names for the DataBase.
I want to determine how AndroMDA desings this JPA annotations, because I need to display this DataBase names based on the UML entity and atributtes names.
I was regarding if there is an API of AndroMDA that I could use to do this by giving it the uml diagram. Or at least, to know the Naming Strategies used by AndroMDA to achive that.
AndroMDA at the compilation process design the JPA annotations for the Entities, Attributes, etc that are written in my java classes under a series of rules that exist within the EJB3 cartridge of AndroMDA. (The further Database is created using those JPA annotations).
I want to create a program that returns me the same Table and Attributes names wrote on the JPA annotations, by giving it the .xml file of the uml diagram of a project.
I was hoping that I could take advantage of the EJB3 cartridge to generate those Tables and Attribute names with my program. One way could be using an API of AndroMDA that do this(if it exits), or at least, by implementing the same rules used by the EJB3 cartridge for that matter.
To be more illustrative, For example:
If in my uml model I have an Entity called “CompanyGroup”, AndroMDA would generate the following code for the class definition:
@javax.persistence.Entity
@javax.persistence.Table(name = "COMPANY_GR")
Public class CompanyGroup implements java.io.Serializable, Comparable< CompanyGroup
This is just an example (not a real case), but nevertheless, the way how AndroMDA do the translation from “CompanyGroup” to “COMPANY_GR” has to be specified somewhere.
Hope this explanation is useful enough.
Thanks.
What's more appropriate than a Spiral for Easter Code Golf sessions? Well, I guess almost anything.
The Challenge
The shortest code by character count to display a nice ASCII Spiral made of asterisks ('*').
Input is a single number, R, that will be the x-size of the Spiral. The other dimension (y) is always R-2. The program can assume R to be always odd and = 5.
Some examples:
Input
7
Output
*******
* *
* *** *
* * *
***** *
Input
9
Output
*********
* *
* ***** *
* * * *
* *** * *
* * *
******* *
Input
11
Output
***********
* *
* ******* *
* * * *
* * *** * *
* * * * *
* ***** * *
* * *
********* *
Code count includes input/output (i.e., full program).
Any language is permitted.
My easily beatable 303 chars long Python example:
import sys;
d=int(sys.argv[1]);
a=[d*[' '] for i in range(d-2)];
r=[0,-1,0,1];
x=d-1;y=x-2;z=0;pz=d-2;v=2;
while d>2:
while v>0:
while pz>0:
a[y][x]='*';
pz-=1;
if pz>0:
x+=r[z];
y+=r[(z+1)%4];
z=(z+1)%4; pz=d; v-=1;
v=2;d-=2;pz=d;
for w in a:
print ''.join(w);
Now, enter the Spiral...
Hi all,
I am changing minesweeper.exe in order to have an understanding of how code injection works. Simply, I want the minesweeper to show a message box before starting. So, I find a "cave" in the executable and then define the string to show in messagebox and call the messagebox. Additionally of course, I have to change the value at module entry point of the executable and first direct it to my additional code, then continue its own code.
So at the cave what I do;
"hello starbuck",0
push 0 //arg4 of MessageBoxW function
push the address of my string //arg3, must be title
push the address of my string //arg2, must be the message
push 0 //arg1
call MessageBoxW
...
Now since the memory addresses of codes in the executable change everytime it is loaded in the memory, for calling the MessageBoxW function, I give the offset of the address where MessageBoxW is defined in Import Address Table. For instance, if MessageBoxW is defined at address1 in the IAT and the instruction just after call MessageBoxW is at address2
instead of writing call MessageBoxW, I write call address2 - address1.
So my question is, how do I do it for pushing the string's address to the stack?
For example, if I do these changes via ollydbg, I give the immediate address of "hello starbuck" for pushing and it works. But after reloading the executable or starting it outside of ollydbg, it naturally fails, since the immediate addresses change.
Thanks in advance,
Yigit.
i'm trying typescript and I find it very useful.
I've a quite large project and i was considering rewriting it using typescript. The main problem here is the following:
file A.ts:
class A extends B {
// A stuff
}
file B.ts:
class B {
// B stuff
}
If I compile A.ts with this command:
tsc --out compiledA.js A.ts
I'll get error from the compiler cause he doesn't know how to threat the "B" after extends.
So, a "solution" would be including in A.ts (as first line of code):
/// <reference path="./B.ts" />
Compiling again A.ts with the same command
tsc --out compiledA.js A.ts
Will result in compiledA.js containing both B.ts and A.ts code. ( which could be very nice )
In my case, I only need to compile the A.ts code in the compiledA.js file and I don't want the B.ts stuff to be in there.
Indeed, what I want is:
tsc --out A.js A.ts = compile only the A.ts stuff
tsc --out B.js B.ts = compile only the B.ts stuff
I can do it by removing the "extends" keyword but doing that I'll loose most of the typescript goodness.
Can someone telll me if there's a way to do this ?