I want replace >>numbers to <a href=#numbers> >>numbers</a>
example:
input: hello >>1050 How are you?
output: hello <a href=#1050> >>1050 </a> How are you?
number can be 0-100000
Maybe some regular expresion?
Currently I am calling from my console application into a business layer and then that calls into a data access layer. The issue is that it doesn't seem to be gaining me anything when my DAL and BAL are doing the same responsibility. What can be done?
Console app
DataSet dataSet = XchgManager...
import java.util.Scanner;
public class Main {
public Scanner input;
public int num;
public int n;
public Main() {
input = new Scanner(System.in);
calculate();
}
public static void main(String[] args) {
Main main = new Main();
}
public vo...
Previously: Countable and uncountable sets in .NET (clean version).
Disclaimer: Please do not interpret my attempts to gain maximum from .NET as some kind of socially unacceptable behavior. You, probably, know someone who does it to his/her car. It is a very good way to learn and explore a hospi...
I currently have an app that uses Firebase for logging users in and I would like to know if I can make this code any better. I currently have 4 files:
auth/models/User.java
auth/BaseActivity.java
auth/CreateAccountActivity.java
auth/LoginActivity.java
User.java:
@IgnoreExtra...
In my company, I've inherited some Java library that I'm now writing tests to, refactoring and fixing Sonar issues.
One particular point that Sonar is complaining about is a big chaining of if/else if/else statements, that is used in a class responsible for parsing values that come from the DB t...
I'm looking for feedback on the following code which checks if a number is prime using Swift 2.
import UIKit
var number:Int = 1123
var isPrime:Bool = true
switch number {
case 1:
isPrime = false
case 2:
isPrime = true
case 3:
isPrime = true
default:
primeCheck:...
> The passwords in the breach were stored as SHA1 hashes without salt, the vast majority of which were quickly cracked in the days following the release of the data.
> A SQL Injection vulnerability in sonypictures.com lead to tens of thousands of accounts across multiple systems being exposed complete with plain text passwords.
That's pathetic, especially for a company like Sony
So i am having trouble generating enemies that come down from the top of the screen to the bottom. I am trying to make a shooting game, and the user can shoot the enemies to kill them. but i cant seem to get the enemies to appear. plz help
heres my code:
import pygame
import random
BLACK = (0,...
On Code Review we often encounter questions with the same kind of problem over and over again.
Some of us are using the auto comments script which allows you to maintain a list of comments to post.
What are some useful tin-can comments that can be good to have in your list of comments?
If you ...
OK got it to work, almost completely, maybe I'm just missing something but some of @SimonForsberg auto-comments remote that the [Q] comments don't seem to appear after I added the remote, when clicking the comment box on a question... should they be [C] instead?
In fact, all the [Q] comments don't appear
Wait, other way around, only the [Q] comments do appear for questions, those marked [C] do not appear for question comments
I'm updating an old ECS I wrote a couple years back, and I've written the following piece of code in order to generate a GUID:
const auto& es::EntityStore::RequestEntity()
{
if(m_freeEntities.size() != 0)
{
return ec::ENTITY_ID_INVALID;
}
//Get the lastmost EntityID
a...
Well my real code is convoluted involving at least two loops of asynchronous fetch calls to retrieve values that will then be filtered and cross referenced against each other. That's why I was wanting to store values in a cache. Of course one could consider a cache object to be a variable. But one loop will be writing to it and another will be reading from it and both asynchronous. My question attempts to address the general problem rather than code review my specific project (-: — hippietrail38 secs ago
I wrote a solution to the Coding Challenge in C++ using the Sieve of Eratosthenes. How much Ever I tried I could not get over the Time Limit on SPOJ.
How can I optimise this Code ?
/*
* Generate Prime Numbers Between two given numbers.
* Url : http://www.spoj.com/problems/PRIME1/
* Date...
I am new to Android development. In application development, I often need to use 'Constants' and 'Enums'.As far as my I use the strategy, I keep all 'Constants' in a separate class named 'Constants' but I am not sure whether I should keep all Enums in a separate class as I use 'Constants'? or I s...
Pulling an individual record from the file means reading through the file until you find the proper record. I highly recommend moving to a computer with a modern 64-bit environment and a reasonable amount of RAM. If you'd like to optimize your program anyway, please provide an MCVE. If it currently works, consider asking on Code Review instead. — TigerhawkT338 secs ago
I have multiple webapi methods which uses same table and same select statement. only difference is where condition for all the methods. How can i write simple method to pass the where condition dynamically in C#
public HttpResponseMessage GetClaimsFlagged()
{
var result = fro...
Maybe more appropriate for CodeReview... anyway, I see it mostly right, except that the unique_ptr<mutex> looks unnecessary to me. And instead of duplicating the surface API you could just override operator->(). — rodrigo49 secs ago
I wrote a code which:
- parse string to my enum
- get description from enum
- assign to string[] array
private readonly string[] allowed;
public AuthorizeRoles(params object[] arrayParam)
{
allowed = (arrayParam.Select(myField => Enum.Parse(typeof (MyEnum), myField.ToString()))
.Se...
The idea of the algorithm is to decrease a number from a word.
If there is better way to write this algorithm please comment.
limitiation:
it is important to decrease with a limit, if BB is the word we
decrease from, after decreasing by 1 the result will be BA, but
after decreasing by 2, we...
The app calculates the tax which is included in a (given) amount.
Because I'm new with both libraries (React.js, Foundation) I would appreciate hints and improvement suggestions.
Live-Demo on CodePen : http://codepen.io/mizech/pen/WxxrMZ
My source code :
var SelectInput = React.createCla...
Shouldn't be too complicated. I'll just need a program that can fetch the meta CR URL and save it to a file pretty much, then I can take care of uploading it to my FTP. And such a program should be easy to make in Java with JSoup, if no one beats me to it.
@Phrancis The userscript itself is not mine, I'm just hosting a file that can be imported to the user-script.
I've made mine first Java program and it was Guess a number game and got some great code review, so I've decided to first implement that suggestions and to make a game a bit more complex/advanced.
So now, user can select between 3 options, 3 different intervals (1-10, 1-20, 1-10), but also, in e...
Actually, I don't like write for/foreach.
I had to write a loop. I would like to replace it with array_map/array_walk.
Does anyone have an idea?
The code:
foreach ($data as $key => $value) {
if(isset(static::$specialKeywords[$value])) {
unset($data[$key]);
$check['specialK...
Having the following code, where:
$row: Is an array that contains some things, but the ones that are interesting for the post are country_from and country_to, which are country names.
$pBCountries: Array containing strings with country names.
The function is very easy. It checks if the countr...
My name is Matt and I have a fat controller problem.
In truth I have limited experience of MVC and I'm trying to learn how to organise my code better so it's more testable and more maintainable. Here's my first effort at rewriting a bit of my existing application to make it happier and slimmer.
...
I just `git mv`ed a folder to rename it, and edited a file in it. Will `git commit -a` commit both these things? (Yes, I'm a massive git noob.) (I used `git commit -a --dry-run` and it just says it was renamed. should I use two commits here?)
it was something like this: \((.*?)\)(?:\((.*?)\))?. Any ideas on how could I modify it so that: if I have index(v1) or index(v1)(v2) to also match the parentheses (not just the values) ?
(iii) Describe the structure of an array that could be used to handle the traffic light sequence
The sequence should be repetitive. Each red should last 5 seconds. Each amber should last 3 seconds. And each green should last 5 seconds.
Red
Amber
Green
Amber
Red
(iv) Write a script that uses...
When I create a bit vector with size 32 backed by u8 and I take the right part (index 16-31) as a bit slice (a mutable view), then set them all to false, they're all false, set them all to true, they're all true, set them all to false, they're still true
The pound sign isn't indicated either, which seems weird, considering the overlap between Facebook, InstaGram and Twitter users and Mac users is probably quite significant.
I have an Excel workbook with two sheets: "Raw data" and "Summary". In the raw data sheet there are several blocks with data structured like the image below:
I want to create a summary of the data below, in the sheet "Summary", looking like this:
The way I've done this is:
Sub TransferAndS...