Search Results

Search found 288 results on 12 pages for 'sergio tapia'.

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

  • Database design - How can I have a foreign key of the primary key in the same table?

    - by Sergio Tapia
    My database has to store all the available departments in my company. Some departments are sub-departments on another existing department. I've decided to solve this like this: Departments ID Description HeadOfDepartment ParentDepartment ParentDepartment can be null, indicating it is a root department. If it has a parent I'll act accordingly, my question is how can I code this in Microsoft SQL?

    Read the article

  • Where can an absolute beginner of Kohana PHP go to learn how to use it from the ground up?

    - by Sergio Tapia
    Hi guys! I have a month of free time and I've decided to launch my own website. It's going to be big and have dymanic content where different users with different roles can perform modifications to the site. Place comments, rate stores, list items, etc. This sound like a perfect opportunity for me to expand my horizons and learn a PHP Framework. I've used PHP bare bones before but nothing too complex. As of now, do you think Kohana is a mature framework to use? I've used Zend in the past for a course in Uni but it sucked horribly, I was new to the MVC model, but Zend had pretty much zero workable tutorials and guides for newbies. That's why I hated it. Where can I go to learn how to use Kohana from a retarded starting point? Thank you very much for your time.

    Read the article

  • How can I check if a user has written his username and password correctly?

    - by Sergio Tapia
    I'm using a Linq-to-SQL class called Scans.dbml. In that class I've dragged a table called Users (username, password, role) onto the graphic area and now I can access User object via a UserRepository class: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Scanner.Classes { public class UserRepository { private ScansDataContext db = new ScansDataContext(); public User getUser(string username) { return db.Users.SingleOrDefault(x => x.username == username); } public bool exists(string username) { } } } Now in my Login form, I want to use this Linq-to-SQL goodness to do all the data related activities. UserRepository users = new UserRepository(); private void btnLogin_Click(object sender, EventArgs e) { loginToSystem(); } private void loginToSystem() { if (users.getUser(txtUsername.Text)) { } //If txtUsername exists && User.password == Salt(txtPassword) //then Show.MainForm() with User.accountType in constructor to set permissions. } I need help with verifying that a user exists && that that users.password is equal to SALT(txtpassword.text). Any guidance please?

    Read the article

  • Why is this variable declared as private and also readonly?

    - by Sergio Tapia
    In the following code: public class MovieRepository : IMovieRepository { private readonly IHtmlDownloader _downloader; public MovieRepository(IHtmlDownloader downloader) { _downloader = downloader; } public Movie FindMovieById(string id) { var idUri = ...build URI...; var html = _downloader.DownloadHtml(idUri); return ...parse ID HTML...; } public Movie FindMovieByTitle(string title) { var titleUri = ...build URI...; var html = _downloader.DownloadHtml(titleUri); return ...parse title HTML...; } } I asked for something to review my code, and someone suggested this approach. My question is why is the IHtmlDownloader variable readonly?

    Read the article

  • How can I create a small relational database in MySQL?

    - by Sergio Tapia
    I need to make a small database in MySQL that has two tables. Clothes and ClotheType Clothes has: ID, Name, Color, Brand, Price, ClotheTypeID ClotheType has: ID, Description In Microsoft SQL it would be: create table Clothes( id int, primary key(id), name varchar(200), color varchar(200), brand varchar(200), price varchar(200), clothetypeid int, foreign key clothetypeid references ClotheType(id) ) I need this in MySQL.

    Read the article

  • Design review - do you think I'm doing this the right way? First commercial project for me!

    - by Sergio Tapia
    I'm tasked with designing an application that will allow a person to scan a legal document, save that associated with a Name and save it to a database. Now, inside of the Organization, there are many departments, and each department can have many sub departments. Problem lies in that some larger organizations will have many departments and smallers ones will only have 1 or two. I've though about creating a Department table and a Supdepartment table to create associations, etc. That way it's extensible and users can dynamically create departments to fit my program to their organizational scheme. Am I approaching this the right way? As I said, this is my first commercial application so I want to do it right and set a name for myself for delivering things on time and good code for other to expand upon.

    Read the article

  • What is the recommended way to handle different user roles in a C# application?

    - by Sergio Tapia
    I'm going to make a small application for a business that will be used locally for scanning, and storing documents in a database located on the local machine or on a machine located in the same LAN. I could create a table called Users with username and password and according to the usertype ID show a form, or another form. But I'm more interested in the recommended approach by seasoned programmers. Any advice?

    Read the article

  • How can I bind a simple Javascript array to an MVC3 controller action method?

    - by Sergio Tapia
    Here is the javascript code I use to create the array and send it on it's way: <script type="text/javascript" language="javascript"> $(document).ready(function () { $("#update-cart-btn").click(function() { var items = []; $(".item").each(function () { var productKey = $(this).find("input[name='item.ProductId']").val(); var productQuantity = $(this).find("input[type='text']").val(); items[productKey] = productQuantity; }); $.ajax({ type: "POST", url: "@Url.Action("UpdateCart", "Cart")", data: items, success: function () { alert("Successfully updated your cart!"); } }); }); }); </script> The items object is properly constructed with the values I need. What data type must my object be on the backend of my controller? I tried this but the variable remains null and is not bound. [Authorize] [HttpPost] public ActionResult UpdateCart(object[] items) // items remains null. { // Some magic here. return RedirectToAction("Index"); }

    Read the article

  • How can I merge two lists and sort them working in 'linear' time?

    - by Sergio Tapia
    I have this, and it works: # E. Given two lists sorted in increasing order, create and return a merged # list of all the elements in sorted order. You may modify the passed in lists. # Ideally, the solution should work in "linear" time, making a single # pass of both lists. def linear_merge(list1, list2): finalList = [] for item in list1: finalList.append(item) for item in list2: finalList.append(item) finalList.sort() return finalList # +++your code here+++ return But, I'd really like to learn this stuff well. :) What does 'linear' time mean?

    Read the article

  • How can I push a string from one client connected to a WCF service to another connected as well?

    - by Sergio Tapia
    Here's what I have so far: IService: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace ServiceLibrary { [ServiceContract(SessionMode = SessionMode.Allowed, CallbackContract = typeof(IServiceCallback))] public interface IService { [OperationContract(IsOneWay = false, IsInitiating = true, IsTerminating = false)] void Join(string userName); } interface IServiceCallback { [OperationContract(IsOneWay = true)] void UserJoined(string senderName); } } Service: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace ServiceLibrary { [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)] public class Service:IService { IServiceCallback callback = null; public void Join(string userName) { callback = OperationContext.Current.GetCallbackChannel<IServiceCallback>(); } } } Just a simple string passed from one client to another.

    Read the article

  • So, I guess I can't use "&&" in the Python if conditional. Any help?

    - by Sergio Tapia
    Here's my code: # F. front_back # Consider dividing a string into two halves. # If the length is even, the front and back halves are the same length. # If the length is odd, we'll say that the extra char goes in the front half. # e.g. 'abcde', the front half is 'abc', the back half 'de'. # Given 2 strings, a and b, return a string of the form # a-front + b-front + a-back + b-back def front_back(a, b): # +++your code here+++ if len(a) % 2 == 0 && len(b) % 2 == 0: return a[:(len(a)/2)] + b[:(len(b)/2)] + a[(len(a)/2):] + b[(len(b)/2):] else: #todo! Not yet done. :P return I'm getting an error in the IF conditional. What am I doing wrong?

    Read the article

  • Why am I getting this error when overriding an inherited method?

    - by Sergio Tapia
    Here's my parent class: public abstract class BaseFile { public string Name { get; set; } public string FileType { get; set; } public long Size { get; set; } public DateTime CreationDate { get; set; } public DateTime ModificationDate { get; set; } public abstract void GetFileInformation(); public abstract void GetThumbnail(); } And here's the class that's inheriting it: public class Picture:BaseFile { public override void GetFileInformation(string filePath) { FileInfo fileInformation = new FileInfo(filePath); if (fileInformation.Exists) { Name = fileInformation.Name; FileType = fileInformation.Extension; Size = fileInformation.Length; CreationDate = fileInformation.CreationTime; ModificationDate = fileInformation.LastWriteTime; } } public override void GetThumbnail() { } } I thought when a method was overridden, I could do what I wanted with it. Any help please? :)

    Read the article

  • What do I name classes whose only purpose is to act as a structure?

    - by Sergio Tapia
    For example, take my Actor class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; namespace FreeIMDB { class Actor { public string Name { get; set; } public Image Portrait { get; set; } public DateTime DateOfBirth { get; set; } public List<string> ActingRoles { get; set; } public List<string> WritingRoles { get; set; } public List<string> ProducingRoles { get; set; } public List<string> DirectingRoles { get; set; } } } This class will only be used to stuff information into it, and allow other developers to get their values. What are these types of classes officially called? What is the correct nomenclature?

    Read the article

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