instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I want to search the text property of my twitter status objects and swap out @username for <a href="http:/twitter.com/username">@username</a>. What I have tried so far looks like this:
$pattern = '/([@]{1})([a-zA-Z0-9\_]+)/';
$replace = '<a href="http://twitter.com/\2">\1\2</a>';
$new_string = preg_replace($pattern, $r... | stackexchange/codereview |
I have a need to change the spring applicationContext.xml file that is used based upon a property, this property MUST be defined somewhere outside of the war file (ie. it can't be in web.xml). Currently, I've arrived at the following solution (see my answer below), wondering if there's a better way to do this?
| stackexchange/codereview |
Hi I have next XAML markup (just a piece of course):
<Window.Resources>
<GridView x:Key="gridview">
<GridViewColumn Width="200" DisplayMemberBinding="{Binding Title}">
<GridViewColumnHeader Content="Titel" Tag="Title" Click="SortClick"/>
</GridViewColumn>
<GridViewColumn Wi... | stackexchange/codereview |
I have a client who is interested in hiring my company to do a small, custom, multi-user contact database/crm. They don't care about the technology I use, as long as the product is hosted inside their organization (no "cloud" hosting). Now the problem is that their IT department refuses to host any application develope... | stackexchange/codereview |
I just upgraded from cakePHP 1.2.8 to 1.3.5 and now the debug information (that from the level set in the Core) does not seem to be doing anything anymore. No matter what level I set 'debug' to, it doesn't print the queries at the bottom of the screen.
Any idea what I may have done wrong?
| stackexchange/codereview |
I'm using WCF, REST and "pretty URI's" as shown in this blog post with the Online Template for VS 2010 .NET 4.0:
http://christopherdeweese.com/blog2/post/drop-the-soap-wcf-rest-and-pretty-uris-in-net-4
I have one problem though.
I want to return a a raw byte[] array but it automatically gets base64 encoded.
Unfortunate... | stackexchange/codereview |
I'm trying to implement some kind of very basic flow chart functionality in a div.
Basically I have some boxes which by default my be joined by a little AND bubble. If I click on the bubble it will change to an OR bubble which will result in the boxes (divs) splitting.
Not really to sure where to start on this any guid... | stackexchange/codereview |
I would like to have some advices because I've got conflict between clients sending RTSP messages to the server.
First at all I apologize to you all for my English.
Well, what I'm doing is a java streaming video application.
clients set TCP connection with the server for exchanging RTSP messages
server sends over UDP... | stackexchange/codereview |
I have the following code:
def countdown():
def countdown1():
print 'countdown1'
def countdown2():
def countdown3():
takePic()
self.pic.set_markup("<span size='54000'>1</span>");
print... | stackexchange/codereview |
Any one Please tell me how to autoindent my cobol and JCL codes. It will be easy for me to write programs if i use those intendationi n notepad++. Please reply me.
| stackexchange/codereview |
I have requirement to make sure that the configuration file is not tampered. It is simple key-value pair file. However I also do not want any strong encryption mechanism like AES and so on to ensure that the data in it is encrypted.
I just want to ensure that I know that the file was tampered. Some way in which a simpl... | stackexchange/codereview |
Note: A detailed answer to the more general problem is in Stack Overflow question What are the precise rules for when you can omit parenthesis, dots, braces, = (functions), etc.?.
The following works:
scala> List(1,2,3) filter (_ > 1) reduceLeft(_ + _)
res65: Int = 5
And also the following:
scala> List(1,2,3).filter(_... | stackexchange/codereview |
How to measure Latency and the payload size for IIS hosted WCF Service?
| stackexchange/codereview |
I'm receiving a query string (from a terrible payment system whose name I do not wish to sully publicly) that contains un-encoded ampersands
name=joe+jones&company=abercrombie&fitch&other=no
parse_str can't handle this, and I don't know enough of regex to come up with my own scheme (though I did try). My hang up was l... | stackexchange/codereview |
I am very new in working with GIS or geometry data. I have geometry data (polygon) in oracle10g database. Is there any Spatial function to find a point inside that polygon. If not then any tool like geotools for .Net or any other API can help me. The polygon can have hole inside it. So point must be in a polygon area.
... | stackexchange/codereview |
I am interested in learning the basics on machine learning and am wondering what the best ONLINE resources are. Keep in mind i am a total novice and know very little about the subject.
| stackexchange/codereview |
Is there any way to always do a fresh install when I'm "Running" my Android app for testing on either a real device or an emulator. It always tells me "No need to install because application is already on device", then just launches the main Intent.
Any ideas? Thanks!
| stackexchange/codereview |
I want to get a DatePicker Dialog with no day picker (only year and month) for credit cards expiration in a form.
I checked the DatePicker source code and it's not seem to be suporting such feature as not showing once of it's pickers.
Any other widget to do it or do i have to create my own widget again...
| stackexchange/codereview |
does exist a specific annotation to define the address of the endpoint.
In fact, I want to remove the attribute address in the SPring file and move the annotation directly in the impl. class.
Current:
jaxws:endpoint id="dataManagerEndPoint" implementor="#dataManagerService" address="/datamanager/v1.0"
@WebService
pub... | stackexchange/codereview |
I'm trying to implement some kind of class hierarchy in JavaScript. I
think I understood the prototype chain, but I still have to sort out the
constructor-chaining. Following David Flanagan's Definitive Guide,
I wrote
function DerivedClass()
{
BaseClass.apply(this, arguments); // chain constructors
// do some ... | stackexchange/codereview |
I am trying to implement a way to avoid click spamming. I have a Link button that when clicked sends the request to the server using Jquery $.ajax() command. I want a way to prohibit multiple clicks like the one implemented here in StackOverflow when adding a comment.
Any suggestion ?
| stackexchange/codereview |
I've found this from this link:
http://www.sqlite.org/datatype3.html
1.2 Date and Time Datatype
SQLite does not have a storage class
set aside for storing dates and/or
times. Instead, the built-in Date And
Time Functions of SQLite are capable
of storing dates and times as TEXT,
REAL, or INTEGER values:
TEXT as ISO8601... | stackexchange/codereview |
I have a clearQuest Web (running on Linux) and wants to create a sharepoint site when a new record is created (using a perl script).
How can I do it - is there any sharepoint web service that I can use to create a site.
I beleive that I need a perl module for web services, how do I add it to the perl installation of th... | stackexchange/codereview |
I have 2 methods I tried to iterate through all my textboxes in an asp.net page. The first is working, but the second one is not returning anything. Could someone please explain to me why the second one is not working?
This works ok:
List<string> list = new List<string>();
foreach (Control c in Page.Controls)
... | stackexchange/codereview |
Let's say within the <body> of my web page, all I have is a <textarea> element.
This <textarea> should be as wide and tall as the browser window (minus any padding or margin the <body> has, or any default computed styles per browser).
I can make it as wide as the window by setting display:block;width:100%, but it does... | stackexchange/codereview |
I have a ListView in virtual mode, and the underlying data is being stored in a List<MyRowObject>. Each column of the ListView corresponds to a public string property of MyRowObject. The columns of my ListView are configurable during runtime, such that any of them can be disabled and they can be reordered. To return a ... | stackexchange/codereview |
I didn't invoke any sass command to "watch" the .sass file changes and recompile them into .css (and concatenate all .css into a giant .css file)
But somehow, when I modify any .sass file in the Rails project, and reload the page on a browser, the giant .css file already has the updated content.
What is the mechanism ... | stackexchange/codereview |
My .NET utility AjGenesis is a code generation tool. The compiled binaries runs without glitches under Ubuntu 10.x, and Mono. But I have a problem: generating a java text file (a normal text file for my tool) it generates Byte Order Mark at the beginning of each file. I'm using System.Text.Encoding.Default: in Windows,... | stackexchange/codereview |
I have two data frames -- one with stock closing prices arranged by date (rows) and ticker symbol (columns):
> head(data.stocks)
date A AAPL ABAT AB ABV
1 2010-10-04 32.59 278.64 3.65 26.42 125.89
2 2010-10-05 33.04 288.94 3.66 27.10 129.05
3 2010-10-06 32.67 289.19 3.59 26.99 129.90
4 2010-10-07 33... | stackexchange/codereview |
In Mercurial I have an old changeset which is all good apart from the alterations to a single file. How would I revert the alterations to that single file?
Even just being able to view the state of the file at the previous changeset would be good then I could cut & paste.
My Mercurial client is TortoiseHg.
| stackexchange/codereview |
How to log the JavaScript exceptions?
Yes I am using Try catch() block in JavaScript.
I need to write all the exceptions in a text file.
| stackexchange/codereview |
I am using Javascript, and I want to return an XML document with the results I want.
For example, the XML document can be
<books>
<book>
<title>
Introduction to XML
</title>
</book>
<book>
<title>
Introduction to Javascript
</title>
</book>
</books>
and using this XPath expression:
//book[./title="Introduction to XM... | stackexchange/codereview |
so,
I've got something like this:
there's an ASP.NET application (1) that references WCF service (2) that references .NET application (3). (1) creates query gives it to (2), (2) gets some info from (3), processes it and returns it back to the (1).
And here's the issue - there's DataContract class for request (that is u... | stackexchange/codereview |
the below code shows a table with users to be accepted or declined. the code as it is has a dropdown on the end allowing to either accept it, deny it or leave as is. there is a button on the bottom to submit the form and after that there should be a php script that decides which user is accepted, denied or still pendi... | stackexchange/codereview |
I have an OSQA (python / django q&a application) installation serving 8 different sites. The sites are all in development, receiving minimal traffic. The server is a virtual private server with 512 mb of ram.
Apache is only serving dynamic pages with mod_wsgi behind Nginx. I can't stop Apache consuming more and more me... | stackexchange/codereview |
public class catnewModel
{
public IQueryable<category> dl { get; set; }
public IQueryable<product> dr { get; set; }
}
and my controller
public ActionResult Index()
{
var pr = db.products;
var pl = db.categories;
catnewModel model = new catnewModel();
model.dr = pr;
model.dl = pl;
... | stackexchange/codereview |
Fist post for a french developer!
I'm trying to create a simple synchronization using rsync and objective-c.
So I used NSTask like that :
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/rsync"];
NSArray* args = [NSArray arrayWithObjects:@"-av", @"/Users/BiB1/Documents/test/", @"login@ftp.myserver.... | stackexchange/codereview |
I want to "move" an id from one cell in a table to a relative cell in the table.
To simplify things, let's say I have this:
<tr><td></td><td id='a'></td><td></td><td></td><td></td></tr>
One of the cells has id='a' but I don't know which it will be. I simply want to make the one to the right of it have id='a'.
Getting ... | stackexchange/codereview |
I have a native (C++) process and a managed (C#) process on the same system. I want to enable communications between the two, similar to how one could use RPC between two native processes. I know I could use WCF using Microsoft's WWSAPI in the native process., but I was wondering what other options do I have? Or is ... | stackexchange/codereview |
I would like to use the Task framework in .NET to schedule something to run on a different thread then when it's done continue with an operation to update the UI on the UI thread. (I haven't played with it much yet, so it's not very familiar to me.)
Here is the code:
Task<List<NewsItem>> fetchTask = new Task<List<NewsI... | stackexchange/codereview |
i hav to read the file with name myname.plist from documents directory .....i want to store the content of the file to string....
| stackexchange/codereview |
How to do remote restart from JBoss 5.1.0? This is possible only using the JMX interface?
Thanks
| stackexchange/codereview |
The following won't compile for me. I'm out of ideas... Any help?
template<>
inline
std::ostream& operator<< <const std::map<std::string, std::string> > (std::ostream& stream, const std::map<std::string, std::string>& some_map)
{
return stream;
}
g++ gives me the following error:
error: expected initializer before '... | stackexchange/codereview |
Given the entities below - is it possible to somehow avoid using anonymous inner classes as marked by /***** Get rid of this anonymous inner class ******/.
The problem is that "SomeEntity" can contain hundreds of fields and there are multiple classes which implement this interface, each of them requiring meta informati... | stackexchange/codereview |
$.datepicker.parseDate("dd/mm/yy","10/10/2010");
Why this not causing an Exception?
| stackexchange/codereview |
I am suppose to generate graph from the results/execution of my algorithm . I have heard something about using CSV file in Excel and generating the graph. I have no idea what this CSV file is and how to do it. I googled CSV file but the answer i got was in connection with databases.
I am asking if someone can show me ... | stackexchange/codereview |
I've got this weird error when i try to generate either the filters or the form on my production server.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 20 bytes) in /var/www/project/lib/vendor/symfony/
lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on
line 669... | stackexchange/codereview |
Scenario: Events should be listed in chronological order by event date in ASC order
How do i test this scenario in cucumber?
Events has a name and a event_date. Events is shown in a list in the GUI. I want the test to fail when the events is in a unsorted order and the test to pass when the list is sorted by event_dat... | stackexchange/codereview |
These are my first 5 lines in my index.php:
<?php
session_start();
if (!isset($_SESSION['cart'])) $_SESSION['cart']='';
$page = $_GET['page'];
?>
and so on..
I'm looking at the sessions trough the firefox->firebug->firecookie plugin and a session is not created.(I am sure of it because the cart that worked yesterday... | stackexchange/codereview |
Title says it. I know I can use Process or ProcessStartInfo to run arguments, but I mean actually adding a command prompt control to my app (because I use it very often and it'd be convenient if it was already built-in.
Is there any way to do this other than coding a custom control? If not I can live with it, but it wo... | stackexchange/codereview |
I've tried many tricks found on the web including:
wmode transparent
z-index
WindowlessVideo
But none of them seem to work on Chrome. Works fine on IE and FF.
This version of code is XHTML compliant:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.d... | stackexchange/codereview |
I have file appenders FileA, FileB, and FileC. FileA I add to the root element as I want it to be a catch all, (more on this below). FileB and FileC I use for specific messages and create named loggers for each of those appenders. In code, I load the log I'm using for most messages like so:
private static readonly l... | stackexchange/codereview |
Kind of self-explanatory question: Why is it recommended loading jQuery or any other library from a CDN?
| stackexchange/codereview |
I would like to be able to call with javascript a function of my JNLP class. Let's assume in my applet I have a function defined like this: public String returnSomething(){ return "bla"; }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- ########################## IMPORTANT NOTE #################... | stackexchange/codereview |
in ms sql I have the following code:
ALTER PROCEDURE [dbo].[xmlDictamen_Alta]
@Xml text
as begin
declare @Id integer
declare @DictamenId numeric(18,0)
declare @DocumentoId numeric(18,0)
declare @Descripcion varchar(300)
begin
set nocount on
exec dbo.sp_xml_preparedocument @Id output, @Xml... | stackexchange/codereview |
Most of my classes have lists as private data members. As such, most of them also have adder/remover public members. I noticed I was writing basically the same thing for each of the adders, so I thought I'd turn it into a template.
Here's what I've got:
template <class N, class I>
void add(N element, std::list<N> & con... | stackexchange/codereview |
anyone used any idea for capturing captcha in selenium
| stackexchange/codereview |
I'm creating a batch file to execute my psake builds while integrating with teamcity and the TFS Powershell commandlets from TFPT and have come up with the following:
@ECHO OFF
SET COMMAND_TO_EXECUTE=
SET COMMAND_TO_EXECUTE=%COMMAND_TO_EXECUTE% "& {
SET COMMAND_TO_EXECUTE=%COMMAND_TO_EXECUTE% Import-Module '..\tools\p... | stackexchange/codereview |
I've got a dialog screen which is placed on top of my web page. This dialog can be dragged around the page, but also outside the visible part of the page. How can I detect the 'limits' of the browser window and prevent dragging the dialog outside the page?
The following part of an case statement is exectuted when I dro... | stackexchange/codereview |
I need to extract some data from malformed XML stored in an Oracle database. The XPath expressions would look like this: //image/type/text(). One take at a regular expression which would work in a similar fashion would be <image>.*?<type>(.+?)<\/type> (with appropriate flags for multiline matching).
Since Oracle does n... | stackexchange/codereview |
I have a span which contains 2 radio buttons and 2 labels. When a user selects a specific value from a drop down list it is not applicable to have the radio buttons showing so I fade them out. Again when a different value is selected I fade them back in.
When I fadeOut the span which contains them the text input box o... | stackexchange/codereview |
I am trying automatically increment the alpha numeric field (say for productid in product table).
But I am getting an error (see below).
Could somebody please look into this error or any other approach to achieve this task?
My table details:
create table tblProduct
(
id varchar(15)
)
create procedure spInsertInProdu... | stackexchange/codereview |
I am able to test my app on my device using the development profile/certficates...
In the same way, I have created distribution profile/certicates for my app....
But when I try to upload my app to iTunes , it says "Application failed codesign verification"
Also in the Organizer, it says "A valid signing identity matchi... | stackexchange/codereview |
is this possible to fire like query on DateTime in SQL Server 2005.
select cur.EvrIdent,
cur.VrdTarih,
cur.VrdModTim,
cur.VrdNo,
(select PmpKod from Bnz_Pompalar where PmpIdent=(select GunPmpId from Bnz_Tabancalar where GunIdent=TbdGunId)) as [Pump No],
(select GunKod from Bnz_Tabancalar where GunIdent=TbdGunId) as [No... | stackexchange/codereview |
I'm a little bit confused about MVC and OO paradigms. I have read some documentation about classical OO in the book "The Object-Oriented Thought Process".
Now I need to apply what I have learn in this book in the context of MVC pattern.
How can I design from scratch using the OO paradigm and implement it in a MVC Fram... | stackexchange/codereview |
I implementing OLE DB provider for my custom database. It will be used from ADO applications.
Now i have ADO example which creates ADO connection then close it with Connection.Close method but not release interface pointer of connection object. After that sample application creates another connection object and fails t... | stackexchange/codereview |
I have seen and used nested functions in Python, and they match the definition of a closure. So why are they called "nested functions" instead of "closures"?
Are nested functions not closures because they are not used by the external world?
UPDATE: I was reading about closures and it got me thinking about this concept... | stackexchange/codereview |
When I run the following command, it produces the following error:
% python manage.py celeryd -l INFO ~/Workspace/django-projects/project/src
Traceback (most recent call last):
File "manage.py", line 11, in <module>
... | stackexchange/codereview |
I know it is very uncommon to use protected methods or constructors. I have read discussions about this on SO and other sites.
The task I've got is rather simple. I have to access protected methods/constructors from my program. All attributes/methods must be declared as protected.
My code can be reduced to this. I'm ba... | stackexchange/codereview |
I want animate this:
$("#movethis").position({ my: "center top", at: "center bottom", of: "#nav1" });
How do I do it?
... It's kind of an oddball one, and I can't find any examples.
///udpate: got a work around. Would still prefer to do the above but this is what I got:
AnElement = dynamically selects correct eleme... | stackexchange/codereview |
I want to use kdevelop4 for c++ programming but when I try to run the application kdevelop4 wants cmake binary file! How can I solve this problem?
| stackexchange/codereview |
Hi
Actually I wanted to know what is bubbling event and how to make use of it. Also, what is the concept of capturing, targeting and bubbling too? If any one knows or could give any sample piece of code for explanation that would be helpful.
| stackexchange/codereview |
How to get the logged in user (interactive user) and machine name from window service in c#. When i try Environment and other class to get logged in user name it just returns NT AUTHORITY\SYSTEM from window service.
| stackexchange/codereview |
I use the following jQuery code to display my tabbed interface. My problem is that the default tab is hard-coded. If I submit a form from any of the tabs, it always defaults back to the default tab.
Can this be changed somehow? Using sessions? If yes, how to use sessions with jQuery?
$(document).ready(function() {
... | stackexchange/codereview |
I try to load a assembly into my source code in C#. So i first compile the source file:
private bool testAssemblies(String sourceName)
{
FileInfo sourceFile = new FileInfo(sourceName);
CodeDomProvider provider = null;
bool compileOk = false;
// Select the code p... | stackexchange/codereview |
I would like to have a layout with 5 times 5 buttons. Each of them should have the same width and height (they should be square). And I want the whole matrix to use the screen width (or height, depending on rotation).
I currently do it "by hand" in the Java code:
for (int y=0; y<5; y++) {
TableRow tr = new TableRow... | stackexchange/codereview |
As per this recent question, HTML 4 standard indicates that closing </TD>/</TR> tags are optional.
The question is, if you write your HTML omitting those closing tags, would that affect the amount of work that the browser's HTML parser must do one way or the other?
I realize that the difference - even if there's any ef... | stackexchange/codereview |
I am rather new to mvc2 and when following a writeup on data annotations and such, I came across a bit of code that let me manually add a line of text to the validation summary.
I've searched for the last 2 or 3 hours and I've come to the point where I think I'm just searching for the wrong thing. Its not custom valida... | stackexchange/codereview |
So say I have an image that I want to "pixelate". I want this sharp image represented by a grid of, say, 100 x 100 squares. So if the original photo is 500 px X 500 px, each square is 5 px X 5 px. So each square would have a color corresponding to the 5 px X 5 px group of pixels it swaps in for...
How do I figure out w... | stackexchange/codereview |
Basically the problem comes down to this:
I load a file, write all the each character into a char* variable which has malloc() the length of the file. Then I return that variable and print it, then I free() the memory for that variable and try to print the variable again which does print it.
I'm very new to C so ther... | stackexchange/codereview |
If I run phpinfo() it tells me that memcached is installed.
memcached
memcached support enabled
Version 1.0.2
libmemcached version 0.44
Session support yes
igbinary support no
I installed it with sudo pecl install memcached
But when I try to instantiate the memcached class it is not found:
$mc = new... | stackexchange/codereview |
Here's my test code:
Dim testSingle As Single = 7.2
Dim testSingleF As Single = 7.2F
Dim testDouble As Double = 7.2
If testSingle = testDouble Then ' this is false
Label1.Text = "true"
Else
Label1.Text = "false"
End If
If testSingleF = testDouble Then ' this is false
Label2.Text = "true"
Else
Label2.T... | stackexchange/codereview |
I created a Class Library project in Visual Studio 2010 and created added the following VB.Net class:
Public Class Dumb
Private name As String
Public Sub New(ByVal newName As String)
name = newName
End Sub
Public Sub sayHi()
System.Console.WriteLine("Hi " & name)
End Sub
End Class
... | stackexchange/codereview |
I do not have any code to show, but using asp.net, vb.net, and SQL with stored procedures.
If on a page I have an item that is added to the database and therefore that information is "saved", is there a way to have an ("exit without saving") button on the page that does away with those changes?
Using infragisitcs ultra... | stackexchange/codereview |
I have worked on SQL stored procedures and I have noticed that many people use two different approaches -
First, to use select queries i.e. something like
Select * from TableA where colA = 10 order by colA
Second, is to do the same by constructing a query i.e. like
Declare @sqlstring varchar(100)
Declare @sqlwherec... | stackexchange/codereview |
Let's say I have a multi-line string like this:
STARTFRUIT
banana
ENDFRUIT
STARTFRUIT
avocado
ENDFRUIT
STARTVEGGIE
rhubarb
ENDVEGGIE
STARTFRUIT
lime
ENDFRUIT
I want to search for all fruit, no veggies. I try this:
MatchCollection myMatches = Regex.Matches(tbBlob.Text, "STARTFRUIT.*ENDFRUIT", RegexOptions.Singleline... | stackexchange/codereview |
I'm using:
nservicebus 2.0.0.0
nservicebus.Testing 2.0.0.0
VS2010
nUnit
.NET 4.0
c#
I'm using the nservicebus.Testing namespace which nservicebus provides for testing IMessage handlers.
My tests throw this error when invoking the IMessage handler:
System.InvalidOperationException :
Late bound operations cannot be
... | stackexchange/codereview |
I've implemented a graph of nodes in PostgreSQL (not a tree)
the structure of the table is in this format
id | node1 | node2
--------------------
1 | 1 | 2
2 | 1 | 3
3 | 4 | 1
4 | 5 | 1
5 | 1 | 6
This shows the relationships between the node 1 and the nodes it is connected to... | stackexchange/codereview |
I have an document-based Cocoa application with a TextView and I would like to capture clicks on it, so I'm trying to intercept Window events like mouseDown, mouseUp, etc. then relate them to my TextView.
I've tried a two things:
1.) I made the TextView the initial first responder for the Window of my document, and ove... | stackexchange/codereview |
How I can get first n characters with XSLT 1.0 from XHTML? I'm trying to create introduction text for news.
Everything is UTF-8
HTML entity aware ( &), one entity = one character
HTML tag aware (adds missing end tags)
Input HTML is always valid
If input text is over n chars add '...' to end output
Input tag... | stackexchange/codereview |
Given a undirected and connected graph G, find a spanning tree whose diameter is the minimum.
| stackexchange/codereview |
I came across this question about callbacks in Java. Hers is the running code and original answer here.
But I didn't understand how is it useful for callback?
Can you explain the concept of callback to a Java programmer?
Code:
public class Main {
public interface Visitor {
int DoJob(int a, int b);
... | stackexchange/codereview |
I want to develop a certain plugin/extension, which needs to run in eclipse and has to integrate with another (java) plugin, but it has to collect data from .NET assemblies (using mono's cecil).
So my question is how should I create this relation between the Java code and the .NET?
I know that I could use mono to run ... | stackexchange/codereview |
I'm trying to learn how methods work in C# (Also using the XNA Framework).
This is the method I made.
public void Exit()
{
if (Keyboard.GetState().IsKeyDown(Keys.Escape))
{
this.Exit();
}
I'm under the impression that it's in the proper format. But I don't know how to actua... | stackexchange/codereview |
I developed a simple web app in the browser where there are 3 input boxes . The first input box has a ajax search suggestion box drop down when user starts keying in something. For example, the first input box is for user to key in username, when user key in "alan", a dropdown-like suggestion box will show below the ... | stackexchange/codereview |
I have 2 div one to load data from an ajax request and another to display Jquery dialog with gif image which says loading.
The jquery dialog is displayed when the page is requested while the ajax function gets the data from the controller. I want to close the dialog when the ajax function completes the request but not... | stackexchange/codereview |
I have a webpage where I can click on it to add a image. If I then click on the image it makes it bigger and if I click again it resizes it back to the original size.
If I then click somewhere else on the screen I can create another image and grow and shrink this also by clicking on it.
The problem is only the latest i... | stackexchange/codereview |
My situation is that, I have page contains a button and some links. Whenever user click on the button, it tries to append tag <base> to <head>
function avoidRediect(){
$('head').append('<base target="_blank" />');
}
But the page does not take the effect(means the link is still opened in the same window).
Is my way... | stackexchange/codereview |
While developing my data model I didn't pay attention to the underlying database level. I encapsulated some logic in my domain classes' properties (example: method that counts order's profit). It all works well until I need to sort data. Sorting is a purely database feature (mainly because of performance i can't retrie... | stackexchange/codereview |
In a visual C# project i want to pass a XML Document Object to a method. In that method i should Read the values which i stored inside the XML Document object. Without creating an XML File.
Thanks for the Reply guys i finally got my piece of code.
... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.