Search code

126041 results
1

votes
3

answer

Colorize code inside <code></code> [closed]

I'm looking for a open source PHP script to colorize the code inside or [code][/code] tags. Thanks
horgen
19

votes
2

answer

Code Contracts + Code Analysis

I think about starting to use Code Contracts in my code base. I already use Code Analysis with all rules enabled and a goal of zero warnings. However, when using Contract.Requires(parameter != null) I get a warning from Code Analysis, namely CA1062: CA1062 : Microsoft.Design : In externally visible...
Daniel Hilgarth
2

votes
2

answer

Is System.Data.SqlClient code managed code?

Are the queries executed in a C# progamm using System.Data.SqlClient namespace cosnidered managed or umanaged code? Every time the connection is closed , (conn.Close() method is used) does the resource consider released or we have to dispose it in order to get released?
apomene
4

votes
9

answer

Code Generator vs Code Refactoring

How do you like your CRUD programs. Code-generated, framework-driven, or manually written?
Michael Buen
1

votes
2

answer

Jquery Code to validate code

Please i need this code to check if the access key is correct or not and when the person put wrong key more than 3 times it will show expired or take to another page. I don't know what am doing wrong since i can't code the error attempt but still without that is not working can someone help me? $(do...
Micheal
1

votes
2

answer

Code Contracts vs Code Analyzers

I'm about to embark on a new C# project. I was wondering what the difference is between using Code Contracts or Code Analyzers (in Roslyn). Am I misunderstanding the usage of each? Being a new project, I would like to maintain the integrity of the code. So I want other developers to adhere to specif...
Jon Meyers
1

votes
2

answer

Mock code reducing code coverage

I am working with Golang and using mockhiato to generate mocks for all interfaces. This tool generates mocked implementation in mocks.go file within the same package. I can't rename mocks.go to mocks_test.go as this mock file is consumed by other packages. The problem is that these mocks files are c...
Rahul Garg
2

votes
1

answer

Formatting code in code blocks

I have recently gone from java(in eclipse) to C++ in code blocks, and I was wondering if there was a way to format code in code blocks like there is in eclipse (ctrl+shift+F), if not could someone point me towards a plugin or something of the like?
2

votes
1

answer

Code documentation outside code file

For some reasons, i want to document an API but I don't want to write the documentation directly inside the source code as it is now widely done. I'm looking for a documentation generator tool which could take as input a documentation file and be able do fetch function prototype from source code and...
Valentin Perrelle
4

votes
2

answer

Cython code inside Python code

There are several ways of using Cython with Python. First version (standard): you write your Cython code mylib.pyx, then you run this setup.py: from distutils.core import setup from Cython.Build import cythonize setup(ext_modules = cythonize('mylib.pyx')) that compiles it into a .pyd file, and then,...
Basj
1

votes
2

answer

Assembly Code to C code

I'm trying to translate this assembly code to C and I need help. It has something to do with a while loop but i don't know what happens in the while loop. I've looked at it for a while and i'm sure it contains 'while(something =! null)' then do something but I don't know what happens when the code d...
Jonah Ruffer
1

votes
2

answer

mmi code error code android

If I type a character like ',' and press on the call button , I get the error dialog 'Connection problem or invalid mmi code'. Can someone tell me from where this dialog pop up comes in Android.
Mayur Pandey
1

votes
1

answer

Random code affects unrelated code

I'm making an iPhone game in objective c with cocos2d and box2d, paddles, balls, bricks nothing too fancy, the paddle handling code worked perfectly for both x and y movement. I made an addition of radial gravity code in another function but here's where it gets weird. The code isn't called, just si...
Michael
2

votes
7

answer

“Code covered” vs. “Code tested”?

Converting my current code project to TDD, I've noticed something. class Foo { public event EventHandler Test; public void SomeFunction() { //snip... Test(this, new EventArgs()); } } There are two dangers I can see when testing this code and relying on a code coverage tool to determine if you have e...
Matthew Scharley
1

votes
3

answer

VB code to C# code

I have this VB code that I am converting for someone, but he didn't comment it, so what does it mean Dim Arguments As String = path & '\' & fs & '.freeze' & ' ls'
Cole Johnson
3

votes
3

answer

Code razor within Javascript code

The code below does not work. I've tried all forms @: @() @{} The apparent problem is the { and } at the beginning and end. (Required, as are parameters) function initializeFileUploader() { SetUploader('/Projects/ImageUpload', 'Images', true, ['jpg', 'jpeg', 'png', 'gif', 'zip'], { ProjectID: @Model...
ridermansb
4

votes
1

answer

Kernel Code vs User Code

Here's a passage from the book When executing kernel code, the system is in kernel-space execut- ing in kernel mode.When running a regular process, the system is in user-space executing in user mode. Now what really is a kernel code and user code. Can someone explain with example? Say i have an appl...
Kraken
3

votes
5

answer

Assembler code in C++ code

How can I put Intel asm code into my c++ application? I'm using Dev-C++. I want to do sth like that: int temp = 0; int usernb = 3; pusha mov eax, temp inc eax xor usernb, usernb mov eax, usernb popa This is only example. How can I do sth like that? UPDATE: How does it look in Visual Studio ?
Hooch
2

votes
5

answer

Code OnTime ASP.Net code generator

Does somebody tested Code OnTime on a real world project (codeontime.com)? Technology looks promising, but their free version restrictions are too restrictive. I managed to put only few tables in a model, real DB has 20+tables. Also it is not clear how generated site works where DB contains lot of r...
Alsin
2

votes
1

answer

Object Code vs. Machine Code

Machine code is the Processor Specific Binary Representation of the Instructions that a program is translated into; lowest level instructions from the processor architecture's instruction set. The operating system is the agent responsible for passing the (((Binary))) instructions to the processor th...
6

votes
1

answer

managed code vs unmanaged code

I'm trying to get my mind wrapped around the concept of managed vs unmanaged code. Correct me if I'm wrong but managed code is anything that gets compiled down to bytecode while unmanaged code gets compiled down to machine code. Is this correct?
conterio
3

votes
0

answer

Powershell Code to C# Code

is possible to convert PowerShell code .PS1 to C# code? I'v been looking to it on google but I always find the contrary. So, I think it's possible PS1 to C# too. Reflector has only the AddIn to convert DLL t oPS Code
hello B
6

votes
3

answer

Javascript key code =/= char code

I'm binding on the keydown event with jQuery to allow some specific characters in a textbox. I'm trying to make my code cross browser and platform compliant. My main issue is that I can't find a way to map the received key code to a valid char code, especially for key code coming from the numeric pa...
Fabian Vilers
4

votes
2

answer

Displaying code using code highlighter

I want to insert some programming code along with the descriptions like a tutorial site. This is the sample code for HTML code: $code = ' This is introduction to HTML [code] This is sample descriptions [/code] This is sample for PHP [code]
Code
1

votes
1

answer

mysql code vs mysqli code

I have tried converting a piece of code from mysql to mysqli, the code below is the mysql code, this works fine and lets a user login correctly.
user2320010
1

votes
1

answer

Static code analysis / Code annotations

I am writing code which is working like a state machine. So: some functions are setting a specific state others are allowed to be executed in a specific state. (In reality it is a little more complex, but these are the basics, to keep it simple.) Currently I use runtime assertions to check if a...
ConfusedSushi
1

votes
1

answer

Using Code Project (CPOL) licenced code on Google Code [closed]

I have a piece of software that I would like to open source via Google Code Project Hosting. The problem is that I have used some code from Code Project which is licenced with the Code Project Open Licence (CPOL). Are any of the available licences I can choose from Google Code compatible with CPOL?...
jupiter1980
191

votes
8

answer

Assembly code vs Machine code vs Object code?

What is the difference between object code, machine code and assembly code? Can you give a visual example of their difference?
mmcdole
1

votes
1

answer

TinyMCE code highlighter select code to apply code highlight

I am looking for a tinymce code highlighting plugin that is easy for users to use.I want the users to highlight the code to code highlight and with a click of a button,the code is highlighted,like how stackoverflow does it,without resulting to
Gandalf
21

votes
3

answer

Is it normal that YARD doesn't replace `code` with <code>code</code>?

I'm just starting to use YARD for documenting my Rails app. I didn't specify any specific Markup handler, but I would have expected that `code` would be converted to code, which doesn't seem to happen. Is this normal behavior? Do I have to add some additional option to make this work? Thank you.
Joshua Muheim
2

votes
4

answer

How can I escape all code within <code></code> tags to allow people to post code?

What I want to do is to allow users to post code if they need to, so it is viewable and it doesn't render. For example: Hello Should be turned into: <span> <div id='hkhsdfhu'></div> </span> <h1>Hello</h1> Only if it is wrapped in tags. Right now I am using the following function to allow only certa...
Nathan
2

votes
3

answer

I have a confusion when differentiating between Source code, Object code, Assembly code, and Machine code

I read every where that we write source code (High level language), the compilers converts it into a machine code (Low level language). Then i read that there is an assembler, which converts assembly code into a machine code. Then When differentiating compiler and interpreter, i read that compiler f...
Zeeshan Jaan
6

votes
1

answer

Connection between requirements and code in code

I am looking for simple way to connect information about requirement/release and source code. The case is that developer should be able to find any artifacts created given release or CR in easy way. The idea I have is to introduce some new annotation to mark any new class ( I am not sure if it is go...
Marcin Sanecki
8

votes
1

answer

code analyzer specifically for gwt code?

I have been going through code analyzers like pmd, findbuigs. They cover many cases and seem to be great to use. But wanted to know if there is any code analyzer specifically for gwt code?
saurabh
3

votes
1

answer

Matching C++ code with C code

I'm trying to get a grasp on C code. Here I am trying to replicate this code in C with code in C++. Or more particularly, I am trying to convert this code from printf to cout using iostream and iomanip instead of printf and and cstdio. //C CODE #include #include using namespace std; int main()...
Mdjon26
11

votes
5

answer

Code Contract : ccrewrite exited with code -1?

I'm new to code contracts. I downloaded the latest build of code contract project (1.4.40314.1) and started to implement it in my project. When i enabled 'Runtume Checking' through Code Contracts Tab in VS2010, i got this Error Error 1 The command ''C:\Program Files (x86)\Microsoft\Contracts\Bin\cc...
Code0987
5

votes
4

answer

JavaScript Code Organization Suggestions/Code Review

I am working on a large site that has a lot of custom (page specific js). There is one main.js and page-specific.js files. Is there a better approach that can use the following pattern? How can I re-factor multiple methods that use ajax? I currently assign all onclick events inline such as onclick='...
Eeyore
2

votes
2

answer

Django/Python code: readable vs fast code

Lets say I want to get a record that match a value and I have 2 approaches to do it: First: try: obj = Model.objects.get(field = value) except pass Second: if Model.objects.filter(field = value).count() > 0: obj = Model.objects.filter(field_value)[0] Lets put the code comments aside,which way should...
James Lin
2

votes
4

answer

what is similar code for following code?

I am trying to understand the following code: this.area[y][x + i] = tmp != null ? String.valueOf(tmp.charAt(i)) : ' '; Is this similar by following code? if(tmp != null){ this.area[y][x + i] = String.valueOf(tmp.charAt(i)); } else { this.area[y][x + i] = ''; }
Hayk Harutyunyan
2

votes
1

answer

AS3 Code Structure - Using Base Code

I would like some advice on something. I have many games which all use the same base code, and they extend the base classes overriding anywhere they need their own custom functionality. This is fine, but it has reached a point where it has become unreasonable every time I make a change to the base c...
Heather Roberts