Search Results

Search found 47324 results on 1893 pages for 'end users'.

Page 137/1893 | < Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >

  • How to create a Windows GUI with a file explorer window, allowing users to choose files?

    - by Badri
    Here's what I want to do. I want to present a file explorer, and allow the user to select files, and list the selected files below. (I then want to process those files but that's the next part) For example, the way CD Burning softwares work. I have created a mock up here http://dl.dropbox.com/u/113967/Mockup.png As you can see, the left frame has a directory structure, the right frame has a file selected, and the bottom frame shows the selected file. What framework can I go about creating this? I am familiar with command line C++ stuff, but I haven't ventured into any GUI programming, and figured this idea would be a good place to start. Any suggestions on where to start?

    Read the article

  • How would I change the DocumenRoot on the version of Apache that came pre-installed on my Mac OS X s

    - by racl101
    OK, so I want to take advantage of the Apache server that comes installed on my Mac OS X system (which means, I would like not to have to install my own version of Apache since I might as well tryto use what comes bundled), and as such, I went to change some settings in the configuration file: /etc/apache2/httpd.conf Namely, I changed the these two lines: DocumentRoot "/Users/myusername/Sites" <Directory "/Users/myusername/Sites"> So that they initially pointed to a folder in my Dropbox folder (so I could have my docs sync to my Dropbox): DocumentRoot "/Users/myusername/Dropbox/public_html" <Directory "/Users/myusername/Dropbox/public_html"> That didn't work. So then I figured, ok maybe it was too much to ask to make folder in my Dropbox be my document root. So then I thought, what if I make the Document root another folder of my choosing like so: DocumentRoot "/Users/myusername/dev-sites/public_html" <Directory "/Users/myusername/dev-sites/public_html"> and that didn't work either. After looking within the httpd.conf file for clues it seems that only two directories appear to work as Document root paths for the Apache that comes bundled with Mac OS X: /Users/myusername/Sites (or ~/Sites) and /Library/WebServer/Documents/ But trying to use any other directories didn't seem to work. I would get 403 errors on my browser. I was wondering if there was some other settings to change on the httpd.conf file or any permissions to set to make this work. Any help would be appreciated and many thanks in advance.

    Read the article

  • Rails: updating an association

    - by Sam
    I have a Reservation model which belongs_to a Sharedorder and so a Sharedorder has_many reservations. Give you a little background. I sharedorder has many reservations and each reservation can have an amount. A sharedorder has three status: 1) reserved, 2) confirmed, 3) and purchased. Here is my problem. When a reservation gets added to a sharedorder or an existing reservation's amount is updated I need this to affect the associated sharedoder because the status listed latter should only change when 100% of the reservations have been placed and so on. Here are the things I have tried: . class Reservation < ActiveRecord::Base before_save :sharedorder_reserved_status def sharedorder_reserved_status if self.sharedorder.reserved_percent(reservations_to_be_added) >= 100 && !self.sharedorder.reserved self.sharedorder.update_attribute(:reserved, true) self.sharedorder.update_attribute(:reserved_at, Time.now) end end def reservations_to_be_added if self.new_record? self.amount elsif self.amount_changed? self.amount - self.amount_was else 0 end end end And then in the Sharedorder model: class Sharedorder < ActiveRecord::Base def reserved_percent(amount_change) (((reserved_sum + amount_change).to_f / self.product.twenty_hq_size.to_f)*100).to_i end def reserved_sum if !@reserved_sum reserved_sum = 0 reserved_reservations.collect {|x| reserved_sum += x.amount } reserved_sum else @reserved_sum end end def reserved_reservations @reserved_reservations ||= Reservation.find(:all, :conditions => ['canceled = ? AND sharedorder_id = ?', false, self.id ]) end end I have also tried :touch => true on the reservation model to update the sharedorder put for some reason it doesn't seem to include the latest reservation being added or being updated. So what I'm trying to do is update the status of the sharedorder if a certain percent is reached and I have to send the additional amounts the the sharedorder for it to know to include additional reservations or updates on existing ones. How should I do this?

    Read the article

  • How can I deny users to add/modify/remove printers to cups ?

    - by ajcaruana
    Hi, I am using Mac OS X 10.6. I wrote a program which will add and remove printers to a CUPS server using libcups. It works, but now I am considering the security aspects. This program takes a user name and password to authenticate on the CUPS server. Whatever user name and password I use, it works as long as it is valid on the system. How do I restrict access to only a specific user ? Regards Alan

    Read the article

  • Linux shell to restrict sftp users to their home directories?

    - by hfidgen
    I need to give SFTP access to a directory within my webroot on my server. I've set up ben_files as a user and have set his/her home directory to /var/www/vhosts/mydomain.com/files That's all fine if he/she connects with plain old FTP - he's/she's restricted just to that directory, but to enable SFTP I had to add him/her to bin/bash shell, which suddenly opens up my entire server... Is there a way of giving him/her SFTP access but without opening up all my directories? I'd really like him restricted to only his/her home ;)

    Read the article

  • custom *arbitrary* TemplateField definitions

    - by end-user
    I'm building a GridView on the fly, and I'd like to pre-define the TemplateFields to be included ondemand. So, what I'd like to do is have a declarative file that defines how the different templates look for a specific column. Like: <asp:TemplateField> <HeaderTemplate> this is a text column </HeaderTemplate> <ItemTemplate> data goes here </ItemTemplate> <EditItemTemplate> <asp:TextBox Text="databindhere" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> this is a bool column </HeaderTemplate> <ItemTemplate> if(true) "yes" else "no" </ItemTemplate> <EditItemTemplate> <asp:CheckBox Checked="databindme" /> </EditItemTemplate> </asp:TemplateField> So, if my query had a text and two bool fields, I could push the appropriate TemplateFields in the the Columns property as needed. (I hope I'm making sense here) So, how would I go about creating declarative files for the above definitions? And then, how would I reference those definitions programmatically?

    Read the article

  • How can I use TDD to solve a puzzle with an unknown answer?

    - by matthewsteele
    Recently I wrote a Ruby program to determine solutions to a "Scramble Squares" tile puzzle: I used TDD to implement most of it, leading to tests that looked like this: it "has top, bottom, left, right" do c = Cards.new card = c.cards[0] card.top.should == :CT card.bottom.should == :WB card.left.should == :MT card.right.should == :BT end This worked well for the lower-level "helper" methods: identifying the "sides" of a tile, determining if a tile can be validly placed in the grid, etc. But I ran into a problem when coding the actual algorithm to solve the puzzle. Since I didn't know valid possible solutions to the problem, I didn't know how to write a test first. I ended up writing a pretty ugly, untested, algorithm to solve it: def play_game working_states = [] after_1 = step_1 i = 0 after_1.each do |state_1| step_2(state_1).each do |state_2| step_3(state_2).each do |state_3| step_4(state_3).each do |state_4| step_5(state_4).each do |state_5| step_6(state_5).each do |state_6| step_7(state_6).each do |state_7| step_8(state_7).each do |state_8| step_9(state_8).each do |state_9| working_states << state_9[0] end end end end end end end end end So my question is: how do you use TDD to write a method when you don't already know the valid outputs? If you're interested, the code's on GitHub: Tests: https://github.com/mattdsteele/scramblesquares-solver/blob/master/golf-creator-spec.rb Production code: https://github.com/mattdsteele/scramblesquares-solver/blob/master/game.rb

    Read the article

  • SELECT..CASE - Refactor T-SQL

    - by Nev_Rahd
    Hello Can I refactor the below SQL CASE statements into single for each case ? SELECT CASE RDV.DOMAIN_CODE WHEN 'L' THEN CN.FAMILY_NAME ELSE NULL END AS [LEGAL_FAMILY_NAME], CASE RDV.DOMAIN_CODE WHEN 'L' THEN CN.GIVEN_NAME ELSE NULL END AS [LEGAL_GIVEN_NAME], CASE RDV.DOMAIN_CODE WHEN 'L' THEN CN.MIDDLE_NAMES ELSE NULL END AS [LEGAL_MIDDLE_NAMES], CASE RDV.DOMAIN_CODE WHEN 'L' THEN CN.NAME_TITLE ELSE NULL END AS [LEGAL_NAME_TITLE], CASE RDV.DOMAIN_CODE WHEN 'P' THEN CN.FAMILY_NAME ELSE NULL END AS [PREFERRED_FAMILY_NAME], CASE RDV.DOMAIN_CODE WHEN 'P' THEN CN.GIVEN_NAME ELSE NULL END AS [PREFERRED_GIVEN_NAME], CASE RDV.DOMAIN_CODE WHEN 'P' THEN CN.MIDDLE_NAMES ELSE NULL END AS [PREFERRED_MIDDLE_NAMES], CASE RDV.DOMAIN_CODE WHEN 'P' THEN CN.NAME_TITLE ELSE NULL END AS [PREFERRED_NAME_TITLE] FROM dbo.CLIENT_NAME CN JOIN dbo.REFERENCE_DOMAIN_VALUE RDV ON CN.NAME_TYPE_CODE = RDV.DOMAIN_CODE AND RDV.REFERENCE_DOMAIN_ID = '7966'

    Read the article

  • Make datalist into 3 x 3

    - by unknown
    This is my code behind for products page. The prodblem is that my datalist will fill in new items whenever I add a new object in the website. So may I know how to add the codes in so that I can make the datalist into 3x3. Thanks. Code behind Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim Product As New Product Dim DataSet As New DataSet Dim pds As New PagedDataSource DataSet = Product.GetProduct Session("Dataset") = DataSet pds.PageSize = 4 pds.AllowPaging = True pds.CurrentPageIndex = 1 Session("Page") = pds If Not Page.IsPostBack Then UpdateDatabind() End If End Sub Sub UpdateDatabind() Dim DataSet As DataSet = Session("DataSet") If DataSet.Tables(0).Rows.Count > 0 Then pds.DataSource = DataSet.Tables(0).DefaultView Session("Page") = pds dlProducts.DataSource = DataSet.Tables(0).DefaultView dlProducts.DataBind() lblCount.Text = DataSet.Tables(0).Rows.Count End If End Sub Private Sub dlProducts_UpdateCommand(source As Object, e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles dlProducts.UpdateCommand dlProducts.DataBind() End Sub Public Sub PrevNext_Command(source As Object, e As CommandEventArgs) Dim pds As PagedDataSource = Session("Page") Dim CurrentPage = pds.CurrentPageIndex If e.CommandName = "Previous" Then If CurrentPage < 1 Or CurrentPage = pds.IsFirstPage Then CurrentPage = 1 Else CurrentPage -= 1 End If UpdateDatabind() ElseIf e.CommandName = "Next" Then If CurrentPage > pds.PageCount Or CurrentPage = pds.IsLastPage Then CurrentPage = CurrentPage Else CurrentPage += 1 End If UpdateDatabind() End If Response.Redirect("Products.aspx?PageIndex=" & CurrentPage) End Sub this is my code for product.vb Public Function GetProduct() As DataSet Dim strConn As String strConn = ConfigurationManager.ConnectionStrings("HomeFurnitureConnectionString").ToString Dim conn As New SqlConnection(strConn) Dim strSql As String 'strSql = "SELECT * FROM Product p INNER JOIN ProductDetail pd ON p.ProdID = pd.ProdID " & _ ' "WHERE pd.PdColor = (SELECT min(PdColor) FROM ProductDetail as pd1 WHERE pd1.ProdID = p.ProdID)" Dim cmd As New SqlCommand(strSql, conn) Dim ds As New DataSet Dim da As New SqlDataAdapter(cmd) conn.Open() da.Fill(ds) conn.Close() Return ds End Function

    Read the article

  • Best directory to store application data with read\write rights for all users?

    - by Wodzu
    Hi guys. Until Windows Vista I was saving my application data into the directory where the program was located. The most common place was "C:\Program Files\MyApplication". As we know, under Vista and later the common user does't have rights to write under "Program Files" folder. So my first idea was to save the application data under "All Useres\Application Data" folder. But it seams that this folder has writing restrictions too! So to sum up, my requirements are: Folder should exist under Windows XP and above Microsoft's systems. All useres of the system should read\write\creation rights to this folder and it subfolders and files. I want to have only one copy of file\files for all useres. Thanks for your time.

    Read the article

  • How to use urllib2 when users only have a API token?

    - by jorrebor
    how would i tranfoms this curl command: curl -v -u 82xxxxxxxxxxxx63e6:api_token -X GET https://www.toggl.com/api/v6/time_entries.json into urlib2? I found this tutorial: http://www.voidspace.org.uk/python/articles/authentication.shtml but they use a password and username. I can only use an API token. Thank you. see also this question: Urllib2 raises 403 error while the same request in curl works fine

    Read the article

  • Who owns forum users or are user grabbers legal?

    - by Eugene
    Hi, I am not very strong in "legal or not" questions so I hope someone can help me here. How legal is the following: I create my forum, then choose a random existing forum (not mine), take a user from that forum (username, avatar, etc) and create an identical account at my forum. I know that this is extremely hard to prove and everything but anyway: how legal are the described actions? Thanks!

    Read the article

  • How can I allow only privledged users to download a pdf with php?

    - by ThinkingInBits
    Lets say I have some pdf files stored on my server and I only want to allow a person who's paid have access to download a particular pdf. So for an example, let's say I have a bunch of e-books. The only way a user would be able to download e-book A is if his account contains the right credentials for that particular book. What's the best way to accomplish this? Any ideas/advice on how to improve my idea are greatly appreciated! My current idea: A user places an order Upon success, a new folder would be created by their /account_num/order_id/ A copy of the particular file would be stored in this directory Have php generate an .htaccess that would only allow access from a url that contains a random hash embedded into it. The only way a user would be able to access this random hashed page is if they are signed in as the right user, and the hash matches up with the hash stored in the database, otherwise they are redirected to home page.

    Read the article

  • Need help profiling .NET caching extension method.

    - by rockinthesixstring
    I've got the following extension Public Module CacheExtensions Sub New() End Sub Private sync As New Object() Public Const DefaultCacheExpiration As Integer = 1200 ''# 20 minutes <Extension()> Public Function GetOrStore(Of T)(ByVal cache As Cache, ByVal key As String, ByVal generator As Func(Of T)) As T Return cache.GetOrStore(key, If(generator IsNot Nothing, generator(), Nothing), DefaultCacheExpiration) End Function <Extension()> Public Function GetOrStore(Of T)(ByVal cache As Cache, ByVal key As String, ByVal generator As Func(Of T), ByVal expireInSeconds As Double) As T Return cache.GetOrStore(key, If(generator IsNot Nothing, generator(), Nothing), expireInSeconds) End Function <Extension()> Public Function GetOrStore(Of T)(ByVal cache As Cache, ByVal key As String, ByVal obj As T) As T Return cache.GetOrStore(key, obj, DefaultCacheExpiration) End Function <Extension()> Public Function GetOrStore(Of T)(ByVal cache As Cache, ByVal key As String, ByVal obj As T, ByVal expireInSeconds As Double) As T Dim result = cache(key) If result Is Nothing Then SyncLock sync If result Is Nothing Then result = If(obj IsNot Nothing, obj, Nothing) cache.Insert(key, result, Nothing, DateTime.Now.AddSeconds(expireInSeconds), cache.NoSlidingExpiration) End If End SyncLock End If Return DirectCast(result, T) End Function End Module From here, I'm using the extension is a TagService to get a list of tags Public Function GetTagNames() As List(Of String) Implements Domain.ITagService.GetTags ''# We're not using a dynamic Cache key because the list of TagNames ''# will persist across all users in all regions. Return HttpRuntime.Cache.GetOrStore(Of List(Of String))("TagNamesOnly", Function() _TagRepository.Read().Select(Function(t) t.Name).OrderBy(Function(t) t).ToList()) End Function All of this is pretty much straight forward except when I put a breakpoint on _TagRepository.Read(). The problem is that it is getting called on every request, when I thought that it is only to be called when Result Is Nothing Am I missing something here?

    Read the article

  • ASP.Net - How do I allow users to enter html tags in textbox without runtime errors?

    - by Coder
    I have an input textbox on an asp.net page and when a user inputs any tags like break tags or bold an error occurs. I currently am using the following to encode the input: Server.HtmlEncode(mytextbox.Text) However this only encodes characters when they aren't phrased as an html tag, like if the input is "<<<" is there a way for me to allow the user to put the tags in without it leading to a runtime error? Thanks.

    Read the article

  • How to avoid "incomplete implementation" warning in partial base class

    - by garph0
    I have created a protocol that my classes need to implement, and then factored out some common functionality into a base class, so I did this: @protocol MyProtocol - (void) foo; - (void) bar; @end @interface Base <MyProtocol> @end @interface Derived_1 : Base @end @interface Derived_2 : Base @end @implementation Base - (void) foo{ //something foo } @end @implementation Derived_1 - (void) bar{ //something bar 1 } @end @implementation Derived_2 - (void) bar{ //something bar 2 } @end In this way in my code I use a generic id<MyProtocol>. The code works (as long as Base is not used directly) but the compiler chokes at the end of the implementation of Base with a warning: Incomplete implementation of class Base Is there a way to avoid this warning or, even better, a more proper way to obtain this partially implemented abstract base class behavior in Objc?

    Read the article

  • How do I create custom Controls for my VS2005 toolbox?

    - by end-user
    Ok, this question might more about design theory. I have successfully created controls that show up in my toolbox, so I'm pretty sure I have the process right. Also, my "AutoToolboxPopulate" is set to true, so things are showing up as I create them. My question is this: I'm sub-classing a native Control for specialized use. When I derive my class from an exposed concrete class, such as BulletedList, my custom Control appears in my Toolbox. However, when I drop it back to the parent, such as ListControl, my Control is not listed (actually it's grayed out when I "List All"). What am I missing?

    Read the article

  • thrust::unique_by_key eating up last element

    - by Programmer
    Please consider the below simple code: thrust::device_vector<int> positions(6); thrust::sequence(positions.begin(), positions.end()); thrust::pair<thrust::device_vector<int>::iterator, thrust::device_vector<int>::iterator > end; //copyListOfNgramCounteachdoc contains: 0,1,1,1,1,3 end.first = copyListOfNgramCounteachdoc.begin(); end.second = positions.begin(); for(int i =0 ; i < numDocs; i++){ end= thrust::unique_by_key(end.first, end.first + 3,end.second); } int length = end.first - copyListOfNgramCounteachdoc.begin() ; cout<<"the value of end -s is: "<<length; for(int i =0 ; i< length ; i++){ cout<<copyListOfNgramCounteachdoc[i]; } I expected the output to be 0,1,1,3 of this code; however, the output is 0,1,1. Can anyone let me know what I am missing? Note: the contents of copyListOfNgramCounteachdoc is 0,1,1,1,1,3 . Also the type of copyListOfNgramCounteachdoc is thrust::device_vector<int>.

    Read the article

  • How do you extend a Ruby module with macro-like metaprogramming methods?

    - by Ian Terrell
    Consider the following extension (the pattern popularized by several Rails plugins over the years): module Extension def self.included(recipient) recipient.extend ClassMethods recipient.class_eval { include InstanceMethods } end module ClassMethods def macro_method puts "Called macro_method within #{self.name}" end end module InstanceMethods def instance_method puts "Called instance_method within #{self.object_id}" end end end If you wished to expose this to every class, you can do the following: Object.send :include, Extension Now you can define any class and use the macro method: class FooClass macro_method end #=> Called macro_method within FooClass And instances can use the instance methods: FooClass.new.instance_method #=> Called instance_method within 2148182320 But even though Module.is_a?(Object), you cannot use the macro method in a module: module FooModule macro_method end #=> undefined local variable or method `macro_method' for FooModule:Module (NameError) This is true even if you explicitly include the original Extension into Module with Module.send(:include, Extension). How do you add macro like methods to Ruby modules?

    Read the article

  • Giving users a "reputation system" - Should I... ?

    - by RadiantHex
    Hi folks, I'm thinking of adding a reputation system to a web application, the site is already being used so I'm trying to be careful about my choices. I'm developing in Django/Python, thought this would be important. Reputation is generated in all actions that contribute to the site, similar to Stackoverflow's system. I know there are literally millions of ways of implementing this, and this is why I feel quite lost. Two alternatives I am not sure about are: Keep track of reasons why reputation was incremented Ignore reasons in order to reduce complexity of the site and overhead Would be happy with a few pointers, and directions. Would be very much appreciated!

    Read the article

  • How to let users with required permission download a file via php?

    - by Yegor
    I have a php file that acts as a gatekeeper for all the files I want people to download, who ahve sufficient privilages. The code I use throw the file to the user is header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header("Content-disposition: attachment; filename=\"".$public_filename."\""); header("Content-Transfer-Encoding: Binary"); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header("Content-length: ".$f_filesize); readfile($file_path); Most files are fairly large.... 400mb-10GB. What would be a good way to do this, and keep the true locations + filenames secret, so people cant just link to the files directly, but HAVE to link thru my download.php?file=ID gatekeeper? Thanks

    Read the article

  • how can cookies track users despite same origin policy?

    - by user1763930
    Article here discusses tactics used by political campaigns. http://www.nytimes.com/2012/10/14/us/politics/campaigns-mine-personal-lives-to-get-out-vote.html The part in question is quoted: The campaigns have planted software known as cookies on voters’ computers to see if they frequent evangelical or erotic Web sites for clues to their moral perspectives. Voters who visit religious Web sites might be greeted with religion-friendly messages when they return to mittromney.com or barackobama.com. How is that possible? I thought all modern browsers have same origin policy security where website A doesn't have access to any information about other website B, website C, etc. The article makes it sound like a user browses: 1. presidentialcandidate.com 2. website2.com 3. website3.com 4. website4.com 5. presidentialcandidate.com How can a cookie from visit #1 know track user history and be revealed in visit #5?

    Read the article

< Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >