Hi guys
How can i display multi-image in UITableView like image below:
http://c.upanh.com/upload/6/172/LN0.10355393_1_1.jpg
Please give me some code.
Thank you
I added a mask to UIView's layer:
CGImageRef maskImageRef = [UIImage imageNamed:"Icon.png"].CGImage;
CALayer maskLayer = [CALayer layer];
maskLayer.contents = (__bridge id)maskImageRef;
self.layer.mask = maskLayer;
Then I use this code to get snapshot from a UIView:
[self.layer renderInContext:mainViewContentContext];
But the mask wasn't drawn.
How to draw self.layer with mask?
Special thx!
In various bits of Android code I've seen:
public class MyActivity extends Activity {
public void method() {
mContext = this; // since Activity extends Context
mContext = getApplicationContext();
mContext = getBaseContext();
}
}
However I can't find any decent explanation of which is preferable, and under what circumstances which should be used.
Pointers to documentation on this, and guidance about what might break if the wrong one is chosen, would be much appreciated.
Hi All
I was wondering if anyone could help me out (not with code, although that would be appreciated), with the logic behind checking and retrieving messages from a POP3 mail server.
I.e.
Establish connection
Validate credentials
Enumerate message list
Check each message to see if it's "new"
Download "new" message(s).
Would this be the correct way about doing this?
Thank you
Someone has suggested to me that the built in C# Math.Sqrt function in .NET 4.0 caches its results, so that if I call Math.Sqrt(50) over and over again, it's not actually doing a sqrt, but just pulling the answer from a cache. Can anyone verify or deny this claim? If it's true then I have a bunch of needless caching going on in my code.
I want to be able to use this IDE to step though code and debug.
So far I have found:
"e" Text Editor (http://www.e-texteditor.com/) $34.95
Arcadia (http://arcadia.rubyforge.org/)
Has anybody ever tried either of these and how are they? Or anything else you can suggest?
Hello, I'm working on a c++ code that uses SDL/opengl. Is this possible to create a pointer to a quadric with 'gluNewQuadric()' before having initialized opengl with 'SDL_SetVideoMode'? The idea is to create a class with a (pointer to a) quadric class member that has to be instantiate before the 'SDL_SetVideoMode' call. This pointer is initialized in the class' constructor with a 'gluNewQuadric()' call.
I have an ajax post and in the controller I return nothing. In case there is a failure will the error message displayed with the follwoing code?
[AcceptVerbs(HttpVerbs.Post)]
public void Edit(Model model)
{
model.Save();
}
$.ajax({
type: "POST",
url: '<%=Url.Action("Edit","test") %>',
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "html",
success: function() {
},
error: function(request, status, error) {
alert("Error: " & request.responseText);
}
});
Here is my code so far:
$(document).ready(function(){
$("#slider").click(function() {
$("#insight").animate({ top: "25px",}, 300, function() {
$("#insight").animate({ top: "89px",}, 300);
});
});
});
I want this to act like .toggle(), where by on click #div1 slides up to top:25px and then stops, but when clicked again slides down to top:89px.
Can anyone expand the function above to achieve this?
I am having a hard time getting video to play in an application that I am working on and I think the answer has to do with the views and view controllers. I have the flow depicted below. When the button is clicked, the audio from the video is playing, but nothing is displayed on screen. Anyone have any ideas?
-(IBAction) playMovie {
Play Movie Code
}
ViewController UIScrollView UIView UIButton - (playMovie)
During a recent interview I was asked why one would want to create mock objects. My answer went something like, "Take a database--if you're writing test code, you may not want that test hooked up live to the production database where actual operations will be performed."
Judging by response, my answer clearly was not what the interviewer was looking for. What's a better answer?
The cell in this iPhone TableView definitely has a Detail-Disclosure-Button.
When I tap it... shouldn't this code give me access to the button?
Instead detailButton is always just null.
- (void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *aCell = [tableView cellForRowAtIndexPath:indexPath];
UIButton *detailButton = (UIButton *)[aCell accessoryView];
}
I have a div element which contains UL and UL contains the LI items. One of the LI item has an ID of stocknumber. I need to select that li.
Here is my code which works fine I am just looking for a better implementation.
$(".block").children("ul").children("#stocknumber") // gets me the li and it works!!
Hey guys,
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes.
Is this possible doing this in code behind without messing with the installer?
Thanks in advance.
hi,
I want to create one winform c#.net application that will record all the user activity happening on desktop.I want to create avi file for that record format.also want to upload that files to server shared folder.
Please provide me code or sample project which can work on any OS.including vista and win7.
also AVI file size should be compressed.
hi all
i am new in the field of iphone development ....
i am working on a game in which when user touch on a image then a nib file must be pop up on the scree and i am unable to do that..
please help provide some sample code or any kind of help
thanks in advance
How do I show the dates number format next to its name in the array using PHP? So that the number format is saved in the database and the month name is displayed?
Here is the php code.
$month_options = array("Month", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
Like the msvcr70/msvcr80/msvcr90.dll, what's the code like to instruct the linker to link to one of them dynamically?
Or has that anything to do with c/c++,but cmake?
I'd like to disable the 'Refresh' option in the right-click menu for internet explorer. Our application uses Javascript, ASP.Net and VB, but I'm sure it'll need to be done through Javascript. Any code snippets would be greatly appreciated.
Thanks
My code is somewhat like this:
<?php
if($_REQUEST['post'])
{
$title=$_REQUEST['title'];
$body=$_REQUEST['body'];
echo $title.$body;
}
?>
<script type="text/javascript" src="texteditor.js">
</script>
<form action="" method="post">
Title: <input type="text" name="title"/><br>
<a id="bold" class="font-bold"> B </a>
<a id="italic" class="italic"> I </a>
Post: <iframe id="textEditor" name="body"></iframe>
<input type="submit" name="post" value="Post" />
</form>
the texteditor.js file code is:
$(document).ready(function(){
document.getElementById('textEditor').contentWindow.document.designMode="on";
document.getElementById('textEditor').contentWindow.document.close();
$("#bold").click(function(){
if($(this).hasClass("selected"))
{
$(this).removeClass("selected");
}else
{
$(this).addClass("selected");
}
boldIt();
});
$("#italic").click(function(){
if($(this).hasClass("selected"))
{
$(this).removeClass("selected");
}else
{
$(this).addClass("selected");
}
ItalicIt();
});
});
function boldIt(){
var edit = document.getElementById("textEditor").contentWindow;
edit.focus();
edit.document.execCommand("bold", false, "");
edit.focus();
}
function ItalicIt(){
var edit = document.getElementById("textEditor").contentWindow;
edit.focus();
edit.document.execCommand("italic", false, "");
edit.focus();
}
function post(){
var iframe = document.getElementById("body").contentWindow;
}
actualy i want to fetch data from this texteditor (which is created using iframe and javascript) and store it in some other place. i'm not able to fetch the content that is entered in the editor (i.e. iframe here).
please help me out of this....
Getting very confused by PHP_AUTH_USER. Within my web pages I have .htaccess files in every directory, controlling who can (and cant) see certain folders. In order to further customise the pages I was hoping to use PHP_AUTH_USER within the PHP code, i.e. tailor page contents based on the user.
This only seems to work partially. The code snippets below hopefully demonstrate my problems.
The main index.php creates a framed page with a menu structure in the top left hand corners, some irrelvant stuff in top right and then the tailor made contents in bottom frame. In top left the user is correctly shown, but in the bottom frame PHP_AUTH_USER doesnt seem to be set anymore (it returns empty and when printing all $HTTP_SERVER_VARS its not listed).
Script.php is in a different path, but they all have .htaccess files in them and all other contents is displayed correctly. Why does it not know about PHP_AUTH_USER there?
Running version php version 5.2.12 on chrome.
index.php
<FRAMESET ROWS="35%, *">
<FRAMESET COLS="25%, *">
<FRAME SRC="Menu.php">
<FRAME SRC="Something.php">
</FRAMESET>
<FRAME SRC="../OtherPath/Script.php?large=1" name="outputlisting">
</FRAMESET>
</FRAMESET>
Menu.php
<ul>
<li>Reporting
<ul>
<li>Link1 <a href="../OtherPath/Script.php" target="outputlisting">All</a>, <a href="../OtherPath/Script.php?large=1" target="outputlisting">Big</a>
</ul>
<?php
echo 'IP Address: ' . $_SERVER['REMOTE_ADDR'] . '<br />';
echo 'User: ' . $_SERVER['PHP_AUTH_USER'];
?>
Script.php
<?php
echo 'User: ' . $_SERVER['PHP_AUTH_USER'];
?>
Hello,
nowadays I have this piece of code:
#import "C:\Users\Public\SoundLog\DLLs\ForPython\SoundLogDLL.tlb" named_guids
but I want to substitute the C:\Users\Public part by the %PUBLIC% environment variable.
How can I do this ?
Hello
I have a problem with "CFDataRef.
I get the "data" field from a "kCFSocketDataCallBack.
"data" should correspond to a string received on the socket.
How do I convert, for example, in a NSString so I can put my text in a textbox??
Thank you very much
static void
AcceptDataCallback(CFSocketRef s,
CFSocketCallBackType type, CFDataRef
address, const void *data, void *info)
{
//my code for the textBox
}
I want to open All external link into new window/tab through php without touching every external link code. and i don't want to this without target="blank".
I can do this through javascript but i want to know if there is a PHP solution.
I have this snippet of the code
Stack& Stack:: operator=(const Stack& stack){
if(this == &stack){
return *this
}
}
here I define operator = but I can't understand, if I receive by reference stack why it should be & in this == &stack and not this == stack and why we return * in return *this and not this thanks in advance for any help