Search Results

Search found 46009 results on 1841 pages for 'first timer'.

Page 10/1841 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • EF Code First to SQL Azure

    - by Predrag Pejic
    I am using EF Code First to create a database on local .\SQLEXPRESS. Among others. I have these 2 classes: public class Shop { public int ShopID { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a name!")] [MaxLength(25, ErrorMessage = "Name must be 25 characters or less")] public string Name { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter an address!")] [MaxLength(30, ErrorMessage = "Address must be 30 characters or less")] public string Address { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a valid city name!")] [MaxLength(30, ErrorMessage = "City name must be 30 characters or less")] public string City { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a phone number!")] [MaxLength(14, ErrorMessage = "Phone number must be 14 characters or less")] public string Phone { get; set; } [MaxLength(100, ErrorMessage = "Description must be 50 characters or less")] public string Description { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a WorkTime!")] public DateTime WorkTimeBegin { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a WorkTime!")] public DateTime WorkTimeEnd { get; set; } public DateTime? SaturdayWorkTimeBegin { get; set; } public DateTime? SaturdayWorkTimeEnd { get; set; } public DateTime? SundayWorkTimeBegin { get; set; } public DateTime? SundayWorkTimeEnd { get; set; } public int ShoppingPlaceID { get; set; } public virtual ShoppingPlace ShoppingPlace { get; set; } public virtual ICollection<Category> Categories { get; set; } } public class ShoppingPlace { [Key] public int ShopingplaceID { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a name!")] [MaxLength(25, ErrorMessage = "Name must be 25 characters or less")] public string Name { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter an address!")] [MaxLength(50, ErrorMessage = "Address must be 50 characters or less")] public string Address { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a city name!")] [MaxLength(30, ErrorMessage = "City must be 30 characters or less")] public string City { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a valid phone number!")] [MaxLength(14, ErrorMessage = "Phone number must be 14 characters or less")] public string Phone { get; set; } public int ShoppingCenterID { get; set; } public virtual ShoppingCenter ShoppingCenter { get; set; } public virtual ICollection<Shop> Shops { get; set; } } and a method in DbContext: modelBuilder.Entity<Item>() .HasRequired(p => p.Category) .WithMany(a => a.Items) .HasForeignKey(a => a.CategoryID) .WillCascadeOnDelete(false); modelBuilder.Entity<Category>() .HasRequired(a => a.Shop) .WithMany(a => a.Categories) .HasForeignKey(a => a.ShopID) .WillCascadeOnDelete(false); modelBuilder.Entity<Shop>() .HasOptional(a => a.ShoppingPlace) .WithMany(a => a.Shops) .HasForeignKey(a => a.ShoppingPlaceID) .WillCascadeOnDelete(false); modelBuilder.Entity<ShoppingPlace>() .HasOptional(a => a.ShoppingCenter) .WithMany(a => a.ShoppingPlaces) .HasForeignKey(a => a.ShoppingCenterID) .WillCascadeOnDelete(false); Why I can't create Shop without creating and populating ShopingPlace. How to achieve that? EDIT: Tried with: modelBuilder.Entity<Shop>() .HasOptional(a => a.ShoppingPlace) .WithOptionalPrincipal(); modelBuilder.Entity<ShoppingPlace>() .HasOptional(a => a.ShoppingCenter) .WithOptionalPrincipal(); and it passed, but what is the difference? And why in SQL Server i am allowed to see ShoppingPlaceID and ShoppingPlace_ShopingPlaceID when in the case of Item and Category i see only one?

    Read the article

  • How to measure how long is a function running?

    - by rhose87
    I want to see how long a function is running. So I added a timer object on my form and I came out with this code: private int counter = 0; //inside button click I have: timer = new Timer(); timer.Tick += new EventHandler(timer_Tick); timer.Start(); Result result = new Result(); result = new GeneticAlgorithms().TabuSearch(parametersTabu, functia); timer.Stop(); and: private void timer_Tick(object sender, EventArgs e) { counter++; btnTabuSearch.Text = counter.ToString(); } But this is not counting anything. Any ideas?

    Read the article

  • What will happen if the code can't finished on time...

    - by Tattat
    If I set a timer to execute a code every 3 seconds. If the code isn't finished in 3 seconds, what will happen? The computer will terminal the code or wait for the code finish or continue the timer, and execute the code with the unfinished code concurrently. int delay = 0; // delay for 0 sec. int period = 3000; // repeat 3 sec. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { // Task here ... // It may take more than 3 sec to finish, what will happen? } }, delay, period);

    Read the article

  • How to select the first property with unknown name and first item from array in JSON

    - by Oscar Godson
    I actually have two questions, both are probably simple, but for some odd reason I cant figure it out... I've worked with JSON 100s of times before too! but here is the JSON in question: {"69256":{ "streaminfo":{ "stream_ID":"1025", "sourceowner_ID":"2", "sourceowner_avatar":"http:\/\/content.nozzlmedia.com\/images\/sourceowner_avatar2.jpg", "sourceownertype_ID":"1", "stream_name":"Twitter", "streamtype":"Social media" "appsarray":[] }, "item":{ "headline":"Charboy", "main_image":"http:\/\/content.nozzlmedia.com\/images\/author_avatar173212.jpg", "summary":"ate a tomato and avocado for dinner...", "nozzl_captured":"2010-05-12 23:02:12", "geoarray":[{ "state":"OR", "county":"Multnomah", "city":"Portland", "neighborhood":"Downtown", "zip":"97205", "street":"462 SW 11th Ave", "latitude":"45.5219", "longitude":"-122.682" }], "full_content":"ate a tomato and avocado for dinner tonight. such tasty foods. just enjoyable.", "body_text":"ate a tomato and avocado for dinner tonight. such tasty foods. just enjoyable.", "author_name":"Charboy", "author_avatar":"http:\/\/content.nozzlmedia.com\/images\/author_avatar173212.jpg", "fulltext_url":"http:\/\/twitter.com\/charboy\/statuses\/13889868936", "leftovers":{ "twitter_id":"tag:search.twitter.com,2005:13889868936", "date":"2010-05-13T02:59:59Z", "location":"iPhone: 45.521866,-122.682262" }, "wordarray":{ "0":"ate", "1":"tomato", "2":"avocado", "3":"dinner", "4":"tonight", "5":"tasty", "6":"foods", "7":"just", "8":"enjoyable", "9":"Charboy", "11":"Twitter", "13":"state:OR", "14":"county:Multnomah, OR", "15":"city:Portland, OR", "16":"neighborhood:Downtown", "17":"zip:97205" } } } } Question 1: How do I loop through each item (69256) when the number is random? e.g. item 1 is 123, item2 is 646? Like, for example, a normal JSON feed would have something like: {'item':{'blah':'lorem'},'item':{'blah':'ipsum'}} the JS would be like console.log(item.blah) to return lorem then ipsum in a loop How do I do it when i dont know the first item of the object? Question 2: How do I select items from the geoarray object? I tried: json.test.item.geoarray.latitude and json.test.item.geoarray['latitude']

    Read the article

  • How to create a timer the right way?

    - by mystify
    I always have an class which needs to set up a timer for as long as the object is alive. Typically an UIView which does some animation. Now the problem: If I strongly reference the NSTimer I create and invalidate and release the timer in -dealloc, the timer is never invalidated or released because -dealloc is never called, since the run loop maintains a strong reference to the target. So what can I do? If I cant hold a strong ref to the timer object, this is also bad because maybe I need a ref to it to be able to stop it. And a weak ref on a object is not good, because maybe i'm gonna access it when it's gone. So better have a retain on what I want to keep around. How are you guys solving this? must the superview create the timer? is that better? or should i really just make a weak ref on it and keep in mind that the run loop holds a strong ref on my timer for me, as long as it's not invalidated?

    Read the article

  • My first c# app and first null object exception

    - by Fresheyeball
    Total noob here. This is my first c# attempt, its a console application that simulates a drinking game called 'Left Right Center'. In the console I receive the following: CONSOLE Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at LeftRightCenter.MainClass.Main (System.String[] args) [0x00038] in /Users/apple/Projects/LearningC/LearningC/Main.cs:80 [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object at LeftRightCenter.MainClass.Main (System.String[] args) [0x00038] in /Users/apple/Projects/LearningC/LearningC/Main.cs:80 C# using System; namespace LeftRightCenter { class Player { //fields private int _quarters = 4; public int Quarters { get{ return _quarters; } set{ _quarters += value; } } public Player (string name) { } } class Dice { Random random = new Random(); public int Roll () { random = new Random (); int diceSide; diceSide = random.Next (0, 6); diceSide = (diceSide > 2) ? 3 : diceSide; return diceSide; } } class MainClass { static int activePlayer = 0; static int theCup = 0; static Player[] thePlayers = { new Player ("Jessica"), new Player ("Isaac"), new Player ("Ed"), new Player ("Bella"), new Player ("Elisa"), new Player ("Fake RedHead"), new Player ("Linda"), new Player ("MJ"), new Player ("Irene"), new Player("Devin") }; static Dice[] theDice = new Dice[2]; private static void MoveQuarter (int direction) { int numberOfPlayers = thePlayers.Length - 1; switch (direction) { case 0: thePlayers [activePlayer].Quarters = -1; theCup++; break; case 1: thePlayers [activePlayer].Quarters = -1; int leftPlayer = (activePlayer == 0) ? numberOfPlayers : activePlayer - 1; thePlayers [leftPlayer].Quarters = +1; break; case 2: thePlayers [activePlayer].Quarters = -1; int rightPlayer = (activePlayer == numberOfPlayers) ? 0 : activePlayer + 1; thePlayers [rightPlayer].Quarters = +1; break; } } public static void Main (string[] args) { int cupEndPoint = thePlayers.Length * 4 - 1; while (theCup < cupEndPoint) { foreach (Dice rattle in theDice) { if (thePlayers [activePlayer].Quarters > 0) { MoveQuarter (rattle.Roll ()); // this line seems to be the problem } } Console.WriteLine ("{0} Quarters In the Cup", theCup); } } } } I have no idea what the problem is or why, and my googling have proven more use confusing than helpful.

    Read the article

  • Difference between Breadth First Search, and Iterative deepening

    - by theraven
    I understand BFS, and DFS, but for the life of me cannot figure out the difference between iterative deepening and BFS. Apparently Iterative deepening has the same memory usage as DFS, but I am unable to see how this is possible, as it just keeps expanding like BFS. If anyone can clarify that would be awesome. tree to work on if required: A / \ B C / / \ D E F

    Read the article

  • Test-First development tool for SQL Server 2005?

    - by Jeff Jones
    For several years I have been using a testing tool called qmTest that allows me to do test-driven database development for some Firebird databases. I write a test for a new feature (table, trigger, stored procedure, etc.) until it fails, then modify the database until the test passes. If necessary, I do more work on the test until it fails again, then modify the database until the test passes. Once the test for the feature is complete and passes 100% of the time, I save it in a suite of other tests for the database. Before moving on to another test or a deployment, I run all the tests as a suite to make sure nothing is broken. Tests can have dependencies on other tests, and the results are recorded and displayed in a browser. Nothing new here, I am sure. Our shop is aiming toward standardizing on MSSQLServer and I want to use the same procedure for developing our databases. Does anyone know of tools that allow or encourage this kind of development? I believe the Team System does, but we do not own that at this point, and probably will not for some time. I am not opposed to scripting, but would welcome a more graphical environment. Any suggestions?

    Read the article

  • EF Code First Detached Entity not updating object reference

    - by Alvaro
    I'm posting the exact entity: public class Person : ContactableEntity { public Plan Plan { get; set; } public int Record { get; set; } public int PersonTypeValue { get; set; } } I'm using the following code to update in a disconected context fashion: public void Update(DbSet MySet, object Obj) { MySet.Attach(Obj); var Entry = this.Entry(Obj); Entry.State = EntityState.Modified; this.SaveChanges(); } This is a method exposed by my dbContext Called this way: PersistentManager.Update(PersistentManager.Personas,UpdatedPersona); The problem is, EF will update any property but the referenced Plan object. Can someone tell me where is the mistake? In advance : the entity reaches the point of update with all the properties correctly set. EF just fails to update the FK in the Database (no exception though)

    Read the article

  • Question on First Order Logic formula

    - by none
    Hi, Can someone validate the following. I am supposed to 'write a formula asserting that for every number there's a unique next number...true for integers for instance' L(x,y) means x is smaller than y the intended Domain is the Integer numbers Can I give ∀x ∀y [ x<y ⇒ ( ∃z : z<x ∨ y<z ) ] Thanks

    Read the article

  • Code First CTP4 Error Mapper

    - by user506062
    Why my type always returns 0? public class PartiesConfiguracao : EntityConfiguration<Parties> { public PartiesConfiguracao() { MapHierarchy() .Case<Parties>(parties => new { PartiesID = parties.ID, ShipInstructionID = parties.ShipInstruction.ID, ContactID = parties.Contact.ID, parties.Name, Type = 0, parties.CNPJ, parties.Address }) .Case<Shipper>(parties => new { Type = 1 }) .Case<Consignee>(parties => new { Type = 2 }) .Case<Notify>(parties => new { Type = 3 }) .Case<Forwarder>(parties => new { Type = 4 }) .ToTable("si_Parties"); } }

    Read the article

  • Accessing a Class Member from a First-Class Function

    - by dbyrne
    I have a case class which takes a list of functions: case class A(q:Double, r:Double, s:Double, l:List[(Double)=>Double]) I have over 20 functions defined. Some of these functions have their own parameters, and some of them also use the q, r, and s values from the case class. Two examples are: def f1(w:Double) = (d:Double) => math.sin(d) * w def f2(w:Double, q:Double) = (d:Double) => d * q * w The problem is that I then need to reference q, r, and s twice when instantiating the case class: A(0.5, 1.0, 2.0, List(f1(3.0), f2(4.0, 0.5))) //0.5 is referenced twice I would like to be able to instantiate the class like this: A(0.5, 1.0, 2.0, List(f1(3.0), f2(4.0))) //f2 already knows about q! What is the best technique to accomplish this? Can I define my functions in a trait that the case class extends? EDIT: The real world application has 7 members, not 3. Only a small number of the functions need access to the members. Most of the functions don't care about them.

    Read the article

  • EF4 Code-First CTP5 Many-to-one

    - by Kevin McKelvin
    I've been trying to get EF4 CTP5 to play nice with an existing database, but struggling with some basic mapping issues. I have two model classes so far: public class Job { [Key, Column(Order = 0)] public int JobNumber { get; set; } [Key, Column(Order = 1)] public int VersionNumber { get; set; } public virtual User OwnedBy { get; set; } } and [Table("Usernames")] public class User { [Key] public string Username { get; set; } public string EmailAddress { get; set; } public bool IsAdministrator { get; set; } } And I have my DbContext class exposing those as IDbSet I can query my users, but as soon as I added the OwnedBy field to the Job class I began getting this error in all my tests for the Jobs: Invalid column name 'UserUsername'. I want this to behave like NHibernate's many-to-one, whereas I think EF4 is treating it as a complex type. How should this be done?

    Read the article

  • Save VM properties with EF code first

    - by Julien
    I thought this would be simple but can't find any good examples. public Class BookVm : ImplementsPropertyChanged { public int BookId {get;set;} private bool _favorite; public bool Favorite { get { return _favorite; } set { _favorite = value; OnPropertyChanged("Favorite"); MyDbContext.SaveChanges() // this does not work } } Then in my XAML bound to Book <CheckBox Content="Favorite" IsChecked="{Binding Favorite}" /> How and when do I call SaveChanges() on my DatabaseContext? I don't want to implement a save button. If I intercept the PropertyChange event and call SaveChanges, nothing seems to happen. My object is modified in memory but the database does not see a change. My BookVm class is created on application startup like so: foreach (var book in MyDbContext.Books) Books.Add(book); Where Books is an ObservableCollection<Book> in my MainWindowVm

    Read the article

  • Code First entity framework connection string

    - by Suneel Dixit
    I have 3 class projects in my solutions. 1. MVC4 project 2. Domain 3. Tests In the MVC4 project I have added a web.config file with the connection string as <add name="EfDbContext" connectionString="Data Source=.;Initial Catalog=SportsStore;Integrated Security=true;" providerName="System.Data.SqlClient"/> I have a class by name EfDbContext in Domain project which inherits DbContext. When I view the website in browser, I get the server not found error. I debugged the EfDbContext class and found that the Database.Connection.ConnectionString is set to \SqlExpress with database as EfDbContext. Why is that?

    Read the article

  • Retrieving only the first record or record at a certain index in LINQ

    - by vik20000in
    While working with data it’s not always required that we fetch all the records. Many a times we only need to fetch the first record, or some records in some index, in the record set. With LINQ we can get the desired record very easily with the help of the provided element operators. Simple get the first record. If you want only the first record in record set we can use the first method [Note that this can also be done easily done with the help of the take method by providing the value as one].     List<Product> products = GetProductList();      Product product12 = (         from prod in products         where prod.ProductID == 12         select prod)         .First();   We can also very easily put some condition on which first record to be fetched.     string[] strings = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };     string startsWithO = strings.First(s => s[0] == 'o');  In the above example the result would be “one” because that is the first record starting with “o”.  Also the fact that there will be chances that there are no value returned in the result set. When we know such possibilities we can use the FirstorDefault() method to return the first record or incase there are no records get the default value.        int[] numbers = {};     int firstNumOrDefault = numbers.FirstOrDefault();  In case we do not want the first record but the second or the third or any other later record then we can use the ElementAt() method. In the ElementAt() method we need to pass the index number for which we want the record and we will receive the result for that element.      int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };      int fourthLowNum = (         from num in numbers         where num > 5         select num )         .ElementAt(1); Vikram

    Read the article

  • Can it be done in a more elegant way with the Swing Timer?

    - by Roman
    Bellow is the code for the simplest GUI countdown. Can the same be done in a shorter and more elegant way with the usage of the Swing timer? import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; public class CountdownNew { static JLabel label; // Method which defines the appearance of the window. public static void showGUI() { JFrame frame = new JFrame("Simple Countdown"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); label = new JLabel("Some Text"); frame.add(label); frame.pack(); frame.setVisible(true); } // Define a new thread in which the countdown is counting down. public static Thread counter = new Thread() { public void run() { for (int i=10; i>0; i=i-1) { updateGUI(i,label); try {Thread.sleep(1000);} catch(InterruptedException e) {}; } } }; // A method which updates GUI (sets a new value of JLabel). private static void updateGUI(final int i, final JLabel label) { SwingUtilities.invokeLater( new Runnable() { public void run() { label.setText("You have " + i + " seconds."); } } ); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { showGUI(); counter.start(); } }); } }

    Read the article

  • VLC 2.0.3 on Lubuntu 12.04: No audio?

    - by drezabek
    I am on Lubuntu 12.04, and I have installed VLC media player version 2.0.3. When I try and play an audio file, it appears to load fine, and the media position bar displays the progress, and it says it is playing, but I can't here any thing through my speakers. I can hear game audio, web audio, and audio from SMPlayer just fine, but with VLC, I can't here anything. Below is the "Messages" output with the verbosity option set to "2 (debug)" main debug: processing request item: The Bottom, node: Playlist, skip: 0 main debug: resyncing on The Bottom main debug: The Bottom is at 0 main debug: starting playback of the new playlist item main debug: resyncing on The Bottom main debug: The Bottom is at 0 main debug: creating new input thread main debug: Creating an input for 'The Bottom' main debug: TIMER input launching for 'Floex - Machinarium Soundtrack - 01 The Bottom.flac' : 23.706 ms - Total 23.706 ms / 1 intvls (Avg 23.706 ms) main debug: using timeshift granularity of 50 MiB, in path '/tmp' main debug: `file:///home/doug/Music/unsorted/Floex%20-%20Machinarium%20Soundtrack/Floex%20-%20Machinarium%20Soundtrack%20-%2001%20The%20Bottom.flac' gives access `file' demux `' path `/home/doug/Music/unsorted/Floex%20-%20Machinarium%20Soundtrack/Floex%20-%20Machinarium%20Soundtrack%20-%2001%20The%20Bottom.flac' main debug: creating demux: access='file' demux='' location='/home/doug/Music/unsorted/Floex%20-%20Machinarium%20Soundtrack/Floex%20-%20Machinarium%20Soundtrack%20-%2001%20The%20Bottom.flac' file='/home/doug/Music/unsorted/Floex - Machinarium Soundtrack/Floex - Machinarium Soundtrack - 01 The Bottom.flac' main debug: looking for access_demux module: 3 candidates main debug: no access_demux module matching "file" could be loaded main debug: TIMER module_need() : 2.332 ms - Total 2.332 ms / 1 intvls (Avg 2.332 ms) main debug: creating access 'file' location='/home/doug/Music/unsorted/Floex%20-%20Machinarium%20Soundtrack/Floex%20-%20Machinarium%20Soundtrack%20-%2001%20The%20Bottom.flac', path='/home/doug/Music/unsorted/Floex - Machinarium Soundtrack/Floex - Machinarium Soundtrack - 01 The Bottom.flac' main debug: looking for access module: 2 candidates filesystem debug: opening file `/home/doug/Music/unsorted/Floex - Machinarium Soundtrack/Floex - Machinarium Soundtrack - 01 The Bottom.flac' main debug: using access module "filesystem" main debug: TIMER module_need() : 0.762 ms - Total 0.762 ms / 1 intvls (Avg 0.762 ms) main debug: Using stream method for AStream* main debug: starting pre-buffering main debug: received first data after 0 ms main debug: pre-buffering done 1024 bytes in 0s - 43478 KiB/s main debug: looking for stream_filter module: 7 candidates main debug: no stream_filter module matching "any" could be loaded main debug: TIMER module_need() : 0.236 ms - Total 0.236 ms / 1 intvls (Avg 0.236 ms) main debug: looking for stream_filter module: 1 candidate main debug: using stream_filter module "stream_filter_record" main debug: TIMER module_need() : 0.156 ms - Total 0.156 ms / 1 intvls (Avg 0.156 ms) main debug: creating demux: access='file' demux='' location='/home/doug/Music/unsorted/Floex%20-%20Machinarium%20Soundtrack/Floex%20-%20Machinarium%20Soundtrack%20-%2001%20The%20Bottom.flac' file='/home/doug/Music/unsorted/Floex - Machinarium Soundtrack/Floex - Machinarium Soundtrack - 01 The Bottom.flac' main debug: looking for demux module: 54 candidates flacsys debug: Picture type=3 mime=image/png description='' file length=679371 qt4 debug: IM: Setting an input main debug: looking for packetizer module: 21 candidates main debug: using packetizer module "packetizer_flac" main debug: TIMER module_need() : 0.211 ms - Total 0.211 ms / 1 intvls (Avg 0.211 ms) main debug: using demux module "flacsys" main debug: TIMER module_need() : 4.023 ms - Total 4.023 ms / 1 intvls (Avg 4.023 ms) main debug: looking for a subtitle file in /home/doug/Music/unsorted/Floex - Machinarium Soundtrack/ main debug: looking for meta reader module: 2 candidates main debug: using meta reader module "taglib" main debug: TIMER module_need() : 5.245 ms - Total 5.245 ms / 1 intvls (Avg 5.245 ms) main debug: removing module "taglib" main debug: `file:///home/doug/Music/unsorted/Floex%20-%20Machinarium%20Soundtrack/Floex%20-%20Machinarium%20Soundtrack%20-%2001%20The%20Bottom.flac' successfully opened main debug: selecting program id=0 main debug: looking for decoder module: 30 candidates main debug: using decoder module "flac" main debug: TIMER module_need() : 0.442 ms - Total 0.442 ms / 1 intvls (Avg 0.442 ms) main debug: Buffering 0% flac debug: decode STREAMINFO flac debug: channels:2 samplerate:44100 bitspersamples:16 flac debug: STREAMINFO decoded main debug: Buffering 30% main debug: recycling audio output main debug: looking for audio output module: 3 candidates main debug: Buffering 61% pulse debug: using stereo channel map pulse debug: using library version 1.1.0 pulse debug: (compiled with version 1.1.0, protocol 26) main debug: Buffering 92% main debug: Stream buffering done (371 ms in 2 ms) pulse debug: connected locally to unix:/home/doug/.pulse/dce22254e867f905188a2ce200000003-runtime/native as client #14 pulse debug: using protocol 26, server protocol 26 pulse debug: using buffer metrics: maxlength=4194304, tlength=9880, prebuf=0, minreq=3528 pulse debug: connected to sink 0: alsa_output.pci-0000_00_14.2.analog-stereo main debug: using audio output module "pulse" main debug: TIMER module_need() : 4.571 ms - Total 4.571 ms / 1 intvls (Avg 4.571 ms) main debug: output 's16l' 44100 Hz Stereo frame=1 samples/4 bytes main debug: mixer 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes main debug: filter(s) 'f32l'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo main debug: looking for audio filter module: 14 candidates audio_format debug: f32l->s16l, bits per sample: 32->16 main debug: using audio filter module "audio_format" main debug: TIMER module_need() : 0.187 ms - Total 0.187 ms / 1 intvls (Avg 0.187 ms) main debug: conversion pipeline completed main debug: looking for audio mixer module: 2 candidates main debug: using audio mixer module "float32_mixer" main debug: TIMER module_need() : 0.125 ms - Total 0.125 ms / 1 intvls (Avg 0.125 ms) main debug: input 's16l' 44100 Hz Stereo frame=1 samples/4 bytes main debug: looking for audio filter module: 1 candidate scaletempo debug: format: 44100 rate, 2 nch, 4 bps, fl32 scaletempo debug: params: 30 stride, 0.200 overlap, 14 search scaletempo debug: 1.000 scale, 1323.000 stride_in, 1323 stride_out, 1059 standing, 264 overlap, 617 search, 2204 queue, fl32 mode main debug: using audio filter module "scaletempo" main debug: TIMER module_need() : 0.233 ms - Total 0.233 ms / 1 intvls (Avg 0.233 ms) main debug: filter(s) 's16l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo pulse debug: listing sink alsa_output.pci-0000_00_14.2.analog-stereo (0): Built-in Audio Analog Stereo main debug: looking for audio filter module: 14 candidates audio_format debug: s16l->f32l, bits per sample: 16->32 main debug: using audio filter module "audio_format" main debug: TIMER module_need() : 0.147 ms - Total 0.147 ms / 1 intvls (Avg 0.147 ms) main debug: conversion pipeline completed pulse debug: base volume: 65536 main debug: looking for audio filter module: 1 candidate equalizer debug: equalizer loaded for 44100 Hz with 10 bands 2 pass equalizer debug: 60 Hz -> factor:0.000000 alpha:0.003013 beta:0.993973 gamma:1.993901 equalizer debug: 170 Hz -> factor:0.000000 alpha:0.008490 beta:0.983019 gamma:1.982437 equalizer debug: 310 Hz -> factor:0.000000 alpha:0.015374 beta:0.969252 gamma:1.967331 equalizer debug: 600 Hz -> factor:0.000000 alpha:0.029328 beta:0.941343 gamma:1.934254 equalizer debug: 1000 Hz -> factor:0.000000 alpha:0.047918 beta:0.904163 gamma:1.884869 equalizer debug: 3000 Hz -> factor:0.000000 alpha:0.130408 beta:0.739184 gamma:1.582718 equalizer debug: 6000 Hz -> factor:0.000000 alpha:0.226555 beta:0.546889 gamma:1.015267 equalizer debug: 12000 Hz -> factor:0.000000 alpha:0.344937 beta:0.310127 gamma:-0.181410 equalizer debug: 14000 Hz -> factor:0.000000 alpha:0.366438 beta:0.267123 gamma:-0.521151 equalizer debug: 16000 Hz -> factor:0.000000 alpha:0.379009 beta:0.241981 gamma:-0.808451 main debug: using audio filter module "equalizer" main debug: TIMER module_need() : 0.353 ms - Total 0.353 ms / 1 intvls (Avg 0.353 ms) main debug: filter(s) 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo main debug: conversion pipeline completed main debug: looking for visualization2 module: 1 candidate main debug: looking for text renderer module: 2 candidates freetype debug: Building font databases. freetype debug: Took 0 microseconds freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf freetype debug: using fontsize: 2 main debug: using text renderer module "freetype" main debug: TIMER module_need() : 3.278 ms - Total 3.278 ms / 1 intvls (Avg 3.278 ms) main debug: looking for video filter2 module: 18 candidates swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: RGBA with scaling using Bicubic (good quality) main debug: using video filter2 module "swscale" main debug: TIMER module_need() : 1.037 ms - Total 1.037 ms / 1 intvls (Avg 1.037 ms) main debug: looking for video filter2 module: 18 candidates yuvp debug: YUVP to YUVA converter main debug: using video filter2 module "yuvp" main debug: TIMER module_need() : 0.156 ms - Total 0.156 ms / 1 intvls (Avg 0.156 ms) main debug: Deinterlacing available main debug: deinterlace 0, mode blend, is_needed 0 main debug: Opening vout display wrapper main debug: looking for vout display module: 6 candidates main debug: looking for vout window xid module: 4 candidates qt4 debug: requesting video... qt4 debug: Video was requested 0, 0 main debug: using vout window xid module "qt4" main debug: TIMER module_need() : 61.671 ms - Total 61.671 ms / 1 intvls (Avg 61.671 ms) main debug: looking for inhibit module: 2 candidates main debug: using inhibit module "xdg_screensaver" main debug: TIMER module_need() : 0.336 ms - Total 0.336 ms / 1 intvls (Avg 0.336 ms) xdg_screensaver debug: started xdg-screensaver (PID = 6682) xcb_xv debug: connected to X11.0 server xcb_xv debug: vendor : The X.Org Foundation xcb_xv debug: version: 11103000 xcb_xv debug: using screen 0x15a xcb_xv debug: using XVideo extension v2.2 xcb_xv debug: using adaptor NV17 Video Texture xcb_xv debug: using port 310 xcb_xv debug: using image format 0x30323449 xcb_xv debug: using X11 visual ID 0x21 (depth: 24) xcb_xv debug: using X11 window 0x03400000 xcb_xv debug: using X11 graphic context 0x03400002 main debug: VoutDisplayEvent 'fullscreen' 0 main debug: VoutDisplayEvent 'resize' 800x500 window main debug: using vout display module "xcb_xv" main debug: TIMER module_need() : 69.890 ms - Total 69.890 ms / 1 intvls (Avg 69.890 ms) main debug: original format sz 800x500, of (0,0), vsz 800x500, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0 main debug: removing module "freetype" main debug: looking for text renderer module: 2 candidates freetype debug: Building font databases. freetype debug: Took 0 microseconds freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf freetype debug: using fontsize: 2 main debug: using text renderer module "freetype" main debug: TIMER module_need() : 4.552 ms - Total 4.552 ms / 1 intvls (Avg 4.552 ms) main debug: using visualization2 module "visual" main debug: TIMER module_need() : 84.104 ms - Total 84.104 ms / 1 intvls (Avg 84.104 ms) main debug: filter(s) 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo main debug: conversion pipeline completed main debug: filter(s) 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo main debug: conversion pipeline completed main debug: filter(s) 'f32l'->'f32l' 48510 Hz->44100 Hz Stereo->Stereo main debug: looking for audio filter module: 14 candidates main debug: using audio filter module "samplerate" main debug: TIMER module_need() : 0.375 ms - Total 0.375 ms / 1 intvls (Avg 0.375 ms) main debug: conversion pipeline completed main debug: End of audio preroll main debug: Decoder buffering done in 91 ms main warning: PTS is out of range (-9269), dropping buffer pulse debug: deferring start (190703 us) main debug: looking for video blending module: 1 candidate main debug: using video blending module "blend" main debug: TIMER module_need() : 0.275 ms - Total 0.275 ms / 1 intvls (Avg 0.275 ms) main debug: Detected interlaced video main debug: deinterlace 0, mode blend, is_needed 1 xcb_xv debug: display is visible pulse debug: starting deferred pulse warning: too late by 93760 us pulse debug: changed sample rate to 44186 Hz pulse debug: started pulse warning: too late by 94474 us pulse debug: changed sample rate to 44229 Hz pulse warning: too late by 93532 us pulse debug: changed sample rate to 44272 Hz pulse warning: too late by 92829 us pulse debug: changed sample rate to 44315 Hz pulse warning: too late by 92132 us pulse debug: changed sample rate to 44358 Hz xcb_xv debug: display is visible pulse warning: too late by 91534 us pulse debug: changed sample rate to 44401 Hz xcb_xv debug: display is visible pulse warning: too late by 89482 us pulse debug: changed sample rate to 44440 Hz xcb_xv debug: display is visible xcb_xv debug: display is visible pulse warning: too late by 87529 us pulse debug: changed sample rate to 44479 Hz pulse warning: too late by 84577 us pulse debug: changed sample rate to 44504 Hz main debug: auto hiding mouse cursor pulse warning: too late by 78562 us pulse debug: changed sample rate to 44492 Hz pulse warning: too late by 68015 us pulse debug: changed sample rate to 44422 Hz xcb_xv debug: display is visible xcb_xv debug: display is visible xcb_xv debug: display is visible xcb_xv debug: display is visible main debug: auto hiding mouse cursor pulse debug: changed sample rate to 44336 Hz xcb_xv debug: display is visible xcb_xv debug: display is visible xcb_xv debug: display is visible main debug: auto hiding mouse cursor I have had issues with VLC in the past- the audio quality was extremely crackly, as if the headphone jack was plugged in only half way, and the sounds were extremely sharp and caused my speakers to make a ringing/vibrating noise... It would eventually start working after I messed around with the audio settings, but it happened every restart. I eventually switched to SMPlayer, but now I need some of the features that VLC offers, but I still can't use VLC. At this point, the audio can not be heard at all, and the method I used before, messing around with the audio settings, isn't getting me anywhere. (note, I reposted this on VideoLan's forums, link is here: http://forum.videolan.org/viewtopic.php?f=13&t=104726) Please let me know if you need more information, or are confused by something I posted! Thanks!

    Read the article

  • How to apply effects that occur (or change) over time to characters in a game?

    - by Joshua Harris
    So assume that I have a system that applies Effects to Characters like so: public class Character { private Collection<Effect> _effects; public void AddEffect (Effect e) { e.ApplyTo(this); _effects.Add(e); } public void RemoveEffect (Effect e) { e.RemoveFrom(this); _effects.Remove(e); } } public interface Effect { public void ApplyTo (Character character); public void RemoveFrom (Character character); } Example Effect: Armor Buff for 5 seconds. void someFunction() { // Do Stuff ... Timer armorTimer = new Timer(5 seconds); ArmorBuff armorbuff = new ArmorBuff(); character.AddEffect(armorBuff); armorTimer.Start(); // Do more stuff ... } // Some where else in code public void ArmorTimer_Complete() { character.RemoveEffect(armorBuff); } public class ArmorBuff implements Effect { public void applyTo(Character character) { character.changeArmor(20); } public void removeFrom(Character character) { character.changeArmor(-20); } } Ok, so this example would buff the Characters armor for 5 seconds. Easy to get working. But what about effects that change over the duration of the effect being applied. Two examples come to mind: Damage Over Time: 200 damage every second for 3 seconds. I could mimic this by applying an Effect that lasts for 1 second and has a counter set to 3, then when it is removed it could deal 200 damage, clone itself, decrement the counter of the clone, and apply the clone to the character. If it repeats this until the counter is 0, then you got a damage over time ability. I'm not a huge fan of this approach, but it does describe the behavior exactly. Degenerating Speed Boost: Gain a speed boost that degrades over 3 seconds until you return to your normal speed. This is a bit harder. I can basically do the same thing as above except having timers set to some portion of a second, such that they occur fast enough to give the appearance of degenerating smoothly over time (even though they are really just stepping down incrementally). I feel like you could get away with only 12 steps over a second (maybe less, I would have to test it and see), but this doesn't seem very elegant to me. The only other way to implement this effect would be to change the system so that the Character checks the _effects collection for effects that alter any of the properties any time that they are being used. I could handle this in functions like getCurrentSpeed() and getCurrentArmor(), but you can imagine how much of a hassle it would be to have that kind of overhead every time you want to do a calculation with movement speed (which would be every time you move your character). Is there a better way to deal with these kinds of effects or events?

    Read the article

  • Qt: How to use QTimer to print a message to a QTextBrowser every 10 seconds?

    - by Aaron McKellar
    Hello, I have working at this for hours and cannot figure it out nor can I find any help online that works. Basically the gist of what I am trying to accomplish is to have a Qt GUI with a button and a QTextBrowser. When I push the button I want it to diplay a message and then keep printing this message every 10 seconds. I figured I would use QTimer because it makes sense to have a timer to diplay the message every 10 seconds. When I originally implemented this into my buttonClicked() SLOT it caused the program to freeze. I looked online for a solution and found QApplication::processEvents(). So basically in my function I had something like this: while(1) { QTimer *timer; connect(...) //omitted parameters for this example timer.start(10000); ui->diplay->append("Message"); while(timer.isActive()) { QApplication::processEvents() } } I figured it would break out of the timer.isActive() while loop but it won't it simply stays in there. So I figured this is a threading issue. So I figured out how to use QThreads but I still can't get it to work. Basically when I create a thread with a timer on it and the thread tells the timer to start, the program closes and the console says "The program has unexpectedly finished". There has to be an easy way to do this but my track record with Qt has always been that th

    Read the article

  • Automatically capitalize first letter of first word in a new sentence in LaTeX

    - by Tom Hagen
    I know one of LaTeX's bragging points is that it doesn't have this Microsoftish behavior. Nevertheless, it's sometimes useful. LaTeX already adds an extra space after you type a (non-backslashed) period, so it should be possible to make it automatically capitalize the following letter as well. Is there an obvious way to write a macro that does this, or is there a LaTeX package that does it already?

    Read the article

  • First Come, First Served process scheduling

    - by user253530
    i have 4 processes: p1 - bursts 5, priority: 3 p2 - bursts 8, priority: 2 p3 - bursts 12, priority: 2 p4 - bursts 6, priority: 1 Assuming that all processes arrive at the scheduler at the same time what is the average response time and average turnaround time? For FCFS is it ok to have them in the order p1, p2, p3, p4 in the execution queue?

    Read the article

  • RC of Entity Framework 4.1 (which includes EF Code First)

    - by ScottGu
    Last week the data team shipped the Release Candidate of Entity Framework 4.1.  You can learn more about it and download it here. EF 4.1 includes the new “EF Code First” option that I’ve blogged about several times in the past.  EF Code First provides a really elegant and clean way to work with data, and enables you to do so without requiring a designer or XML mapping file.  Below are links to some tutorials I’ve written in the past about it: Code First Development with Entity Framework 4.x EF Code First: Custom Database Schema Mapping Using EF Code First with an Existing Database The above tutorials were written against the CTP4 release of EF Code First (and so some APIs might be a little different) – but the concepts and scenarios outlined in them are the same as with the RC. Go Live License Last week’s EF 4.1 RC ships with a “go live” license that enables you to use it in production environments.  The final release of EF 4.1 will ship within the next 4 weeks and will be 100% API compatible with the RC release. Improvements with the RC The RC includes several improvements and enhancements.  The EF team has a good blog post summarizing the RC changes.  Scott Hanselman also has a nice video interview with the data team that talks more about the release. One of my favorite improvements introduced with last week’s RC is its support for medium trust security.  This enables you to use EF 4.1 (and code-first) within low-cost ASP.NET shared hosting web environments – without requiring a hoster to install anything to use it. EF 4.1 also now supports validation with not only code-first scenarios, but also model-first and database-first workflows.  Upgrading from previous releases The RC does include a few API tweaks and changes from the prior CTP builds.  Read the release notes that come with the release to get a more detailed listing of the changes. John Papa also has an excellent Upgrading to EF 4.1 RC blog post that describes the steps he took when upgrading a large project he wrote with the previous CTP5 release.  The work to upgrade is pretty straight forward and easy – use his write-up as a guide on how to quickly update projects of your own. NuGet Package Rename One of the changes that the data team made between the CTP5 and RC releases was to rename the NuGet package name from “EFCodeFirst” to “EntityFramework”. They decided to make this change since the EF 4.1 release now includes several additions above and beyond just code first. If you already have installed the “EFCodeFirst” NuGet package, you’ll want to uninstall it and then install the new “EntityFramework” NuGet package.  John Papa’s blog post details the exact steps on how to do this (it only takes ~20 seconds to do this). More EF Tutorials Julie Lerman has created some nice whitepapers and tutorials for MSDN that show using the new EF4 and EF 4.1 feature set. Click here to find links to read and watch them. Summary I’m really excited about the EF 4.1 release that will be shipping next month.  It significantly improves the Entity Framework, and makes it even easier and cleaner to work with data inside of .NET.  You can take advantage of it within all ASP.NET projects (including both Web Forms and MVC), within client projects using Windows Forms and WPF, and within other project types like WCF, Console and Services.  You can use NuGet to easily install it within all of them. Hope this helps, Scott P.S. I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

    Read the article

  • Accidently system timer speed up

    - by Grind Core
    Laptop: Acer 5750zg I've found this issue in latest Ubuntu versions (13.04, 14.04) in all desktop environment. When I'm typing something in text field, randomly I get ~5..20 same symbols and everything speed up. It's happen few times per one minute and start from normal speed, slowly rising to super boost animation and other processes like CPU monitor, clock, window animation, etc. I think something wrong with system clock. Please help to figure out how to fix it.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >