Search Results

Search found 212 results on 9 pages for 'luca rossi'.

Page 8/9 | < Previous Page | 4 5 6 7 8 9  | Next Page >

  • What's the easiest way to parse a string in C?

    - by Luca Matteis
    I have to parse this string in C: XFR 3 NS 207.46.106.118:1863 0 207.46.104.20:1863\r\n And be able to get the 207.46.106.118 part and 1863 part (the first ip address). I know I could go char by char and eventually find my way through it, but what's the easiest way to get this information, given that the IP address in the string could change to a different format (with less digits)?

    Read the article

  • Control XML serialization of generic types

    - by Luca
    I'm investigating about XML serialization, and since I use lot of dictionary, I would like to serialize them as well. I found the following solution for that (I'm quite proud of it! :) ). [XmlInclude(typeof(Foo))] public class XmlDictionary<TKey, TValue> { /// <summary> /// Key/value pair. /// </summary> public struct DictionaryItem { /// <summary> /// Dictionary item key. /// </summary> public TKey Key; /// <summary> /// Dictionary item value. /// </summary> public TValue Value; } /// <summary> /// Dictionary items. /// </summary> public DictionaryItem[] Items { get { List<DictionaryItem> items = new List<DictionaryItem>(ItemsDictionary.Count); foreach (KeyValuePair<TKey, TValue> pair in ItemsDictionary) { DictionaryItem item; item.Key = pair.Key; item.Value = pair.Value; items.Add(item); } return (items.ToArray()); } set { ItemsDictionary = new Dictionary<TKey,TValue>(); foreach (DictionaryItem item in value) ItemsDictionary.Add(item.Key, item.Value); } } /// <summary> /// Indexer base on dictionary key. /// </summary> /// <param name="key"></param> /// <returns></returns> public TValue this[TKey key] { get { return (ItemsDictionary[key]); } set { Debug.Assert(value != null); ItemsDictionary[key] = value; } } /// <summary> /// Delegate for get key from a dictionary value. /// </summary> /// <param name="value"></param> /// <returns></returns> public delegate TKey GetItemKeyDelegate(TValue value); /// <summary> /// Add a range of values automatically determining the associated keys. /// </summary> /// <param name="values"></param> /// <param name="keygen"></param> public void AddRange(IEnumerable<TValue> values, GetItemKeyDelegate keygen) { foreach (TValue v in values) ItemsDictionary.Add(keygen(v), v); } /// <summary> /// Items dictionary. /// </summary> [XmlIgnore] public Dictionary<TKey, TValue> ItemsDictionary = new Dictionary<TKey,TValue>(); } The classes deriving from this class are serialized in the following way: <XmlProcessList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Items> <DictionaryItemOfInt32Foo> <Key/> <Value/> </DictionaryItemOfInt32XmlProcess> <Items> This give me a good solution, but: How can I control the name of the element DictionaryItemOfInt32Foo What happens if I define a Dictionary<FooInt32, Int32> and I have the classes Foo and FooInt32? Is it possible to optimize the class above? THank you very much!

    Read the article

  • Image visualization with canvas. How to resize them?

    - by Luca Matteis
    I'm building a website photo gallery for a friend. Images are loaded as simple DOM image objects (<img src="" />), and the size of these images is based on the browser size. So I resize them with CSS. This isn't an optimal solution since CSS resizing seems to change the quality of the image and pixelate it quite a bit. I was thinking of rendering the image with canvas and then resize it with that so that the quality remains effective, but I can't find any info about this online. Any ideas?

    Read the article

  • conditions without repeats

    - by Luca Romagnoli
    Hi i'm using this for getting data: Topic.find(:all, :include => ..., :conditions => @core ? ["cores_topics.id = ? AND visible = 1 AND (distance < ? OR cores.id IN (?))",@core.id, @user_location[3].to_i, @user_friends] : ["visible = 1 AND (distance < ? OR cores.id IN (?))", @user_location[3].to_i, @user_friends], ... how can i rewrite the conditions shorter? thanks

    Read the article

  • Different button's name at the opening of jquery dialog

    - by Luca Belluco
    Hello, I have a dialog form and when I open it I have the button "add a task", I would like to keep this "name", when I open the form from an empty case, but I want to have a button named "edit this task" when I open an already existing task. I also want to send the form with this button when I push enter key, no matter where I am on the form. Thank you.

    Read the article

  • minutes to time in sql server

    - by Luca Romagnoli
    i've created a function for convert minutes (smallint) in time (varchar(5)) like 58 - 00:58 set QUOTED_IDENTIFIER ON GO Create FUNCTION [dbo].[IntToMinutes] ( @m smallint ) RETURNS nvarchar(5) AS BEGIN DECLARE @c nvarchar(5) SET @c = CAST((@m / 60) as varchar(2)) + ':' + CAST((@m % 60) as varchar(2)) RETURN @c END The problem is when there are minutes < 10 in time like 9 the result of this function is 0:9 i want that the format is 00:09 how can i do that?

    Read the article

  • error with linq join

    - by Luca Romagnoli
    I have this linq query: var segreterie = from s in db.USR_Utenti join h in db.USR_Accounts on new {s.ID, settings.GruppoSegreteria} equals new {h.USR_UtentiReference,h.ID_Gruppo} select s; that has this problem: The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'. how can i do to solve it?

    Read the article

  • check if a table exsist in where

    - by Luca Romagnoli
    This query generates an error because table2 doesn't exist: Select * FROM table WHERE table2.id IS NOT NULL Is there anything like this for check the table2 before apply the check on the id? Select * FROM table WHERE (EXIST(table2) AND table2.id IS NOT NULL) or not EXIST(table2) Thanks

    Read the article

  • [css only gradient background] problems with ff < 3.6

    - by Luca
    hi! :) anyone know if is possible to reproduce this effect background-image: -moz-linear-gradient(top, #666666, #000000); background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000000),color-stop(1, #666666)); also on ff < 3.6? im tryin' to generate a gradient background without images! thanks a lot in advance for any advice.

    Read the article

  • .bat for shutdown/reboot on xp loop problem

    - by Luca
    hello! i have a little problem... on win xp, if i write on commandline shutdown -t 00 -r -f the reboot works fine. but if i paste it, as is, in a bat file...the prompt show me an infinite loop. anyone can say me why? thanks a lot for any suggestion :)

    Read the article

  • Better mode for do a select with group by

    - by Luca Romagnoli
    Hi i've wrote a query that works: SELECT `comments`.* FROM `comments` RIGHT JOIN (SELECT MAX( id ) AS id, core_id, topic_id FROM comments GROUP BY core_id, topic_id order by id desc) comm ON comm.id = comments.id LIMIT 10 I want know if is possible and how rewrite it for get better performance. thanks

    Read the article

  • Resizing the imageView in a UITableView

    - by Luca
    Hi! I Created a grouped table view, and I noticed that placing an image in the imageView results in an image that is too large. It overlaps the rounded borders of the cell, which is horrible. I tried looking for a way to resize it, but I found many answers that didn't quite satisfy me. How would you do this? Which is the simplest way to go? The solutions I found where strangely complicated. Thanks!

    Read the article

  • How to skin UI using Forms?

    - by Luca
    I'd like to know if is there a way to "skin" a Form and every widget used inside it. Images should be on background and other elements shall be setup accordingly. In short, a way to implement a way to display the same Form in different flavors (i.e.: theme and eyecandy UI).

    Read the article

  • Push a detail view in UITableViewCell class

    - by luca
    My class inherit from UITableViewCell, i have make some custom transitions to push a new detail view when an image get selected. [UIView transitionWithView:self.masterView duration:0.5 options:UIViewAnimationOptionShowHideTransitionViews animations:^ { [self.masterView addSubview:self.detailImage]; } completion:nil]; My code works fine, the detailImage subview is shown with a transition, but this transition is not what i want exactly. What i want to perform is a simple transition from bottom to up. The list of UIViewAnimation doesn't contain such animation. Is there any way to use that transition without changing my class inheritance to UINavigationController ?

    Read the article

  • Conditional installation with Wix

    - by Luca
    Is it possible to have a conditional installation configuration, slaved wth the Visual Studio configuration environment? For example, selecting DEBUG or RELEASE configuration, Wix selects different executables in the built installation.

    Read the article

  • insert with many to many relationship

    - by Luca Romagnoli
    hi, i have 2 object: user, group that have a relationship many to many i want create a user and associate some groups to it. How can i do it? thanks I've tried with this. but it's wrong: user = new User(); List<int> gruppi = new List<int>() {1,2}; utente.Group =db.Group.Where(p => gruppi.Contains(p.GruppoID)

    Read the article

  • conditions on count in a select

    - by Luca Romagnoli
    Hi, i have a table like this: Table(MissioneID, Type) Type can be 1,2 or 3 i have to count missions by type value: ex. if table's content is: MissioneID Type 1,1 1,2 1,1 2,3 1,2 The result of query is MissioneID,Count1,Count2,Count3 1, 2,2,0 2,0,0,1 How can i do? thanks

    Read the article

  • wpautop() - when shortcode attributes are on new lines -breaks args array

    - by Luca
    I have a custom shortcode tag with a few attributes, and I would like to be able to display its attributes on new lines - to make it more readable to content editors: [component attr1 ="value1" attr2 ="value of the second one" attr3 ="another" attr4 ="value" ... attrN ="valueN"] The reason behind this requirement is that a few attributes might be quite verbose in content. Unfortunately, wpautop() adds some nasty extra markup that breaks the args array like this (using php print_r($args)): Array ( [0] => attr1 [1] => ="value1" /> [3] => attr2 = [4] => "value [5] => of [6] => the [7] => second [8] => one" /> [10] => "" //...and more like this) I've tried with the attributes inline: [component attr1 ="value1" attr2 ="value of the second one" ="value"... attrN ="valueN"] and the output is as expected: Array ( [attr1] => value1 [attr2] => value of the second one [attr3] => //...and so on) is there any way to have the attributes intented and avoid that extra markup that breaks the $args array?

    Read the article

  • Why does Apple use Objective-C for iPhone development? (App Store)

    - by Luca Matteis
    I'm interested to know your opinion on why Apple uses a language such as Objective-C for app development. Does Apple's app store allow apps written only in this language? Does apple even look at your source-code or does it just care of the binary output? I learned that most of their app rejection (in the app store) is based upon apps crashing (probably memory leaks in which Objective-c is not very efficient unless you use a GC). Why not let developers use a safer language, like a scripting language? I think these are important questions for a developer (I don't even use Apple's products) because it seems like Apple's app store is the MOST successful app sale place on the web.

    Read the article

< Previous Page | 4 5 6 7 8 9  | Next Page >