Search Results

Search found 9744 results on 390 pages for 'k means'.

Page 22/390 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Ruby on Rails Join Table Associations

    - by Eef
    Hey, I have a Ruby on Rails application setup like so: User Model has_and_belongs_to_many :roles Role Model has_many :transactions has_and_belongs_to_many :users Transaction Model belongs_to :role This means that a join table is used called roles_users and it also means that a user can only see the transactions that have been assigned to them through roles, usage example: user = User.find(1) transactions = user.roles.first.transactions This will return the transactions which are associated with the first role assigned to the user. If a user has 2 roles assigned to them, at the moment to get the transactions associated with the second role I would do: transactions = user.roles.last.transactions I am basically trying to figure out a way to setup an association so I can grab the user's transactions via something like this based on the roles defined in the association between the user and roles: user = User.find(1) transactions = user.transactions I am not sure if this is possible? I hope you understand what I am trying to do.

    Read the article

  • setup related qus..

    - by Ashwin
    i have one qus related to add-in installation.......... qus is: i want to combine shared addin for msword created in visual studio 2005, to my project that means if i install my product then addin is also install with this........ and if i uninstall my product add-in is also uninstall........... and i also have another qus other than addin i want to give language choosen option at installation time that means if user want to select hindi then our product install in hindi language and if select english than install in english... how this facility give in setup creation plzzz discribe in detail

    Read the article

  • iPhone App Crash - Error ?

    - by Skinkemus
    Hi there.. Im new im making in making iPhone apps so i have no idea what this error means ? I saw another post with this error but i couldn't figure out how to get it right.. i get this error: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ImageView.' and i have no clue what this means ? 0.o can some help me here ? Thanks!

    Read the article

  • How to test Calendar Event on emulator?

    - by Pranav
    Hi everybody, I am developing an application which requires to add Calendar event. I have written the code for inserting event to the calendar. But whenever i run my application, everytime i get error that "Fail to find provider info for Calendar" and it also throws me NullPointerException error. So, what it means and i found that emulator doesn't provide Calendar application in-built. I think if the Android Emulator doesn't have Calender API, so, naturally, it will not have any database URI in the emulator whereas the Contact has URI --"content://contacts/people". I also found the URI for Calendar as "content://calendar/calendars" but it doesn't work and it means that it gives me error cause of missing Calendar application. Can anybody clarify me, with suggestions regarding Calendar Event? Which is the way to test my application with Calendar Event? I really need your help. Please needful for the same. Thanks. Regards, Pranav

    Read the article

  • What Windows editor has CORRECT EOL whitespace handling?

    - by blueshift
    I'm looking for a Windows text editor for programming that handles EOL whitespace CORRECTLY, which for my idea of correct means: Strip all EOL whitespace on save, EXCEPT on lines that I haven't edited. This is to minimise the amount of EOL whitespace evil in my world, but not pollute SCM diff/blame with whitespace-only fixes (I have to deal with old / other people's code). I have played with TextPad, Notepad++, Kodomo Edit and Programmer's Notepad 2, and found all of them lacking. Also: I don't get along with vi, and I am unsure about Emacs on Windows. @Matti Virkkunen: I could mess with diff, but I want to fix the problem, not the symptoms. Fixing diff means all my, others, and server side diff tools need to be fixed, and doesn't fix space/noise/hash change issues in SCM. Example pet hate using that system: "update" tells me a file has changed. Diff shows no changes.

    Read the article

  • restful way for deleting a bunch of items

    - by keisimone
    In wiki article for REST it is indicated that if you use http://example.com/resources DELETE, that means you are deleting the entire collection. If you use http://example.com/resources/7HOU57Y DELETE, that means you are deleting that element. I am doing a WEBSITE, note NOT WEB SERVICE. I have a list that has 1 checkbox for each item on the list. Once i select multiple items for deletion, i will allow users to press a button called DELETE SELECTION. If user presses the button, a js dialog box will popup asking user to confirm the deletion. if user confirms, all the items are deleted. So how should i cater for deleting multiple items in a RESTFUL way? NOTE, currently for DELETE in a webpage, what i do is i use FORM tag with POST as action but include a _method with the value DELETE since this is what was indicated by others in SO on how to do RESTful delete for webpage.

    Read the article

  • Dynamically showing fields to a Dev Express Grid view on windows form

    - by Bhaskar
    In one of windows application in C# , I am using Dev Express Grid view control to bind some data and display it to user. I have custom business objects with properties defined for this purpose.Then I simple set the DataSource of the grid to the list of my custom business objects. A while ago , there came a requirement which means that the columns to be displayed on to the grid will be dynamic. This means I cannot know at design time which fields I will need to display. I was thinking of abandoning setting the DataSource and populating the grid manually by code. But I think this will cause many of the grid's features not to work properly, for example , grouping the data by drag n drop of fields to the header area etc. Is there any way to tell a grid at runtime to skip certain fields from a list of BO's when databinding to the grid ?

    Read the article

  • protect flash files

    - by user172697
    Hello Ive a website that create avatars for users and provide them with link for avatar to use it in their website or singuters etc , my problems is the website based on flash . the main page has 1 swf file that load other swfs used to create avatars , if someone knows the link for the these swf files he can download them which means he can have all the website lets say: www.test.com as main page which load main swf and other swfs files which located at www.test.com/resources/flash/swffiles/file1.swf anyone can grap these files and have all the website which is a big security breach ive trying so many way protect these files from not download but protecting them means the main swf cant talk to them and cant load the main page correctaly , any suggestion for these .. thanks in advance

    Read the article

  • how to set a status

    - by ejah85
    hello guys..here i've a problem where i want to set the status whether it is approved or reject.. the condition are if admin select the registration number and driver name, that means the status is approve otherwise, if admin fill up the reason, that means the request is reject.. here is the code to set status if ($reason =='null'){ $query2 = "UPDATE usage SET status ='APPROVED' WHERE '$bookingno'=bookingno"; $result2 = @mysql_query($query2); } elseif (($regno =='null')&&($d_name =='null')) { $query3 = "UPDATE usage SET status ='REJECT' WHERE '$bookingno'=bookingno"; $result3 = @mysql_query($query3); } when i save the data, the status field are not updates..

    Read the article

  • How to make software which will work like torrent?

    - by Nitz
    Hey guys How to make software work like torrent work? Bcz always when i see that torrent software then i am really amazed by their sizes and what they do in that sizes? How they managed the download by parts and then all together as soon as u downloaded full part? and as soon as you had great speed then your download speed automatically goes up? How to make software which will work like torrent means peer-to-peer? how to make this kind of software which can download from different servers and managed to know each users download and upload? and how they have pretty small size? which tech. they have used in that kind of software? Sorry i had asked many question. I know how downloading is happening means peer-to-peer all that.. but i don't know how they have built that kind of thing?

    Read the article

  • The use of IN OUT in ada..

    - by maddy
    HI all, Given below is a code in ada with TYPE_VECT_B; use TYPE_VECT_B; Package TEST01 is procedure TEST01 ( In_State : IN VECT_B ; Out_State : IN OUT VECT_B ); function TEST02 ( In_State : IN VECT_B ) return Boolean ; end TEST01; The TYPE_VECT_B package specification and body is also defined below Package TYPE_VECT_B is type VECT_B is array (INTEGER range <>) OF BOOLEAN ; rounded_data : float ; count : integer ; trace : integer ; end TYPE_VECT_B; Package BODY TYPE_VECT_B is begin null; end TYPE_VECT_B; What does the variable In_State and Out_State actually mean?I think In_State means input variable.i just get confused to what actually Out_State means? Thanks Maddy

    Read the article

  • Multitenant shared user account?

    - by jpartogi
    Dear all, Based on your experience, which is the route to go for a multi-tenant user login? One user login per account. Which means if there is one user that has access to multiple account, there will be redundancy of record in the database One user login for all account that she has privileges to. Which means one user record has access to multiple account if she has privileges to that account. From your experience, which one is better and why? I was thinking to choose the latter, but I don't know whether it will cause security issue or less flexibility. Thank you for sharing your experience.

    Read the article

  • Java multiline string

    - by skiphoppy
    Coming from Perl, I sure am missing the "here-document" means of creating a multi-line string in source code: $string = <<"EOF" # create a three line string text text text EOF In Java I have to have cumbersome quotes and plus signs on every line as I concatenate my multiline string from scratch. What are some better alternatives? Define my string in a properties file? Edit: Two answers say StringBuilder.append() is preferable to the plus notation. Could anyone elaborate as to why they think so? It doesn't look more preferable to me at all. I'm looking for away around the fact that multiline strings are not a first-class language construct, which means I definitely don't want to replace a first-class language construct (string concatenation with plus) with method calls. Edit: To clarify my question further, I'm not concerned about performance at all. I'm concerned about maintainability and design issues.

    Read the article

  • In PHP, is it possible to create an instance of an class without calling class's constructor ?

    - by Rachel
    By any means, is it possible to create an instance of an php class without calling its constructor ? I have Class A and while creating an instance of it am passing file and in constructor of Class A am opening the file. Now in Class A, there is function which I need to call but am not required to pass file and so there is not need to use constructor functionality of opening file as am not passing file. So my question is, Is it possible by any means to create an instance of an PHP class without calling its constructor ?

    Read the article

  • How many records can i store in a Sql server table before it's getting ugly?

    - by Michel
    Hi, i've been asked to do some performance tests for a new system. It is only just running with a few client, but as they expect to grow, these are the numbers i work with for my test: 200 clients, 4 years of data, and the data changes per.... 5 minutes. So for every 5 minutes for every client there is 1 record. That means 365*24*12 = 105.000 records per client per year, that means 80 milion records for my test. It has one FK to another table, one PK (uniqueidentifier) and one index on the clientID. Is this something SqlServer laughs about because it isn't scaring him, is this getting too much for one quad core 8 GB machine, is this on the edge, or..... Has anybody had any experience with these kind of numbers?

    Read the article

  • How Pick a Column Value from a ListView Row - C#.NET

    - by peace
    How can i fetch the value 500 to a variable from the selected row? One solution would be to get the row position number and then the CustomerID position number. Can you please give a simple solution. SelectedItems means selected row and SubItems means the column values, so SelectedItem 0 and SubItem 0 would represent the value 500. Right? This is how i populate the listview: for (int i = 0; i < tempTable.Rows.Count; i++) { DataRow row = tempTable.Rows[i]; ListViewItem lvi = new ListViewItem(row["customerID"].ToString()); lvi.SubItems.Add(row["companyName"].ToString()); lvi.SubItems.Add(row["firstName"].ToString()); lvi.SubItems.Add(row["lastName"].ToString()); lstvRecordsCus.Items.Add(lvi); }

    Read the article

  • Are indivisible operations still indivisible on multiprocessor and multicore systems?

    - by Steve314
    As per the title, plus what are the limitations and gotchas. For example, on x86 processors, alignment for most data types is optional - an optimisation rather than a requirement. That means that a pointer may be stored at an unaligned address, which in turn means that pointer might be split over a cache page boundary. Obviously this could be done if you work hard enough on any processor (picking out particular bytes etc), but not in a way where you'd still expect the write operation to be indivisible. I seriously doubt that a multicore processor can ensure that other cores can guarantee a consistent all-before or all-after view of a written pointer in this unaligned-write-crossing-a-page-boundary situation. Am I right? And are there any similar gotchas I haven't thought of?

    Read the article

  • Color space - RGB and YCbCr question

    - by HardCoder1986
    Hello! I am now trying to understand how JPEG encoding works and everything seems fine except the color transformation part. Before attempting to do a DCT in JPEG algorithm, the image is transformed into YCbCr color space. To me this essentially means that we just (comparing to initial RGB image) take a chunk of color information and dispose it while applying the RGB -> YCbCr transformation. So, our encoding steps look generally like RGB -> YCbCr -> DCT -> Huffman. The decoding means inversing this process. And my question is - why does the image (for example, created and exported to JPEG) remain the same in terms of color, although we have to make inverse YCbCr -> RGB transform. Where does the disposed part of color information comes from or how is it handled?

    Read the article

  • DB design abbreviations

    - by CChriss
    I know PK means primary key and FK means foreign key, but what do "rK" (in section 3) and "PF" (in sections 3, 4, 6, 7, and 8) mean on this page? http://www.databaseanswers.org/tutorial4_data_modelling/index.htm And what does "FF" mean (in the Customer_Addresses table) on this page? -I'm new so it would only let me put in one hyperlink, so copy/paste this to go to the page I'm asking about: databaseanswers.org/tutorial4_db_schema/tutorial_slide_7.htm Thanks. Edit: also, I understand the concepts of primary keys and foreign keys, but what are these other ones used for?

    Read the article

  • .NET and C# Exceptions. What is it reasonable to catch.

    - by djna
    Disclaimer, I'm from a Java background. I don't do much C#. There's a great deal of transfer between the two worlds, but of course there are differences and one is in the way Exceptions tend to be thought about. I recently answered a C# question suggesting that under some circstances it's reasonable to do this: try { some work } catch (Exeption e) { commonExceptionHandler(); } (The reasons why are immaterial). I got a response that I don't quite understand: until .NET 4.0, it's very bad to catch Exception. It means you catch various low-level fatal errors and so disguise bugs. It also means that in the event of some kind of corruption that triggers such an exception, any open finally blocks on the stack will be executed, so even if the callExceptionReporter fuunction tries to log and quit, it may not even get to that point (the finally blocks may throw again, or cause more corruption, or delete something important from the disk or database). May I'm more confused than I realise, but I don't agree with some of that. Please would other folks comment. I understand that there are many low level Exceptions we don't want to swallow. My commonExceptionHandler() function could reasonably rethrow those. This seems consistent with this answer to a related question. Which does say "Depending on your context it can be acceptable to use catch(...), providing the exception is re-thrown." So I conclude using catch (Exception ) is not always evil, silently swallowing certain exceptions is. The phrase "Until .NET 4 it is very bad to Catch Exception" What changes in .NET 4? IS this a reference to AggregateException, which may give us some new things to do with exceptions we catch, but I don't think changes the fundamental "don't swallow" rule. The next phrase really bothers be. Can this be right? It also means that in the event of some kind of corruption that triggers such an exception, any open finally blocks on the stack will be executed (the finally blocks may throw again, or cause more corruption, or delete something important from the disk or database) My understanding is that if some low level code had lowLevelMethod() { try { lowestLevelMethod(); } finally { some really important stuff } } and in my code I call lowLevel(); try { lowLevel() } catch (Exception e) { exception handling and maybe rethrowing } Whether or not I catch Exception this has no effect whatever on the excution of the finally block. By the time we leave lowLevelMethod() the finally has already run. If the finally is going to do any of the bad things, such as corrupt my disk, then it will do so. My catching the Exception made no difference. If It reaches my Exception block I need to do the right thing, but I can't be the cause of dmis-executing finallys

    Read the article

  • Understanding top output in Linux

    - by Rayne
    Hi, I'm trying to determine the CPU usage of a program by looking at the output from Top in Linux. I understand that %us means userspace and %sy means system/kernel etc. But say I see 100%us. Does this mean that the CPU is really only doing useful work? What if a CPU is tied up waiting for resources that are not avaliable, or cache misses, would it also show up in the %us column, or any other column? Thank you.

    Read the article

  • SQL timetable for employee

    - by latinunit-net
    Hi guys, i need to create an employee shift database. so i have 3 tables so far, employee, employee_shift, and shift im suppose to calculate how many shifts an employee has done at the end of the month, my question means, because a month has 30 days some have 28 and 31 days. this means i need to create in the shift table 31 different variations? one for each day of the month? in order to calculate which employee has worked the most? in my business relation it says an employee has either 1 or 2 shifts per day therefore do i have to have 60 different rows of variations? im i right or is there an easy way to work it out

    Read the article

  • In Bloomberg API how do you specify to get FX forwards as a spread rather than absolute values?

    - by Nick Fortescue
    How do you explicitly request fx forwards as outrights using the bloomberg API? In the Bloomberg terminal you can choose whether to get FX Forwards as absolute rates (outrights) or as offsets from Spots (Points) by doing XDF, hitting 7, then the option is about half way down. 0 means outrights, and 1 means offfsets. With most defaults you can explicitly set them in the API, so your code gives the same result whichever computer you run on. How do you set this one in a V3 API query?

    Read the article

  • How to retrieve XML attribute for custom control

    - by David
    I've created a combo box control with a edittext and spinner. I'm trying to let the android:prompt attribute be passed onto the spinner, which means I need to catch it in the constructor which passes my the AttributeSet and set it on the spinner. I can't figure out how to get the value of the prompt. I'm trying, int[] ra = { android.R.attr.prompt }; TypedArray ta = context.getTheme().obtainStyledAttributes(ra); int id = ta.getResourceId(0, 0); I get back 0, which means it didn't find the attribute. I also did a ta.count() which returned 0. So I'm not getting anything back. My XML simply defines an android:prompt value. Thanks

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >