Seems like I am frequently writing something like this...
a_hash['x'] ? a_hash['x'] += ' some more text' : a_hash['x'] = 'first text'
seems like there ought to be a better way, but I can't find it.
Is there a CSS library which mimics the iPhone grouped UITableView?
I want to build a nice looking table which looks exactly like the grouped UITableView. As there are multiple text styles within the each line of text, and I don't need any interactivity except scrolling, it seems it would be easier to build with HTML and display it in a UIWebView. Is there a css library which matches this need?
Hi
This is my program .when i submit the print button i can print the datas but they are not aligned in the table formatthe format in which i need the print to be...How can i print in the correct format
<html>
<head>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js" > </script>
<script type="text/javascript">
function PrintElem(elem)
{
//alert('ddd');
Popup($(elem).text());
}
function Popup(data)
{
var mywindow = window.open('', 'mydiv', 'height=400,width=600');
mywindow.document.write('<html><head><title>my div</title>');
/*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close();
mywindow.print();
return true;
}
</script>
</head>
<body>
<div id="mydiv">
<table width="200" border="1">
<tr>
<td>sss</td>
<td>sssss;</td>
<td>snssbsp;</td>
</tr>
<tr>
<td>ssss;</td>
<td>sssnbsp;</td>
<td>snbsp;</td>
</tr>
<tr>
<td>snbsp;</td>
<td>snbsp;</td>
<td>snbsp;</td>
</tr>
</table>
</div>
<input type="button" value="Print Div" onClick="PrintElem('#mydiv')" />
</body>
</html>
Hi Guys,
When i start typing text in a default textView in my viewcontroller, its not going to the bottom of the textfield. It leaves room for 2 more lines of text and then starts scrolling.
I want it to start scrolling when i start going beyond the last line.
I tried everything, and i dont know what i can do?
Anyone any ideas?
Neither the <blink> tag nor the text-decoration:blink; style in css are supported in Internet Explorer.
Is there any technique available for making blinking text in IE?
I am having a weird experience. I am dynamically creating a row of textboxes at runtime when the user clicks a button.
However, on my local machine the text boxes appear correctly (example
[TextBox1] [TextBox2] [TextBox3] [TextBox4] [TextBox5]
[TextBox1] [TextBox2] [TextBox3] [TextBox4] [TextBox5]
[TextBox1] [TextBox2] [TextBox3] [TextBox4] [TextBox5]
When I run this app on the production, the output side-by-side is:
[TextBox1][TextBox1] [TextBox2][TextBox2] [TextBox3][TextBox3] [TextBox4][TextBox4]
The output should be one row of textboxes, then a second row of 5 text boxes
Anyone experience this?
I'm trying to clean some html text with javascript, there are white spaces included before and after some words (text is poorly formatted).
Currently I have this regex:
$("#" + target + " *").replaceText(/([\S][\u05B0-\u05C4]*)/gi, '<span class="marked">$1<\/span>');
This will capture all the non white-space characters and wrap them in a span element, but will not capture spaces between words (I need the span).
How would you solve this?
debugTestLabel.text = [[NSString alloc] initWithFormat:@"%g, %g", @"Testing String", @"I am another"];
I alloc the String and immediately assign to the text, but I don't know whether the string can auto release or not.
I'm trying to use jquery to clone a table row everytime someone presses the add-row button. Can anyone tell me what's wrong with my code? I'm using HTML + smarty templating language in my view. Here's what my template file looks like:
<table>
<tr>
<td>Description</td>
<td>Unit</td>
<td>Qty</td>
<td>Total</td>
<td></td>
</tr>
<tbody id="entries">
{foreach from=$arrItem item=i name=inv}
<tr>
<td>
<input type="hidden" name="invoice_item_id[]" value="{$i.invoice_item_id}"/>
<input type="hidden" name="assignment_id[]" value="{$i.assignment_id}" />
<input type="text" name="description[]" value="{$i.description}"/>
</td>
<td><input type="text" class="unit_cost" name="unit_cost[]" value="{$i.unit_cost}"/></td>
<td><input type="text" class="qty" name="qty[]" value="{$i.qty}"/></td>
<td><input type="text" class="cost" name="cost[]" value="{$i.cost}"/></td>
<td><a href="javascript:void(0);" class="delete-invoice-item">delete</a></td>
</tr>
{/foreach}
</tbody>
<tfoot>
<tr><td colspan="5"><input type="button" id="add-row" value="add row" /></td></tr>
</tfoot>
</table>
Here's my Jquery Javascript call, which I know gets fired when I put in an alert() statement. So the problem is with me not knowing how jquery works.
$('#add-row').live('click', function() {$('#entries tr:nth-child(0)').clone().appendTo('#entries');});
So what am I doing wrong?
I have a Workflow 4.0 app that generates emails. In a dialog for creating the email body the user needs to be able to input some string value representing an existing wf instance variable to be inserted as a string at runtime.
So they input something like: Email body text including <.
(say ExistingVariable is an int or something like that)
Any helpful hints for how to convert this text with a ToString() at runtime?
Hello,
i think the fullcalendar jquery-plugin is a really great solution.
i saw does the string for the title in the fullcalender plugin is escaped (htmlEscape). But i need to format some strings in the title for example bold text or colors, or small images?
the solution with another plugin (for example qTip, like in the examples) will not the right way for me.
is there anyway to format the title text?
Regards
flauschi
Hi all, would the following Jquery selector get all of the 4th td elements of all the tables on the current page, and return their text as an array?:
var isbn = $.makeArray($("table tr td:nth-child(4)").text());
I have the following:
$("span.findme").each(function() {
$("<li>").text($(this).text()).appendTo("ul");
});
How can I, using the above, detect if EACH finds 0, if it's 0 I want to trigger an alert.
Thanks
I am just starting with cpp and I've been following different examples to learn from them, and I see that buffer size is set in different ways, for example:
char buffer[255];
StringCchPrintf(buffer, sizeof(buffer), TEXT("%s"), X);
VS
char buffer[255];
StringCchPrintf(buffer, 255*sizeof(char), TEXT("%s"), X);
Which one is the correct way to use it?
I've seen this in other functions like InternetReadFile, ZeroMemory and MultiByteToWideChar.
I create a new table of employee now I want to edit one of the column name in that table. I can edit but while saving a pop up window asks to save some text file. How may I resolve this? Is it possible to edit without creating a new table?
The text file is
/*
Friday, August 22, 20144:32:53 PM
User:
Server: MIDHUN\SQLEXPRESS
Database: LinQ
Application:
*/
employee
I'm trying to use sed to replace whitespace within a string. For example, given the line:
var test = 'Some test text here.';
I want to get:
var test = 'Sometesttexthere.';
I've tried using (\x27 matches the '):
sed 's|\x27\([^x27[:space:]]*\)[[:space:]]|\x27\1|g
but that just gives
var test = 'Sometest text here.';
Any ideas?
I need to get informed when the user changes the font size in it's browser.
I need it to reposition some elements which have to be relative in one dimension to an anchor inside a text.
So far i haven't found anything and i'm a bit worried that it's not possible. In this case it should be possible to emulate it with a hidden div and some text inside and a script polling for changes of it's width. But i hope someone has a more elegant solution.
I am trying to read .doc/.docx file with stream reader, but it give me output as unspecified character ie.
??[ ?L?f???C???.
I'm writing the file using a text editor. Here's a snippet of my code:
string filePath = baseUrl+ "Sample.docx";
using (StreamReader reader = new StreamReader(filePath, Encoding.UTF8))
{
txtBody.Text = reader.ReadToEnd();
}
I'm using VS 2010. Thank you.
I have a TreeView control in a Windows Forms application that is displaying my own subclass of TreeNode. I need to display a number along with each node's text indicating its position in the tree, like 1 for the root, 1.1 for its first child, 1.2 for its second child, etc. I'm using C# with .NET 2.0
The best that I can come up with is, after the tree is built, go to each node, recursively find the parent and append the parent's sibling number to the front of the node's text until you reach the root.
I have a build process which runs from a batch file. It produces a large volume of text. Sometimes it prints the word "Error" or "Warning" followed by a message. The errors and warnings are getting lost among a sea of text.
Can I highlight those words in a different color, maybe in a dos window, or a cygwin shell window, possibly by piping them through some string manipulation program before posting them to the screen?
Thanks.
I have table that gets dynamically created.
When using jQuery and toggle, everything works. I however get a small visual glitch - it seems the HTML sometimes get selected. How would I disable this on a faulty drag or mouse operation?
Is there a difference in the DOM between text in a cell and 'not text' or buffered space in a td?
Thanks in advance.
I have a grouped UITableView that has 3 sections. I would like to show a UIImage with some text next to it (not a cell), but I am not sure how I can go about doing that? The image and text need to match the background of the pinstripes.
In my xml file comments are listed as
<Comments>
<CommentID id="1">
<CommentBy>efet</CommentBy>
<CommentDesc> Who cares!!! My boyfriend thinks the same with me. tell your friends.
</CommentDesc>
</CommentID>
<CommentID id="2">
<CommentBy>tetto</CommentBy>
<CommentDesc> xyz.... </CommentDesc>
</CommentID>
</Comments>
I need to append them inside the ul of the div id="nw-comments".
<div id="nw-comments" class="article-page">
<h3>Member Comments</h3>
<ul>
<li class="top-level">
<ul class="comment-options right">
<li>
<a id="reply_1272195" class="reply" href="javascript:void(0);" name="anchor_1272195">Reply</a>
</li>
<li class="last">
<a id="report_1272195" class="report" href="javascript:void(0);">Report Abuse</a>
</li>
</ul>
<h6>Posted By: [CommentBy] @ [CommentDateEntered]</h6>
<div class="post-content">
<p>[CommentDesc]</p>
</div>
</li>
</ul>
</div>
I tried to do it with the following code but I keep getting errors.
$(document).ready(function(){
$.ajax({
dataType: "xml",
url: "/FLPM/content/news/news.cs.asp?Process=ViewNews&NEWSID=<%=Request.QueryString("NEWSID")%>",
success: function(xml) {
$(xml).find('row').each(function(){
var id = $(this).attr('id');
var FullName = $(this).find('FullName').text();
var CommentBy = $(this).find('CommentBy').text();
var CommentDateEntered = $(this).find('CommentDateEntered').text();
var CommentDesc = $(this).find('CommentDesc').text();
$("#nw-comments ul").append("<h6>Posted By: " + CommentBy + " @ " + CommentDateEntered + "</h6><div class=""post-content""><p>" + CommentDesc + "</p></div>");
});
}
});
Please view this jsfiddle jsfiddle.net/rflfn/uS4jd/
This is other try jsfiddle.net/rflfn/T3ZT6/
I'm using SMOF to developper Wordpress theme, I need make one function to change some values when link is clicked, but when I make array with name of div, the array returns null value...
<a class="button" id="settext1">Some Link</a>
<br />
<a class="button" id="settext2">Another Link</a>
<br />
<a class="button" id="settext3">Link 3</a>
<br />
JQ:
$(document).ready(function(){
// var col_settext1 = new Array(); // <-- I need make this array with name of DIV cliked
col_settext1['field_id1']='#FF0000';
col_settext1['field_id2']='#00FFFF';
// var txt_settext1 = new Array(); // <-- I need make this array with name of DIV cliked
txt_settext1['field_id3']='Some Text Here';
txt_settext1['field_id4']='Another Text Here';
// var txt_settext2 = new Array(); // <-- I need make this array with name of DIV cliked
txt_settext2['field_id5']='Some Text Here';
// var col_settext2 = new Array(); // <-- I need make this array with name of DIV cliked
col_settext2['field_id6']='Another Text Here';
// var chk_settext2 = new Array(); // <-- I need make this array with name of DIV cliked
chk_settext2['field_id7']="checked";
});
$('.button').click(function(){
$myclass = this.id;
$col = 'col_' + $myclass;
$txt = 'txt_' + $myclass;
$chk = 'chk_' + $myclass;
// Based I clicked on the link 'settext1', Here I have this:
// col_settext1
// txt_settext1
// chk_settext1
// THE PROBLEM ARE HERE!
$col = new Array(); // <--- Here I use name of DIV as Array, but the value is lost...
$txt = new Array();
$chk = new Array();
// Test...
alert($col); // <--- Here no have any value :(
alert($col[1]); // <--- Here no have any value :(
for (id in $col) { // 'id' is value of array --> col_settext1['field_id1']='#FF0000';
// do function based on array values...
// just example:
alert(id);
}
for (id in $txt) { // 'id' is value of array --> txt_settext1['field_id1']='#FF0000';
// do function based on array values...
}
for (id in $chk) { // 'id' is value of array --> chk_settext1['field_id1']='#FF0000';
// do function based on array values...
}
});
Is possible use name of the div as array name?
Any suggestion or any other method to solve this problem is welcome.