Search Results

Search found 1309 results on 53 pages for 'dr dork'.

Page 7/53 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • C# ASP.NET Binding Controls via Generic Method

    - by OverTech
    I have a few web applications that I maintain and I find myself very often writing the same block of code over and over again to bind a GridView to a data source. I'm trying to create a Generic method to handle data binding but I'm having trouble getting it to work with Repeaters and DataLists. Here is the Generic method I have so far: public void BindControl<T>(T control, SqlCommand sql) where T : System.Web.UI.WebControls.BaseDataBoundControl { cmd = sql; cn.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { control.DataSource = dr; control.DataBind(); } dr.Close(); cn.Close(); } That way I can just define my CommandText then make a call to "BindControls(myGridView, cmd)" instead of retyping this same basic block of code every time I need to bind a grid. The problem is, this doesn't work with Repeaters or DataLists. Each of these controls inherit their respective "DataSource" and "DataBind" methods from different classes. Someone on another forum suggested that I implement an interface, but I'm not sure how to make that work either. The GridView, Datalist and Repeater get their respective "DataBind" methods from BaseDataBoundControl, BaseDataList, and Repeater classes. How would I go about creating a single interface to tie them all together? Or am I better off just using 3 overloads for this method? Dave

    Read the article

  • Pump Messages During Long Operations + C# (it is urgent)

    - by Newbie
    Hi I have a web service that is doing huge computation and is taking more than a minute. I have generated the proxy file of the web service and then from my client end I am using the dll(of course I generated the proxy dll). My client side code is TimeSeries3D t = new TimeSeries3D(); int portfolioId = 4387919; string[] str = new string[2]; str[0] = "MKT_CAP"; DateRange dr = new DateRange(); dr.mStartDate = DateTime.Today; dr.mEndDate = DateTime.Today; Service1 sc = new Service1(); t = sc.GetAttributesForPortfolio(portfolioId, true, str, dr); But since it is taking to much time for the server to compute, after 1 minute I am receiving an error message The CLR has been unable to transition from COM context 0x33caf30 to COM context 0x33cb0a0 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations. Kindly guide me what to do? It is very urgent. Thanks

    Read the article

  • insert data to table based on another table C#

    - by user1017315
    I wrote a code which takes some values from one table and inserts the other table in these values.(not just these values, but also these values(this values=values from the based on table)) and I get this error: System.Data.OleDb.OleDbException (0x80040E10): value wan't given for one or more of the required parameters.` here's the code. I don't know what i've missed. string selectedItem = comboBox1.SelectedItem.ToString(); Codons cdn = new Codons(selectedItem); string codon1; int index; if (this.i != this.counter) { //take from the DataBase the matching codonsCodon1 to codonsFullName codon1 = cdn.GetCodon1(); //take the serialnumber of the last protein string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=C:\\Projects_2012\\Project_Noam\\Access\\myProject.accdb"; OleDbConnection conn = new OleDbConnection(connectionString); conn.Open(); string last= "SELECT proInfoSerialNum FROM tblProInfo WHERE proInfoScienceName = "+this.name ; OleDbCommand getSerial = new OleDbCommand(last, conn); OleDbDataReader dr = getSerial.ExecuteReader(); dr.Read(); index = dr.GetInt32(0); //add the amino acid to tblOrderAA using (OleDbConnection connection = new OleDbConnection(connectionString)) { string insertCommand = "INSERT INTO tblOrderAA(orderAASerialPro, orderAACodon1) " + " values (?, ?)"; using (OleDbCommand command = new OleDbCommand(insertCommand, connection)) { connection.Open(); command.Parameters.AddWithValue("orderAASerialPro", index); command.Parameters.AddWithValue("orderAACodon1", codon1); command.ExecuteNonQuery(); } } } EDIT:I put a messagebox after that line: index = dr.GetInt32(0); to see where is the problem, and i get the error before that.i don't see the messagebox

    Read the article

  • Pump Messages During Long Operations + C#

    - by Newbie
    Hi I have a web service that is doing huge computation and is taking more than a minute. I have generated the proxy file of the web service and then from my client end I am using the dll(of course I generated the proxy dll). My client side code is TimeSeries3D t = new TimeSeries3D(); int portfolioId = 4387919; string[] str = new string[2]; str[0] = "MKT_CAP"; DateRange dr = new DateRange(); dr.mStartDate = DateTime.Today; dr.mEndDate = DateTime.Today; Service1 sc = new Service1(); t = sc.GetAttributesForPortfolio(portfolioId, true, str, dr); But since it is taking to much time for the server to compute, after 1 minute I am receiving an error message The CLR has been unable to transition from COM context 0x33caf30 to COM context 0x33cb0a0 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations. Kindly guide me what to do? Thanks

    Read the article

  • How do I access Dictionary items?

    - by salvationishere
    I am developing a C# VS2008 / SQL Server website app and am new to the Dictionary class. Can you please advise on best method of accomplishing this? Here is a code snippet: SqlConnection conn2 = new SqlConnection(connString); SqlCommand cmd = conn2.CreateCommand(); cmd.CommandText = "dbo.AppendDataCT"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = conn2; SqlParameter p1, p2, p3; foreach (string s in dt.Rows[1].ItemArray) { DataRow dr = dt.Rows[1]; // second row p1 = cmd.Parameters.AddWithValue((string)dic[0], (string)dr[0]); p1.SqlDbType = SqlDbType.VarChar; p2 = cmd.Parameters.AddWithValue((string)dic[1], (string)dr[1]); p2.SqlDbType = SqlDbType.VarChar; p3 = cmd.Parameters.AddWithValue((string)dic[2], (string)dr[2]); p3.SqlDbType = SqlDbType.VarChar; } but this is giving me compiler error: The best overloaded method match for 'System.Collections.Generic.Dictionary<string,string>.this[string]' has some invalid arguments I just want to access each value from "dic" and load into these SQL parameters. How do I do this? Do I have to enter the key? The keys are named "col1", "col2", etc., so not the most user-friendly. Any other tips? Thanks!

    Read the article

  • How to load the SQL data into several ComboBox easily, am i doing the correctly or is there another way

    - by Dominic Deepan.d
    I have a Combobox to fill the data for City, State and PinCode these combobox is dopdown list and the user will pick it. and it loads once the form opens. Here is the CODE: /// CODE TO BRING A DATA FROM SQL INTO THE FORM DROP LIST /// To fill the sates from States Table cn = new SqlConnection(@"Data Source=Nick-PC\SQLEXPRESS;Initial Catalog=AutoDB;Integrated Security=True"); cmd= new SqlCommand("select * from TblState",cn); cn.Open(); SqlDataReader dr; try { dr = cmd.ExecuteReader(); while (dr.Read()) { SelectState.Items.Add(dr["State"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { cn.Close(); } //To fill the Cities from City Table cn1 = new SqlConnection(@"Data Source=Nick-PC\SQLEXPRESS;Initial Catalog=AutoDB;Integrated Security=True"); cmd1 = new SqlCommand("SELECT * FROM TblCity", cn); cn.Open(); SqlDataReader ds; try { ds = cmd1.ExecuteReader(); while (ds.Read()) { SelectCity.Items.Add(ds["City"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { cn1.Close(); } // To fill the Data in the Pincode from the City Table cn2 = new SqlConnection(@"Data Source=Nick-PC\SQLEXPRESS;Initial Catalog=AutoDB;Integrated Security=True"); cmd2 = new SqlCommand("SELECT (Pincode) FROM TblCity ", cn2); cn2.Open(); SqlDataReader dm; try { dm = cmd2.ExecuteReader(); while (dm.Read()) { SelectPinCode.Items.Add(dm["Pincode"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { cn2.Close(); } its kinda Big, i am doing the same steps for all the combo-box, but is there a way i can merge it in a simple way.

    Read the article

  • In an iPad SplitView, how do I add a Date Picker control to the Root View?

    - by Dr Dork
    I'm diving into iPhone OS development on the iPad and one of the things I'm playing with is the SplitView template. The template provides a window with a UISplitView view, containing the Root View (on the left of the window) and the Detail View (on the right of the window). The Root View is a subclass of a TableView. Rather than having the entire Root View consist of a TableView, I'd like it to contain a DatePicker view along with the TableView under it. When I go into IB and try and drop a DatePicker into the Root View, it won't let me. It will only let me add a DatePicker view to the Detail View. Why wont IB let me drop a DatePicker view into the Root View? How can I add a DatePicker to the RootView in addition to the TableView? I'm still learning this new platform, so I apologize if these questions are absurd in any way. Thanks so much in advance for your help, I'm going to continue researching these questions right now.

    Read the article

  • In the Xcode SplitView template for an iPad app, how do I add a Date Picker control to the Root View

    - by Dr Dork
    I'm diving into iPhone OS development on the iPad and one of the things I'm playing with is the SplitView template. The template provides a window with a UISplitView view, containing the Root View (on the left of the window) and the Detail View (on the right of the window). The Root View is a subclass of a TableView. Rather than having the entire Root View consist of a TableView, I'd like it to contain a DatePicker view along with the TableView under it. When I go into IB and try and drop a DatePicker into the Root View, it won't let me. It will only let me add a DatePicker view to the Detail View. Why wont IB let me drop a DatePicker view into the Root View? How can I add a DatePicker to the RootView in addition to the TableView? I'm still learning this new platform, so I apologize if these questions are absurd in any way. Thanks so much in advance for your help, I'm going to continue researching these questions right now.

    Read the article

  • Complete list of tools and technologies that make up a solid ASP.NET MVC 2 development environment f

    - by Dr Dork
    This question is related to another wiki I found on SO, but I'd like to develop a more comprehensive example of an automated ASP MVC 2 development environment that can be used to develop and deploy a wide range of small-scale websites by beginners. As far as characteristics of the dev environment go, I'd like to focus on beginner-friendly over powerful since the other wiki focuses more on advanced, powerful setups. This information is targeted for beginners (that already know C# and understand web dev concepts) that have selected... ASP.NET MVC 2 as their dev framework Visual Studio 2010 Pro (or 2008 Pro SP1) as their IDE Windows 7 as their OS and are looking for a quick and easy-to-setup environment that covers managing, building, testing, tracking, and deploying their website with as much automation as possible. A system that can be used for becoming familiar with the whole process, as well as a launching point for exploring other, more custom and powerful systems. Since we've already selected the Compiler, Framework, and OS, I'd like to develop ideas for... Code editor (unless you feel VS will suffice for all areas of code) Database and related tools Unit testing (VS?) Continuous integration build system (VS?) Project Planning Issue tracking Deployment (VS?) Source management (VS?) ASP, C#, VS, and related blogs that beginners can follow Any other categories I'm probably missing Since we're already using Visual Studio, I'd like to focus on the out-of-the-box solutions and features built into Visual Studio, unless you feel there are better solutions that work well with VS and are easier to use than the features built directly into VS. Thanks so much in advance for your wisdom!

    Read the article

  • Why does Xcode launch the iPhone simulator when the iPad simulator is selected?

    - by Dr Dork
    When I open an existing iPad project in Xcode and "Build and Run" it, it launches the iPhone simulator when I have the iPad Simulator set as the active executable? Inside the iPhone simulator is a shrunken version of the iPad. What is going on? How do I get it to run the iPad simulator? Note: When the iPhone Simulator is running, I double checked the Hardware-Device setting and it's set to iPad. This is what I want, of course, but I don't want it to run the iPhone simulator. I seem to recall it used to run an iPad simulator. Is there such a thing or am I tripping and there is only an iPhone simulator that can run iPad apps? Thanks in advance for your help!

    Read the article

  • What iPhone OS APIs could I use to implement a transition animation similar to the iBook page flip t

    - by Dr Dork
    I'm building an iPad app that will have multiple paper pages and I'd like to implement a page transition affect that is similar to the animation you see when you turn pages in the iBooks app on the iPad. A few questions... Is that animation readily available somewhere in the UIKit API or would I have to implement it myself? If I have to implement it myself, what's a good approach or API I should look into? It definitely has a 3d feel to it, could they be using the OpenGL ES API for that? Thanks in advance for all your help, I'm going to start researching these questions right now.

    Read the article

  • Good ways to dynamically generate the start image of an iPhone/iPad app

    - by Dr Dork
    I'm self-learning iPhone development and I see that one of the aspects of an iPhone/iPad app is the start image that gets displayed when your app is run. I'd like my start image to display some basic info about the user when the app is launched, but that info has to first be collected by the user when the app is first run. That tells me that I either need to dynamically generate the start image after the user enters their information or I need to place a label of some sort on top of my static start image in order to accomplish this. The first time the app launched and before the user enters their info, the start image can be anything or nothing at all, I'm not concerned about this. So, my two questions are this... Can you place controls, like a label, on top of the start image when your app is launched? If not, what's a good approach to dynamically generating the start image after the app is launched for the first time and the user info is collected? Thanks so much in advance for your help! I'm going to begin researching this question right now.

    Read the article

  • In the iPad SplitView template, where's the code that specifies which views are to be used in the Sp

    - by Dr Dork
    In the iPad Programming Guide, it gives the following code example for specifying the two views (firstVC and secondVC) that will be used in the SplitView... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { MyFirstViewController* firstVC = [[[MyFirstViewController alloc] initWithNibName:@"FirstNib" bundle:nil] autorelease]; MySecondViewController* secondVC = [[[MySecondViewController alloc] initWithNibName:@"SecondNib" bundle:nil] autorelease]; UISplitViewController* splitVC = [[UISplitViewController alloc] init]; splitVC.viewControllers = [NSArray arrayWithObjects:firstVC, secondVC, nil]; [window addSubview:splitVC.view]; [window makeKeyAndVisible]; return YES; } but when I actually create a new SplitView project in Xcode, I don't see any code that specifies which views should be added to the SplitView. Here's the code from the SplitView template... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after app launch rootViewController.managedObjectContext = self.managedObjectContext; // Add the split view controller's view to the window and display. [window addSubview:splitViewController.view]; [window makeKeyAndVisible]; return YES; } Thanks in advance for all your help! I'm going to continue researching this question right now.

    Read the article

  • edit row in gridview

    - by user576998
    Hi.I would like to help me with my code. I have 2 gridviews. In the first gridview the user can choose with a checkbox every row he wants. These rows are transfered in the second gridview. All these my code does them well.Now, I want to edit the quantity column in second gridview to change the value but i don't know what i must write in edit box. Here is my code: using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections; public partial class ShowLand : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindPrimaryGrid(); BindSecondaryGrid(); } } private void BindPrimaryGrid() { string constr = ConfigurationManager.ConnectionStrings["conString"].ConnectionString; string query = "select * from Land"; SqlConnection con = new SqlConnection(constr); SqlDataAdapter sda = new SqlDataAdapter(query, con); DataTable dt = new DataTable(); sda.Fill(dt); gridview2.DataSource = dt; gridview2.DataBind(); } private void GetData() { DataTable dt; if (ViewState["SelectedRecords1"] != null) dt = (DataTable)ViewState["SelectedRecords1"]; else dt = CreateDataTable(); CheckBox chkAll = (CheckBox)gridview2.HeaderRow .Cells[0].FindControl("chkAll"); for (int i = 0; i < gridview2.Rows.Count; i++) { if (chkAll.Checked) { dt = AddRow(gridview2.Rows[i], dt); } else { CheckBox chk = (CheckBox)gridview2.Rows[i] .Cells[0].FindControl("chk"); if (chk.Checked) { dt = AddRow(gridview2.Rows[i], dt); } else { dt = RemoveRow(gridview2.Rows[i], dt); } } } ViewState["SelectedRecords1"] = dt; } private void SetData() { CheckBox chkAll = (CheckBox)gridview2.HeaderRow.Cells[0].FindControl("chkAll"); chkAll.Checked = true; if (ViewState["SelectedRecords1"] != null) { DataTable dt = (DataTable)ViewState["SelectedRecords1"]; for (int i = 0; i < gridview2.Rows.Count; i++) { CheckBox chk = (CheckBox)gridview2.Rows[i].Cells[0].FindControl("chk"); if (chk != null) { DataRow[] dr = dt.Select("id = '" + gridview2.Rows[i].Cells[1].Text + "'"); chk.Checked = dr.Length > 0; if (!chk.Checked) { chkAll.Checked = false; } } } } } private DataTable CreateDataTable() { DataTable dt = new DataTable(); dt.Columns.Add("id"); dt.Columns.Add("name"); dt.Columns.Add("price"); dt.Columns.Add("quantity"); dt.Columns.Add("total"); dt.AcceptChanges(); return dt; } private DataTable AddRow(GridViewRow gvRow, DataTable dt) { DataRow[] dr = dt.Select("id = '" + gvRow.Cells[1].Text + "'"); if (dr.Length <= 0) { dt.Rows.Add(); dt.Rows[dt.Rows.Count - 1]["id"] = gvRow.Cells[1].Text; dt.Rows[dt.Rows.Count - 1]["name"] = gvRow.Cells[2].Text; dt.Rows[dt.Rows.Count - 1]["price"] = gvRow.Cells[3].Text; dt.Rows[dt.Rows.Count - 1]["quantity"] = gvRow.Cells[4].Text; dt.Rows[dt.Rows.Count - 1]["total"] = gvRow.Cells[5].Text; dt.AcceptChanges(); } return dt; } private DataTable RemoveRow(GridViewRow gvRow, DataTable dt) { DataRow[] dr = dt.Select("id = '" + gvRow.Cells[1].Text + "'"); if (dr.Length > 0) { dt.Rows.Remove(dr[0]); dt.AcceptChanges(); } return dt; } protected void CheckBox_CheckChanged(object sender, EventArgs e) { GetData(); SetData(); BindSecondaryGrid(); } private void BindSecondaryGrid() { DataTable dt = (DataTable)ViewState["SelectedRecords1"]; gridview3.DataSource = dt; gridview3.DataBind(); } } and the source code is <asp:GridView ID="gridview2" runat="server" AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource5"> <Columns> <asp:TemplateField> <HeaderTemplate> <asp:CheckBox ID="chkAll" runat="server" onclick = "checkAll(this);" AutoPostBack = "true" OnCheckedChanged = "CheckBox_CheckChanged"/> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chk" runat="server" onclick = "Check_Click(this)" AutoPostBack = "true" OnCheckedChanged = "CheckBox_CheckChanged" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="id" /> <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" /> <asp:BoundField DataField="price" HeaderText="price" SortExpression="price" /> <asp:BoundField DataField="quantity" HeaderText="quantity" SortExpression="quantity" /> <asp:BoundField DataField="total" HeaderText="total" SortExpression="total" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Land]"></asp:SqlDataSource> <br /> </div> <div> <asp:GridView ID="gridview3" runat="server" AutoGenerateColumns = "False" DataKeyNames="id" EmptyDataText = "No Records Selected" > <Columns> <asp:BoundField DataField = "id" HeaderText = "id" /> <asp:BoundField DataField = "name" HeaderText = "name" ReadOnly="True" /> <asp:BoundField DataField = "price" HeaderText = "price" DataFormatString="{0:c}" ReadOnly="True" /> <asp:TemplateField HeaderText="quantity"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("quantity")%>'</asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("quantity") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField = "total" HeaderText = "total" DataFormatString="{0:c}" ReadOnly="True" /> <asp:CommandField ShowEditButton="True" /> </Columns> </asp:GridView> <asp:Label ID="totalLabel" runat="server"></asp:Label> <br /> </div> </form> </body> </html>

    Read the article

  • Why can't I create a database in an empty ASP MVC 2 project using Project->Add->New Item->SQL Server

    - by Dr Dork
    I'm diving head first into ASP MVC and am playing around with creating and manipulating a database. I did a search and found this tutorial for creating a database, however when I follow it, I get this error when trying to add a new database to my fresh, empty ASP MVC 2 project... A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) The only requirement the tutorial mentioned was SQL Server Express, but when I went to download it, it said it was already installed. I'm assuming it was part of the VS 2010 RC I installed and am running. So I don't know what else I need if I am missing something. This is all new to me, so I'm sure I'm missing something obvious here and after I'm done posting this question, I plan to do some more research into the topic of databases and how they work with ASP MVC. In the meantime, I was you could help me answer a couple high level questions... What am I missing/forgetting to do that is causing this error? Any suggestions for good resources/tutorials that focus on using databases with ASP MVC? I've done a lot of database programming in the past, so I'm familiar with the concepts of relational databases and the SQL language. I wish I could find a good resource for learning how to work with them in an ASP dev environment, as well as a good breakdown of all the related technologies used for working with them (i.e. LINQ to SQL). Thanks so much in advance for all your help! I'm going to start researching these questions right now.

    Read the article

  • How do I add a custom view to iPhone app's UI?

    - by Dr Dork
    I'm diving into iPad development and I'm still learning how everything works together. I understand how to add standard view (i.e. buttons, tableviews, datepicker, etc.) to my UI using both Xcode and Interface Builder, but now I'm trying to add a custom calendar control (TapkuLibrary) to the left window in my UISplitView application. My question is, if I have a custom view (in this case, the TKCalendarMonthView), how do I programmatically add it to one of the views in my UI (in this case, the RootViewController)? Below are some relevant code snippets from my project... RootViewController interface @interface RootViewController : UITableViewController <NSFetchedResultsControllerDelegate> { DetailViewController *detailViewController; NSFetchedResultsController *fetchedResultsController; NSManagedObjectContext *managedObjectContext; } @property (nonatomic, retain) IBOutlet DetailViewController *detailViewController; @property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController; @property (nonatomic, retain) NSManagedObjectContext *managedObjectContext; - (void)insertNewObject:(id)sender; TKCalendarMonthView interface @class TKMonthGridView,TKCalendarDayView; @protocol TKCalendarMonthViewDelegate, TKCalendarMonthViewDataSource; @interface TKCalendarMonthView : UIView { id <TKCalendarMonthViewDelegate> delegate; id <TKCalendarMonthViewDataSource> dataSource; NSDate *currentMonth; NSDate *selectedMonth; NSMutableArray *deck; UIButton *left; NSString *monthYear; UIButton *right; UIImageView *shadow; UIScrollView *scrollView; } @property (readonly,nonatomic) NSString *monthYear; @property (readonly,nonatomic) NSDate *monthDate; @property (assign,nonatomic) id <TKCalendarMonthViewDataSource> dataSource; @property (assign,nonatomic) id <TKCalendarMonthViewDelegate> delegate; - (id) init; - (void) reload; - (void) selectDate:(NSDate *)date; Thanks in advance for all your help! I still have a ton to learn, so I apologize if the question is absurd in any way. I'm going to continue researching this question right now!

    Read the article

  • What are some programming techniques for converting SD images to HD images

    - by Dr Dork
    I'm taking programming class and instructor loves to work with images so most of our assignments involve manipulating raw RGB image data. One of our assignments is to implement a standard image converter that converts SD images to HD images and vice versa. I always take advantage of these types of assignments to go a little beyond what we were asked to do, so I added a basic anti-aliasing process that uses the average pixel color of the 3x3 surrounding pixels to improve the converted image. While it helps a bit, the resulting image still doesn't look good, which is ok because it's not expected to for the assignment. I've learned that converting an SD to HD images has shown to be much harder than down sampling to SD from HD just because SD to HD effectively involves increasing resolution when it is not there. Obviously, it is hard to create pixels from nothing, but I'd like enhance my anti-aliasing to something that provides better results when upscaling an image. Most of the techniques I find and read on the internet are far beyond my level of image processing and programming. Can anybody suggest any better methods or processes to create good HD content from SD content that may be within my programming skill level? I know that's a difficult thing to gauge since you don't know me, but perhaps knowing that I can write c++ code to read in raw RGB data and upscale/downscale it with simple average-anti-aliasing will give you an idea. Thanks in advance for all your help!

    Read the article

  • Any socket programmers out there? How can I obtain the IPv4 address of the client?

    - by Dr Dork
    Hello! I'm prepping for a simple work project and am trying to familiarize myself with the basics of socket programming in a Unix dev environment. At this point, I have some basic server side code setup to listen for incoming TCP connection requests from clients after the parent socket has been created and is set to listen... int sockfd, newfd; unsigned int len; socklen_t sin_size; char msg[]="Test message sent"; char buf[MAXLEN]; int st, rv; struct addrinfo hints, *serverinfo, *p; struct sockaddr_storage client; char ip[INET6_ADDRSTRLEN]; . . //parent socket creation and listen code omitted for simplicity . //wait for connection requests from clients while(1) { //Returns the socketID and address of client connecting to socket if( ( newfd = accept(sockfd, (struct sockaddr *)&client, &len) ) == -1 ){ perror("Accept"); exit(-1); } if( (rv = recv(newfd, buf, MAXLEN-1, 0 )) == -1) { perror("Recv"); exit(-1); } struct sockaddr_in *clientAddr = ( struct sockaddr_in *) get_in_addr((struct sockaddr *)&client); inet_ntop(client.ss_family, clientAddr, ip, sizeof ip); printf("Receive from %s: query type is %s\n", ip, buf); if( ( st = send(newfd, msg, strlen(msg), 0)) == -1 ) { perror("Send"); exit(-1); } //ntohs is used to avoid big-endian and little endian compatibility issues printf("Send %d byte to port %d\n", ntohs(clientAddr->sin_port) ); close(newfd); } } I found the get_in_addr function online and placed it at the top of my code and use it to obtain the IP address of the client connecting... // get sockaddr, IPv4 or IPv6: void *get_in_addr(struct sockaddr *sa) { if (sa->sa_family == AF_INET) { return &(((struct sockaddr_in*)sa)->sin_addr); } return &(((struct sockaddr_in6*)sa)->sin6_addr); } but the function always returns the IPv6 IP address since thats what the sa_family property is set as. My question is, is the IPv4 IP address stored anywhere in the data I'm using and, if so, how can I access it? Thanks so much in advance for all your help!

    Read the article

  • Could my iPad app be denied from the app store for using the Tapku library?

    - by Dr Dork
    I'd like to use the Tapku library to add a calander date picker control to my iPad app. I'm new to iPhone OS development and I'm still rusty on identifying the 3rd party tools and code that will get my iPad app denied from the app store. For those that have used the Tapku library, would using it in my iPad app violate any app store rules? Thanks so much in advance for your help. I'm going to continue researching this question right now.

    Read the article

  • How can I obtain the local TCP port and IP Address of my client program?

    - by Dr Dork
    Hello! I'm prepping for a simple work project and am trying to familiarize myself with the basics of socket programming in a Unix dev environment. At this point, I have some basic server side code and client side code setup to communicate. Currently, my client code successfully connects to the server code and the server code sends it a test message, then both quit out. Perfect! That's exactly what I wanted to accomplish. Now I'm playing around with the functions used to obtain info about the two environments (server and client). I'd like to obtain the local IP address and dynamically assigned TCP port of the client. The function I've found to do this is getsockname()... //setup the socket if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { perror("client: socket"); continue; } //Retrieve the locally-bound name of the specified socket and store it in the sockaddr structure sa_len = sizeof(sa); getsock_check = getsockname(sockfd,(struct sockaddr *)&sa,(socklen_t *)&sa_len) ; if (getsock_check== -1) { perror("getsockname"); exit(1); } printf("Local IP address is: %s\n", inet_ntoa(sa.sin_addr)); printf("Local port is: %d\n", (int) ntohs(sa.sin_port)); but the output is always zero... Local IP address is: 0.0.0.0 Local port is: 0 does anyone see anything I might be or am definitely doing wrong? Thanks so much in advance for all your help!

    Read the article

  • Best way to display a background with a pattern in an iPhone/iPad app

    - by Dr Dork
    Here's an example of the type of background image I'm talking about... Clearly, there's a pattern in it. My question is, if this were an iPad app and the background image was twice the size, would there be any significant benefits to taking advantage of this pattern by tiling the image? Or would it really make no difference in terms of performance and just be easier to load the entire image into a UIImageView? Thanks in advance for all your wisdom!

    Read the article

  • How can I replace a UITableViewController with a UIViewController that contains a UITableView?

    - by Dr Dork
    I created a new SplitView iPad project in Xcode and setup the code to populate the TableView (in the RootView on the left) with data. Now I'd like to customize the RootView to contain a DatePicker view along with the TableView, but I'm unsure how to accomplish this. Since the default RootViewController is a subclass of a UITableViewController, I couldn't add a DatePicker view to it in IB (since you can't add a DatePicker to a UITableView). The only way I understand to accomplish my goal of adding a DatePicker to the "Left" RootView is to change the RootViewController from a subclass of a UITableViewController to a subclass of a UIViewController, then I'll be able to add a view to it that contains a DatePicker view and a TableView using IB. Questions... Is this the correct approach to add a DatePicker to the "Left" RootView? If so and I change the RootViewController to a subclass of a UIViewController (instead of a UITableViewController) and add to it a TableView (along with the DatePicker), how will that affect the code I currently have in place for populating my current TableView? Thanks so much for all your help! Below is my current interface code for my RootViewController, if it'll help any. @interface RootViewController : UITableViewController <NSFetchedResultsControllerDelegate> { DetailViewController *detailViewController; NSFetchedResultsController *fetchedResultsController; NSManagedObjectContext *managedObjectContext; } @property (nonatomic, retain) IBOutlet DetailViewController *detailViewController; @property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController; @property (nonatomic, retain) NSManagedObjectContext *managedObjectContext; - (void)insertNewObject:(id)sender; @end

    Read the article

  • Why doesn't the SplitView iPhone template have a nib file for the RootView?

    - by Dr Dork
    I'm diving into iPad development and am learning a lot quickly, but everywhere I look, I have questions. After creating a new SplitView app in Xcode using the template, it generates the AppDelegate class, RootViewController class, and DetailViewController class. Along with that, it creates a .xib files for MainWinow.xib and DetailView.xib. How do these five files work together? Why is there a nib file for the DetailView, but not the RootView? When I double click on the MainWindow.xib file, Interface Builder launches without a "View" window, why? Below is the code for didFinishLaunchingWithOptions method inside the AppDelegate class. Why are we adding the splitViewController as a subview? (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after app launch rootViewController.managedObjectContext = self.managedObjectContext; // Add the split view controller's view to the window and display. [window addSubview:splitViewController.view]; [window makeKeyAndVisible]; return YES; } Thanks so much in advance for all your help! I still have a lot to learn, so I apologize if this question is absurd in any way. I'm going to continue researching these questions right now!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >