#import <UIKit/UIKit.h>
@class SearchDetailViewController;
@interface SearchTableViewController : UITableViewController
<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource>{
IBOutlet UITableView *myTableView;
NSMutableArray *tableData;//will be storing data that will be displayed in table. //Search array den buna aktarma yapcaz ilerde görceksin.
NSMutableArray *searchedData;//will be storing data matching with the search string
UISearchBar *sBar;//search bar
NSMutableArray *searchArray; // It holds the medicines that are shown in tableview
SearchDetailViewController * searchDetailViewController;
NSMutableArray *deneme;
}
@property(nonatomic,retain)UISearchBar *sBar;
@property(nonatomic,retain)IBOutlet UITableView *myTableView;
@property(nonatomic,retain)NSMutableArray *tableData;
@property(nonatomic,retain)NSMutableArray *searchedData;
@property (nonatomic, retain) NSMutableArray *searchArray;
@property (nonatomic, retain) SearchDetailViewController *searchDetailViewController;
@property (nonatomic, copy) NSMutableArray *deneme;
@end
SearchTableViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController];
// [anotherViewController release];
**deneme= [[NSMutableArray alloc]init];
deneme=[tableData objectAtIndex:indexPath.row];**
****NSLog(@"my row = %@", deneme);**// I holded one of the selected cells here**
HistoryTableViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController];
// [anotherViewController release];
**SearchTableViewController *obj= [[SearchTableViewController alloc]init];**
**NSLog(@"my 2nd row= %@", [obj deneme]); //it prints nil**
}
My project is TabBar. There are two buttons on it- Search and History. I want to display selected items in a table in History tab. But i can not bring the selected item from SearchTableViewController.m to the class (HistoryTableViewController.m)
The problem is : I can hold one of the selected items in an array (named deneme)from table in SearchTableViewController.m but i can not take it to HistoryTableViewController.m.
It prints nil in console screen.... If I can make it visible in History class, I display those selected items on table. Please help me !!!
i want to submit a form via ajax javascript to cakephp function.
cakephp function accepts $this-data, so i want to convert html form datas to cakephp function acceptable format i.e $this-data(array)...
how to do this in javascript(jquery)
use heap sort to sort this in descending order and show the steps or explanation please
below is the tree
79
33 57
8 25 48
below is the array
79 - 33 - 57 - 8 - 25 - 48
I have a class that uses a lot of database internally, so I built the constructor with a $db handle that I am supposed to pass to it.
I am just getting started with PHPUnit, and I am not sure how I should go ahead and pass the database handle through setup.
public function setUp(/*do I pass a database handle through here, using a reference? aka &$db*/){
$this->_acl = new acl;
}
public function __construct(Zend_Db_Adapter_Abstract $db, $config = array()){
I've just started working on a photo viewer type desktop AIR app with Flex. From the main window I can launch sub-windows, but in these sub-windows I can't seem to access the data I collected in the main window.
How can I access this data?
Or, how can I send this data to the sub-window on creation? It doesn't need to be dynamically linked.
myMain.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="260" height="200"
title="myMain">
<fx:Declarations>
</fx:Declarations>
<fx:Script>
<![CDATA[
public function openWin():void {
new myWindow().open();
}
public var myData:Array = new Array('The Eiffel Tower','Paris','John Doe');
]]>
</fx:Script>
<s:Button x="10" y="10" width="240" label="open a sub-window" click="openWin();"/>
</s:WindowedApplication>
myWindow.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Window name="myWindow"
title="myWindow"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
width="640" height="360">
<mx:Script>
<![CDATA[
]]>
</mx:Script>
<mx:Label id="comment" x="10" y="10" text=""/>
<mx:Label id="location" x="10" y="30" text=""/>
<mx:Label id="author" x="10" y="50" text=""/>
</mx:Window>
I realize this might be a very easy question but I have searched the web, read and watched tutorials on random AIR subjects for a few days and couldn't find it. The risk of looking like a fool is worth it now, I want to get on with my first app!
Hi,
I have a NSArray of objects.
Those objects have an int attribute called "distance". I would like to sort my array by distance.
Could someone please tell me how to do that ? I can't understand how the sortUsingSelector or sortUsingDescriptor methods are working...
Thanks
I got this code and working fine
$access_token = $facebook->getAccessToken();
$vars = array(
'caption' => 'Caption message',
'message' => 'I need help',
'name' => 'I need Help',
'link' => 'http://www.google.com/',
'description' => 'description',
'picture' => ''
);
But I want to replace the message or the name in to like : " (name of user) Need Help...
I have a string:
[\n['-','some text what\rcontains\nnewlines'],\n\n
trying to parse:
Regex.Split(@"[\n['-','some text what contains newlines'],\n\n", @"\[\n\['(.*)','(.*)'],.*");
but the split return array seems to be null
i need to get part of text: "some text what contains newlines"
Running the instruments utility against the game I'm writing shows a bunch of memory leaks related to copy with Zone when I cycle through an array and draw some simple cube objects.
Im not sure the best way to track this down as I'm new to OpenGL programming. My program is using ARC and is set to build for IOS 5. I am initializing GLKit to use OPenGl 2.0 and using the BafeEffect so I don't have to write my own shaders etc.. This shouldn't be rocket science. Im guessing that I must be not releasing something within the draw function. Below is the code to my draw function. Could you guys take a look and see if anything stands out as the problem?
One other thing to note is that I'm using 15 different textures, the cubes can be 1 of 15 different ones. I have a property set on the cube class for the texture and I set it as I create the cube in there array. But I do load all 15 when my programs view did load starts.They are small .jps files that are less than 75k each and each cube uses the same texture all the way around so shouldn't be too big of an issue.
Here is the code to my draw function:
- (void)draw
{
GLKMatrix4 xRotationMatrix = GLKMatrix4MakeXRotation(rotation.x);
GLKMatrix4 yRotationMatrix = GLKMatrix4MakeYRotation(rotation.y);
GLKMatrix4 zRotationMatrix = GLKMatrix4MakeZRotation(rotation.z);
GLKMatrix4 scaleMatrix = GLKMatrix4MakeScale(scale.x, scale.y, scale.z);
GLKMatrix4 translateMatrix = GLKMatrix4MakeTranslation(position.x, position.y, position.z);
GLKMatrix4 modelMatrix = GLKMatrix4Multiply(translateMatrix,GLKMatrix4Multiply(scaleMatrix,GLKMatrix4Multiply(zRotationMatrix, GLKMatrix4Multiply(yRotationMatrix, xRotationMatrix))));
GLKMatrix4 viewMatrix = GLKMatrix4MakeLookAt(0, 0, 1, 0, 0, -5, 0, 1, 0);
effect.transform.modelviewMatrix = GLKMatrix4Multiply(viewMatrix, modelMatrix);
effect.transform.projectionMatrix = GLKMatrix4MakePerspective(0.125*M_TAU, 1.0, 2, 0);
effect.texture2d0.name = wallTexture.name;
[effect prepareToDraw];
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glEnableVertexAttribArray(GLKVertexAttribPosition);
glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, 0, triangleVertices);
glEnableVertexAttribArray(GLKVertexAttribTexCoord0);
glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinates);
glDrawArrays(GL_TRIANGLES, 0, 18);
glDisableVertexAttribArray(GLKVertexAttribPosition);
glDisableVertexAttribArray(GLKVertexAttribTexCoord0);
}
I am getting dynamic image in form of byte array. and i want to show that in webpage, preferably ImageControl
I am aware of method of creating http handler and getting image stream. but I cant do that here as logic for same is performed somewhere else.
Could not get any suitable way to do this.
Thank you in advance.
I've got two unmanaged C++ functions, Compress and Decompress. The arguments and returns go as followed:
unsigned char* Compress (unsigned char*,int)
unsigned char* Decompress (unsigned char*,int)
Where all uchars are arrays of uchars.
Could someone please help me lay out a way to convert these into managed C# code using the Byte[] array instead of unsigned char*? Thank you very much!
I want to combine two relative paths in C#.
For example:
string path1 = "/System/Configuration/Panels/Alpha";
string path2 = "Panels/Alpha/Data";
I want to return
string result = "/System/Configuration/Panels/Alpha/Data";
I can implement this by splitting the second array and compare it in a for loop but I was wondering if there is something similar to Path.Combine available or if this can be accomplished with regular expressions or Linq?
Thanks
In Java, is there a way (at runtime) to obtain the bytecode which defined a particular class?
Put another way, is there a way to obtain the byte[] array passed to ClassLoader.defineClass(String name, byte[] b, int off, int len) when a particular class was loaded? I see that this method is declared final, so creating a custom ClassLoader to intercept class definitions seems out of the question.
In the past, I have used the class's ClassLoader to obtain the bytecode via the getResourceAsStream(String) method, but I would prefer a more canonical solution.
Hi all,
I am learning Session function in CakePhp, and see some examples like this on cakePHP cookBook web site:
For example:
write($mysession1, 'testing')
I am not sure if a session can only hold up a particular thing in it.
Is it possible to write an array to a session like:
mysession[0] = 'Testing0';
mysession[1] = 'Testing1';
mysession[2] = 'Testing2';
Is there a way to specify the database engine to be used for fixtures in CakePHP test fixtures? Some of my models depend on database transactions, and I would like to write some tests for their correct behavior. Currently I'm simply auto-importing the schema, but the tables get created with MySQL's standard MyISAM engine, which doesn't support transactions.
class FooFixture extends CakeTestFixture {
public $name = 'Foo';
public $import = 'Foo';
public $records = array(...);
}
All examples I find on shuffling arrays are for NSMutableArrays. Copying an NSArray to an NSMutable array, shuffling, then copying back always crashes the application. Is it even possible to shuffle an NSArray?
Anything in objective-c similar to Collections.shuffle() (Java)?
I have an embedded form with a choice widget. I'm trying to pass a default value from the main form to the widget. I'm trying to pass the value to the form as an option, then once I have it in the embedded form do I just do something like:
new sfwidgetformchoice(array(...,'default' => $this->getOption('default'))
doesn't seem to work
Have a question about Android "android.graphics.Path", I know how to create a Path from a set points as float[], but could not find anyway to get back the array from the Path object. Is it possible? Thanks in advance.
I'm still very new to codeigniter. The issue i'm having is that the file uploads fine and it writes to the database without issue but it just doesn't return me to the upload form. Instead it stays in the do_upload and doesn't display anything. Even more bizarrely there is some source code behind the scenes. Can someone tell my what it is i'm doing wrong because I want to be returning to my upload form after submission. Thanks in advance. Below is my code:
Controller:
function do_upload()
{
if($this->Upload_model->do_upload())
{
$this->load->view('home/upload_form');
}else{
$this->load->view('home/upload_success', $error);
}
}
Model:
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2000';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
return $error;
}
else
{
$data = $this->upload->data();
$full_path = 'uploads/' . $data['file_name'];
$spam = array(
'image_url' => $full_path,
'url' => $this->input->post('url')
);
$id = $this->input->post('id');
$this->db->where('id', $id);
$this->db->update('NavItemData', $spam);
return true;
}
}
View (called upload_form):
<html>
<head>
<title>Upload Form</title>
</head>
<body>
<?php if(isset($buttons)) : foreach($buttons as $row) : ?>
<h2><?php echo $row->image_url; ?></h2>
<p><?php echo $row->url; ?></p>
<p><?php echo $row->name; ?></p>
<p><?php echo anchor("upload/update_nav/$row->id", 'edit'); ?></p>
<?php endforeach; ?>
<?php endif; ?>
</body>
</html>
Why can't I do like this?
[Required(ErrorMessage = "*")]
[RegularExpression("^[a-zA-Z0-9_]*$", ErrorMessage = Resources.RegistrationModel.UsernameError)]
public string Username { get; set; }
What is the error message telling me?
An attribute argument must be a
constant expression , typeof
expression or array creation
expression of an attribute parameter
type.
Hi,
I am looking for ways to implement custom user-roles in windows application with vb.net. I got a database table called Roles with Administrator and User entries. User cannot see some of the form data. In ASP.NET MVC we can do like.
[Authorize(Roles = "Administrator")]
public function GetAccount() as Array
End Function
If it could be done this way that would be great.
Thanks in advance.
When dealing with cell arrays, I can use the deal() function to assign cells to output variables, such as:
[a, b, c] = deal(myCell{:});
or just:
[a, b, c] = myCell{:};
I would like to do the same thing for a simple array, such as:
myArray = [1, 2, 3];
[a, b, c] = deal(myArray(:));
But this doesn't work. What's the alternative?
It says here that
The unbounded array is similar to a
std::vector in that in can grow in
size beyond any fixed bound. However
unbounded_array is aimed at optimal
performance. Therefore unbounded_array
does not model a Sequence like
std::vector does.
What does this mean?