Search Results

Search found 2668 results on 107 pages for 'twitch city'.

Page 17/107 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • NSDictionary: convert NSString keys to lowercase to search a string on them

    - by VansFannel
    Hello. I'm developing an iPhone application. I use a NSDictionary to store city's names as key, and population as value. I want to search the keys using lowercase. I've using this: NSDictionary *dict; [dict objectForKey:[[city stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] lowercaseString]]; But, it doesn't work. I know, I can do a for, convert keys to lowercase and compare with city. Is there any other way to do that? Maybe, with a NSDictionary method. UPDATE The NSDictionary is loaded from a property list. Thank you.

    Read the article

  • Master Details and collectionViewSource in separate views cannot make it work.

    - by devnet247
    Hi all, I really cannot seem to make/understand how it works with separate views It all works fine if a bundle all together in a single window. I have a list of Countries-Cities-etc... When you select a country it should load it's cities. Works So I bind 3 listboxes successfully using collection sources and no codebehind more or less (just code to set the datacontext and selectionChanged). you can download the project here http://cid-9db5ae91a2948485.skydrive.live.com/self.aspx/PublicFolder/2MasterDetails.zip <Window.Resources> <CollectionViewSource Source="{Binding}" x:Key="cvsCountryList"/> <CollectionViewSource Source="{Binding Source={StaticResource cvsCountryList},Path=Cities}" x:Key="cvsCityList"/> <CollectionViewSource Source="{Binding Source={StaticResource cvsCityList},Path=Hotels}" x:Key="cvsHotelList"/> </Window.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Grid.Column="0" Grid.Row="0" Text="Countries"/> <TextBlock Grid.Column="1" Grid.Row="0" Text="Cities"/> <TextBlock Grid.Column="2" Grid.Row="0" Text="Hotels"/> <ListBox Grid.Column="0" Grid.Row="1" Name="lstCountries" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource cvsCountryList}}" DisplayMemberPath="Name" SelectionChanged="OnSelectionChanged"/> <ListBox Grid.Column="1" Grid.Row="1" Name="lstCities" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource cvsCityList}}" DisplayMemberPath="Name" SelectionChanged="OnSelectionChanged"/> <ListBox Grid.Column="2" Grid.Row="1" Name="lstHotels" ItemsSource="{Binding Source={StaticResource cvsHotelList}}" DisplayMemberPath="Name" SelectionChanged="OnSelectionChanged"/> </Grid> Does not work I am trying to implement the same using a view for each eg(LeftSideMasterControl -RightSideDetailsControls) However I cannot seem to make them bind. Can you help? I would be very grateful so that I can understand how you communicate between userControls You can download the project here. http://cid-9db5ae91a2948485.skydrive.live.com/self.aspx/PublicFolder/2MasterDetails.zip I have as follows LeftSideMasterControl.xaml <Grid> <ListBox Name="lstCountries" SelectionChanged="OnSelectionChanged" DisplayMemberPath="Name" ItemsSource="{Binding Countries}"/> </Grid> RightViewDetailsControl.xaml MainView.xaml <CollectionViewSource Source="{Binding}" x:Key="cvsCountryList"/> <CollectionViewSource Source="{Binding Source={StaticResource cvsCountryList},Path=Cities}" x:Key="cvsCityList"/> </UserControl.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="3*"/> </Grid.ColumnDefinitions> <Views:LeftViewMasterControl x:Name="leftSide" Margin="5" Content="{Binding Source=}"/> <GridSplitter Grid.Column="0" Grid.Row="0" Background="LightGray"/> <Views:RightViewDetailsControl Grid.Column="1" x:Name="RightSide" Margin="5"/> </Grid> ViewModels public class CountryListVM : ViewModelBase { public CountryListVM() { Countries = new ObservableCollection<CountryVM>(); } public ObservableCollection<CountryVM> Countries { get; set; } private RelayCommand _loadCountriesCommand; public ICommand LoadCountriesCommand { get { return _loadCountriesCommand ?? (_loadCountriesCommand = new RelayCommand(x => LoadCountries(), x => CanLoadCountries)); } } private static bool CanLoadCountries { get { return true; } } private void LoadCountries() { var countryList = Repository.GetCountries(); foreach (var country in countryList) { Countries.Add(new CountryVM { Name = country.Name }); } } } public class CountryVM : ViewModelBase { private string _name; public string Name { get { return _name; } set { _name = value; OnPropertyChanged("Name"); } } } public class CityListVM : ViewModelBase { private CountryVM _selectedCountry; public CityListVM(CountryVM country) { SelectedCountry = country; Cities = new ObservableCollection<CityVM>(); } public ObservableCollection<CityVM> Cities { get; set; } public CountryVM SelectedCountry { get { return _selectedCountry; } set { _selectedCountry = value; OnPropertyChanged("SelectedCountry"); } } private RelayCommand _loadCitiesCommand; public ICommand LoadCitiesCommand { get { return _loadCitiesCommand ?? (_loadCitiesCommand = new RelayCommand(x => LoadCities(), x => CanLoadCities)); } } private static bool CanLoadCities { get { return true; } } private void LoadCities() { var cities = Repository.GetCities(SelectedCountry.Name); foreach (var city in cities) { Cities.Add(new CityVM() { Name = city.Name }); } } } public class CityVM : ViewModelBase { private string _name; public string Name { get { return _name; } set { _name = value; OnPropertyChanged("Name"); } } } Models ========= public class Country { public Country() { Cities = new ObservableCollection<City>(); } public string Name { get; set; } public ObservableCollection<City> Cities { get; set; } } public class City { public City() { Hotels = new ObservableCollection<Hotel>(); } public string Name { get; set; } public ObservableCollection<Hotel> Hotels { get; set; } } public class Hotel { public string Name { get; set; } }

    Read the article

  • SQL Query Not Functioning - No Error Message

    - by gamerzfuse
    // Write the data to the database $query = "INSERT INTO staff (name, lastname, username, password, position, department, birthmonth, birthday, birthyear, location, phone, email, street, city, state, country, zip, tags, photo) VALUES ('$name', '$lastname', '$username', '$password', '$position', '$department', '$birthmonth', '$birthday', '$birthyear', '$location', '$phone', '$email', '$street', '$city', '$state', '$country', '$zip', '$tags', '$photo')"; mysql_query($query); var_dump($query); echo '<p>' . $name . ' has been added to the Employee Directory.</p>'; if (!$query) { die('Invalid query: ' . mysql_error()); } Can someone tell me why the above code produced: string(332) "INSERT INTO staff (name, lastname, username, password, position, department, birthmonth, birthday, birthyear, location, phone, email, street, city, state, country, zip, tags, photo) VALUES ('Craig', 'Hooghiem', 'sdf', 'sdf', 'sdf', 'sdf', '01', '01', 'sdf', 'sdf', '', 'sdf', 'sdf', 'sd', 'sdf', 'sdf', 'sd', 'sdg', 'leftround.gif')" Craig has been added to the Employee Directory. But does not actually add anything into the database table "staff" ? I must be missing something obvious here.

    Read the article

  • searching for address matches using sql server 2008 full text search

    - by Sridhar
    Hi, I am not sure how to search for address matches using sql server 2008 full text search. This is what I tried but it doesn't return any records. TableA ------ Address1 Address2 City State Zip All the above columns in the table are full text indexed. Let's say if the user enters "123 Apple street FL 33647" and I have a record in the table as Address1 = "123" , Address2 = "Apple street", City = "Tampa", State = "FL" and Zip = "33647" I would like the query to return this. can you please let me know how I would do this. query tried -------------- SELECT * FROM TableA WHERE CONTAINS((Address1, Address2, City, State, zip), N'FORMSOF(THESAURUS, 123AppleStreetFL33647)'); If I put spaces in the search word, it is giving syntax error. Thanks, sridhar.

    Read the article

  • Suggestions based on unknown address in google's geocoder

    - by richardverbruggen
    When using Googles geocoder service to display a city on a map; filling out a non-existing city results in an error. Is there a way to display some suggestions based on the filled out city? var geocoder = new GClientGeocoder(); function showAddress(address, zoom) { geocoder.getLatLng( address, function(point) { if (!point) { //no point found.... //Suggest some points :) } else { map.setCenter(point, zoom); } } ); } showAddress('Someplace, Nederland', 14);

    Read the article

  • SQL Query - Count column values separately

    - by user575535
    I have a hard time getting a Query to work right. This is the DDL for my Tables CREATE TABLE Agency ( id SERIAL not null, city VARCHAR(200) not null, PRIMARY KEY(id) ); CREATE TABLE Customer ( id SERIAL not null, fullname VARCHAR(200) not null, status VARCHAR(15) not null CHECK(status IN ('new','regular','gold')), agencyID INTEGER not null REFERENCES Agency(id), PRIMARY KEY(id) ); Sample Data from the Tables AGENCY id|'city' 1 |'London' 2 |'Moscow' 3 |'Beijing' CUSTOMER id|'fullname' |'status' |agencyid 1 |'Michael Smith' |'new' |1 2 |'John Doe' |'regular'|1 3 |'Vlad Atanasov' |'new' |2 4 |'Vasili Karasev'|'regular'|2 5 |'Elena Miskova' |'gold' |2 6 |'Kim Yin Lu' |'new' |3 7 |'Hu Jintao' |'regular'|3 8 |'Wen Jiabao' |'regular'|3 I want to produce the following output, but i need to count separately for ('new','regular','gold') 'city' |new_customers|regular_customers|gold_customers 'Moscow' |1 |1 |1 'Beijing'|1 |2 |0 'London' |1 |1 |0

    Read the article

  • Address extraction from emails in Java

    - by Hans Klock
    I'm looking for an Java open-source library which is able to extract address information from a (German) email (signature). The library should find name street city, city code/postal code email tel/fax address-parser.com is an commercial product, but an free (albeit simple) library would be great. stackoverflow.com/questions/16413/parse-usable-street-address-city-state-zip-from-a-string is asking for something similar, but my problem is broader because the address information is hidden in a complete email. And there isn't a solution either... Any ideas?

    Read the article

  • Custom Logic and Proxy Classes in ADO.NET Data Services

    - by rasx
    I've just read "Injecting Custom Logic in ADO.NET Data Services" and my next question is, How do you get your [WebGet] method to show up in the client-side proxy classes? Sure, I can call this directly (RESTfully) with, say, WebClient but I thought the strong typing features in ADO.NET Data Services would "hide" this from me auto-magically. So here we have: public class MyService : DataService<MyDataSource> { // This method is called only once to initialize service-wide policies. public static void InitializeService(IDataServiceConfiguration config) { config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead); config.SetServiceOperationAccessRule("CustomersInCity", ServiceOperationRights.All); } [WebGet] public IQueryable<MyDataSource.Customers> CustomersInCity(string city) { return from c in this.CurrentDataSource.Customers where c.City == city select c; } } How can I get CustomersInCity() to show up in my client-side class defintions?

    Read the article

  • PHP Email Form Sending Random Text

    - by Doug
    Hi, I did a webpage for a client that involved a series of text boxes asking for specific information such as a person's name, e-mail address, company, etc. Along with a button that would e-mail the information to my client. Whenever I tested the button it seemed to work perfectly, I uploaded the page and thought I was done. But, the other day my client got this email from the site: Name: rfhopzdgmx rfhopzdgmx Email: [email protected] Company: zUDXatAfoDvQrdH Mailing Address: AaSsXklqpHIsoCNcei gXsimMPRBYZqq vGLvZraZNdpOAV, ChsmuibE PoKzaSCubXPRI Home Phone: CIJbIfjMfjIaTqAlD Work Phone: JFLZBOvru Cell Phone: XlFJTTFGiTTiiFQfy Fax: UEJMOVZodWPkKxew Comments: sPvSCE hgetwoguderu,* [url=http://atyktjlxcznl.com/]atyktjlxcznl[/url], [link=http://nudvfcehwpyg.com/]nudvfcehwpyg[/link], http://lvvwkbzbhnzp.com/ Note: The * line contained HTML link code, I just don't know how to get this site to show it. Here is the PHP code in the site for the e-mail button. <?php //This Sends A Formatted Text Email Using The Text Boxes if ($_POST['submit']){ //This Gets The Form Data $fname = $_POST['fName']; $lname = $_POST['lName']; $email = $_POST['email']; $company = $_POST['co']; $address1 = $_POST['address1']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $homep = $_POST['homeP']; $workp = $_POST['workP']; $cellp = $_POST['cellP']; $fax = $_POST['fax']; $comments = $_POST['txaOutputField']; //echo "<script language = 'javascript'>alert('YAY');</script>"; if ($fname && $lname && $email && $comments){ //Check If Required Fields Are Filled //This Sets The SMTP Configuration In php.ini ini_set("SMTP", "smtp.2ndsourcewire.com"); //This Replaces Any Blank Fields With 'None's if ($company == ""){ $company = "None"; } if ($address1 == ""){ $address1 = "None"; } if ($city == ""){ $city = "None"; } if ($state == ""){ $state = "None"; } if ($zip == ""){ $zip = "None"; } if ($homep == ""){ $homep = "None"; } if ($workp == ""){ $workp = "None"; } if ($cellp == ""){ $cellp = "None"; } if ($fax == ""){ $fax = "None"; } //This Creates The Variables Necessary For The Email $to = "CLIENT EMAIL WHICH I'M CENSORING"; $subject = "Email from 2ndSourceWire.com"; $from = "From: [email protected]"; $secondEmail = "MY EMAIL WHICH I'M ALSO CENSORING"; if ($address2 == ""){ $body = "Name: $fname $lname\n". "Email: $email\n". "Company: $company\n\n". "Mailing Address:\n". "$address1\n". "$city, $state $zip\n\n". "Home Phone: $homep\n". "Work Phone: $workp\n". "Cell Phone: $cellp\n". "Fax: $fax\n\n". "Comments:\n". "$comments"; } else { $body = "Name: $fname $lname\n". "Email: $email\n". "Company: $company\n\n". "Mailing Address:\n". "$address1\n". "$address2\n". "$city, $state $zip\n\n". "Home Phone: $homep\n". "Work Phone: $workp\n". "Cell Phone: $cellp\n". "Fax: $fax\n\n". "Comments:\n". "$comments"; } //This Sends The Email mail($to, $subject, $body, $from); mail($secondEmail, $subject, $body, $from); echo "<script language = 'javascript'>alert('The email was sent successfully.');</script>"; } else { //The Required Fields Are Not Filled echo "<script language = 'javascript'>alert('Please fill your first name, last name, email address, and your comment or question.');</script>"; } } ? I'm a little dumbfounded on how this happened, the client mentioned a couple e-mails of this, so I don't think it is a random glitch. Also, the e-mail address was formatted like an e-mail address, so someone or some program was interpreting the labels next to each text box. I also noticed that the first and last names entered are the same word, even though they were in different text boxes, I'm thinking its some spam program, but wouldn't they try to advertise something and make money, rather than just spouting out random text? Also, the comments section makes no sense to me at all, the links goto nowhere and they're all perfectly formatted, a random person just screwing around wouldn't know those tags, and a programmer doing it wouldn't bother with it, but also neither would a program. I have no idea what caused this or how to fix it, I'm drawing a blank here. Anyone have any ideas?

    Read the article

  • TSQL -- Make it better

    - by user319353
    Hi: -- Very Narrow (all IDs are passed in) IF(@EmpID IS NOT NULL AND @DeptID IS NOT NULL AND @CityID IS NOT NULL) BEGIN SELECT e.EmpName ,d.DeptName ,c.CityName FROM Employee e WITH (NOLOCK) JOIN Department d WITH (NOLOCK) ON e.deptid = d.deptid JOIN City c WITH (NOLOCK) ON e.CityID = c.CityID WHERE e.EmpID = @EmpID END -- Just 2 IDs passed in ELSE IF(@DeptID IS NOT NULL AND @CityID IS NOT NULL) BEGIN SELECT e.EmpName ,d.DeptName ,NULL AS [CityName] FROM Employee e WITH (NOLOCK) JOIN Department d WITH (NOLOCK) ON e.deptid = d.deptid JOIN City c WITH (NOLOCK) ON e.CityID = c.CityID WHERE d.deptID = @DeptID END -- Very Broad (just 1 ID passed in) ELSE IF(@CityID IS NOT NULL) BEGIN SELECT e.EmpName ,NULL AS [DeptName] ,NULL AS [CityName] FROM Employee e WITH (NOLOCK) JOIN Department d WITH (NOLOCK) ON e.deptid = d.deptid JOIN City c WITH (NOLOCK) ON e.CityID = c.CityID WHERE c.CityID = @CityID END -- None (Nothing passed in) ELSE BEGIN SELECT NULL AS [EmpName] ,NULL AS [DeptName] ,NULL AS [CityName] END Question: Is there any better way (OR specifically can I do anything without IF...ELSE condition?

    Read the article

  • RoR associations through or not through?

    - by showFocus
    I have four models that are related to one another, the way I have it setup at the moment is I have to select a county, region and country when entering a new city. class Country < ActiveRecord::Base has_many :regions has_many :counties has_many :cities end class Region < ActiveRecord::Base has_one :country has_many :counties has_many :cities end class County < ActiveRecord::Base has_one :country has_one :region has_many :cities end class City < ActiveRecord::Base has_one :country has_one :region has_one :county end Would it be better to use the :through symbol in the association? So I could say the city: has_one :country, :through => :region Not sure if this is correct, I have read how :through works but I'm not sure if this is the best solution. I am a newbie and while I'm not struggling with the syntax and how things work, it would be good to get opinions on best practices and the way things should be done from some rails wizards! Thanks in advance.

    Read the article

  • can't load/read yahoo geocode as xml and read it in jquery

    - by mastah
    Hi, I tried saving the result as an xml, when I read from there it works, but if I read it from yahoo's api, doesn't load anything. You can check it here here's my script $(document).ready(function(){ $.ajax({ type: "GET", url: "http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&zip=10035", dataType: "xml", success: function(xml) { $(xml).find('Result').each(function(){ var city = $(this).find('City').text(); var state = $(this).find('State').text(); $('<div />').html('<p>'+city+'</p><p>'+state+'</p>').insertAfter('h2'); }); } }); });

    Read the article

  • How to get all possible values for SPFieldLookup

    - by Anton Polyakov
    Hello! I have a lookup field in sharepoint which just references another list. I wonder how do I programatically enumerate all possible values for this field? For example, my lookup field "Actual City" refers list "Cities" and column "Title", I have 3 cities there. In code I would like to get list of all possible values for field "Actual City", smth like (metacode, sorry): SPFieldLookup f = myList["Actual City"]; Collection availableValues = f.GetAllPossibleValues(); //this should return collection with all cities a user might select for the field

    Read the article

  • Any Java library for address extraction from emails?

    - by Hans Klock
    I'm looking for an Java open-source library which is able to extract address information from a (German) email (signature). The library should find name street city, city code/postal code email tel/fax address-parser.com is an commercial product, but a free (albeit simple) library would be great. stackoverflow.com/questions/16413/parse-usable-street-address-city-state-zip-from-a-string is asking for something similar, but my problem is broader because the address information is hidden in a complete email. And there isn't a solution either... Any ideas?

    Read the article

  • how can i solve "The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered."?

    - by Phsika
    i try to use get excel data from excel file. i am using office 2007 and sql 2005. i writed below codes: CREATE TABLE [dbo].[Addresses_Temp] ( [FirstName] VARCHAR(20), [LastName] VARCHAR(20), [Address] VARCHAR(50), [City] VARCHAR(30), [State] VARCHAR(2), [ZIP] VARCHAR(10) ) GO INSERT INTO [dbo].[Address_Temp] ( [FirstName], [LastName], [Address], [City], [State], [ZIP] ) SELECT [FirstName], [LastName], [Address], [City], [State], [ZIP] FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Source\Addresses.xls;IMEX=1', 'SELECT * FROM [Sayfa1$]') Error:Msg 7403, Level 16, State 1, Line 2 The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered. How can i solve it?

    Read the article

  • Problem with linq-to-xml

    - by phenevo
    I want by linq save my xml in csv and I have o problem. This bracket are here beacuse without it this code is not displaying (why ? ) bracket results bracket <Countries country="Albania"><Regions region="Centralna Albania"><Provinces province="Durres i okolice"><Cities city="Durres" cityCode="2B66E0ACFAEF78734E3AF1194BFA6F8DEC4C5760"><IndividualFlagsWithForObjects Status="1" /><IndividualFlagsWithForObjects Status="0" /><IndividualFlagsWithForObjects magazyn="2" /></Cities></Provinces></Regions></Countries><Countries .... XDocument loaded = XDocument.Load(@"c:\citiesxml.xml"); // create a writer and open the file TextWriter tw = new StreamWriter("c:\\XmltoCSV.txt"); // Query the data and write out a subset of contacts var contacts = (from c in loaded.Descendants("Countries") select new { Country = (string)c.Element("Country"), Region = (string)c.Element("region"), Province= (string)c.Element("province"), City = (string)c.Element("city"), Hotel = (string)c.Element("hotel") }).ToList(); Problem is that loaded.Descendants("Countries") gives me 45 countries but all fields are null.

    Read the article

  • SQL Count Query with Grouping by multiple Columns

    - by Christian
    I have a table with three filled columns named "Name", "City" and "Occupation". I want to create a new column in the same table that contains the number of people who have the same occupation. "Name" | "City" | "Occupation" ------------------------------ Amy | Berlin | Plumber Bob | Berlin | Plumber Carol | Berlin | Lawyer David | London | Plumber I want to have a table that contains: "Name" | "City" | "Occupation" | "Number" --------------------------------------- Amy | Berlin | Plumber | 2 Bob | Berlin | Plumber | 2 Carol | Berlin | Lawyer | 1 David | London | Plumber | 1 How does the SQL Query that creates the new columns have to look like? I want to actually create a new column in the database that I can access later.

    Read the article

  • Jquery Autocomplete Unable to Empty Input on Internet Explorer

    - by Matias
    Hi, I´ve got a Jquery autocomplete input like the following: $("#cities").autocomplete(regionIDs, { minChars: 2, width: 310, autoFill: true, matchContains: "word", formatItem: function(row) { return row.city + ", " + "<span>" + row.country + "</span>"; }, formatMatch: function(row) { return row.city; }, formatResult: function(row) { return row.city + ", " + row.country; } }); A listener for the input $("#cities").result(function(event, data, formatted) { selectedCity = (data.regionID); }); And the input: <input type="text" class="textbox" id="cities" name="q" autocomplete="off"> The trouble is when I reload the page, Internet explorer displays last user Input in the text box. However, the variable has no value. I have tried with .reset() but no success. Any ideas why ?

    Read the article

  • SQL Count Query with Grouping by multiple Rows

    - by Christian
    I have a table with three filled rows named "Name", "City" and "Occupation". I want to create a new row in the same table that contains the number of people who have the same occupation. "Name" | "City" | "Occupation" ------------------------------ Amy | Berlin | Plumber Bob | Berlin | Plumber Carol | Berlin | Lawyer David | London | Plumber I want to have a table that contains: "Name" | "City" | "Occupation" | "Number" --------------------------------------- Amy | Berlin | Plumber | 2 Bob | Berlin | Plumber | 2 Carol | Berlin | Lawyer | 1 David | London | Plumber | 1 How does the SQL Query that creates the new row have to look like? I want to actually create a new row in the database that I can access later.

    Read the article

  • Rails, How can I combine multiple model attributes to create a unique permalink using permalink_fu?

    - by Ranknoodle
    Can Permalink_fu combine 2 or more model attributes to create a unique permalink? Let's say I have a Business Model, this model contains :name, :address, :phone, :city, :state, :country etc. attributes. Right now I have permalink set up in this model only for :name has_permalink :name So I would get "/biz/name". However I would like to combine the Business name, city, and a incremental number if there are more than 1 location in the city for that business. For example I would like to use: "/biz/joes-coffee-shack-chicago" for the permalink or if a multple location business "/biz/starbucks-chicago-92" Is this possible with the current permalink_fu plugin or some fork of permalink_fu? Or will this require some modification to the permalink_fu plugin?

    Read the article

  • How to populate spinner from mySql database

    - by user1472085
    How do i populate this,I have 2 Spinners in my app and one is for Province and other is for City, when i select Gauteng in province spinner i want my second spinner to show Johannesburg,Pretoria,Centurion and If i select KZN in province i want my second spinner to show Maritsburg and Durban. im using mySql database and i have Province table and City table. Here is My Province table(idprovince,provincename) 1 Gauteng 2 Free-State 3 Limpopo 4 Northen-Cape 5 North-West 6 Western-Cape 7 Eastern-Cape 8 Kwa-Zulu-Natal 9 Mpumalanga and Here is my city table(idcity,cityname,province_idprovince) 1 Johannesburg 1 2 pretoria 1 3 Centurion 1 4 Bloemfontein 2 5 Welkom 2 6 Polokwane 3 7 Phalaborwa 3 8 Potgiersrus 3 9 Tzaneen 3 10 Kimberley 4 11 Upington 4 12 Mafikeng 5 13 Klerksdorp 5 14 Mmabatho 5 15 Potchefstroom 5 16 Brits 5 17 Cape-Town 6 18 Stellenbosch 6 19 George 6 20 Saldhana-Bay 6 21 Bisho 7 22 Port-Elizabeth 7 23 East-London 7 24 Pietermaritzburg 8 25 Durban 8 26 Ulundi 8 27 Richards-Bay 8 28 Newcastle 8 29 Nelspruit 9 30 Witbank 9 31 Middleburg 9 32 Ermelo 9 i will appriciate your help.

    Read the article

  • mySQL Query JOIN in same table

    - by jeerose
    Table structure goes something like this: Table: Purchasers Columns: id | organization | city | state Table: Events Columns: id | purchaser_id My query: SELECT purchasers.*, events.id AS event_id FROM purchasers INNER JOIN events ON events.purchaser_id = purchasers.id WHERE purchasers.id = '$id' What I would like to do, is obviously to select entries by their id from the purchasers table and join from events. That's the easy part. I can also easily to another query to get other purchasers with the same organization, city and state (there are multiples) but I'd like to do it all in the same query. Is there a way I can do this? In short, grab purchasers by their ID but then also select other purchasers that have the same organization, city and state. Thanks.

    Read the article

  • Stored Procedure for Multi-Table Insert Error: Cannot Insert the Value Null into Column

    - by SidC
    Good Evening All, I've created the following stored procedure: CREATE PROCEDURE AddQuote -- Add the parameters for the stored procedure here AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; Declare @CompanyName nvarchar(50), @Addr nvarchar(50), @City nvarchar(50), @State nvarchar(2), @Zip nvarchar(5), @NeedDate datetime, @PartNumber float, @Qty int -- Insert statements for procedure here Insert into dbo.Customers (CompanyName, Address, City, State, ZipCode) Values (@CompanyName, @Addr, @City, @State, @Zip) Insert into dbo.Orders (NeedbyDate) Values(@NeedDate) Insert into dbo.OrderDetail (fkPartNumber,Qty) Values (@PartNumber,@Qty) END GO When I execute AddQuote, I receive an error stating: Msg 515, Level 16, State 2, Procedure AddQuote, Line 31 Cannot insert the value NULL into column 'ID', table 'Diel_inventory.dbo.OrderDetail'; column does not allow nulls. INSERT fails. The statement has been terminated. I understand that I've set Qty field to not allow nulls and want to continue doing so. However, are there other syntax changes I should make to ensure that this sproc works correctly? Thanks, Sid

    Read the article

  • error come to execute the stored procedure using with open xml in sql server

    - by Muthumari
    Hi, i execute the below stored procedure.but it shows the error. The error is 'Incorrect syntax near '.'.i.e error shows in 'xmlFields.Country' please look this stored procedure also and help me thanks, in advance create procedure sp_SuUpdateSUADUsersStatus ( @FinalEMPCode nvarchar(50), @xmlFields NTEXT ) AS DECLARE @CityIDReturn INT SET NOCOUNT ON BEGIN DECLARE @hdoc INT EXEC sp_xml_preparedocument @hdoc OUTPUT, @xmlFields BEGIN EXEC @CityIDReturn=sp_SuSaveADUsersLocation @Country=xmlFields.Country, xmlFields.State,xmlFields.City FROM OPENXML(@hDoc, 'EmpCode/User', 2) WITH (Country nvarchar(500),State nvarchar(500),City nvarchar(500)) as xmlFields where xmlFields.Country <>'' and xmlFields.State <>'' and xmlFields.City <>'') END EXEC sp_xml_removedocument @hdoc End

    Read the article

  • Databinding in windows forms on an object graph with possible null properties?

    - by Fredrik
    If I have an object graph like this: class Company { public Address MainAddress {...} } class Address { public string City { ... } } Company c = new Company(); c.MainAddress = new Address(); c.MainAddress.City = "Stockholm"; and databind to a control using: textBox1.DataBinding.Add( "Text", c, "MainAddress.City" ); Everything is fine, but If I bind to: Company c2 = new Company(); c2 using the same syntax it crashes since the MainAddress property is null. I wonder if there is a custom Binding class that can set up listeners for all the possible paths here and bind to the actual object dynamically when/if I sometime later in the application set the MainAddress property.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >