Search Results

Search found 1047 results on 42 pages for 'restrict'.

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

  • How to restrict text search to a certain subset of the database ?

    - by Nikhil Garg
    I have a large central database of around 1 million heavy records. In my app, for every user I would have a subset of rows from central table, which would be very small (probably 100 records each).When a particular user has logged in , I would want to search on this data set only. Example: Say I have a central database of all cars in the world. I have a user profile for General Motors(GM) , Ferrari etc. When GM is logged in I just want to search(a full text search and not fire a sql query) for those cars which are manufactured by GM. Also GM may launch/withdraw a model in which case central db would be updated & so would be rowset associated with GM. In case of acquisitions, db of certain profiles may change without launch/removal of new car. So central db wont change then , but rowsets may. Whats the best way to implement such a design ? These smaller row sets would need to be dynamic depending on user activities. We are on Rails 2.3.5 and use thinking_sphinx as the connector and Sphinx/MySQL for search and relational associations.

    Read the article

  • restrict script inside iframe to run only within pages of same top-level domain?

    - by Justin Grant
    I'd like to enforce a requirement that client script inside a page (which in turn is loaded inside an iframe of another page) will only run when the parent page is on the same top-level domain as the framed page (although it may be on another hostname in that domain). Is this do-able? I assume that the easy solution of looking at top.location.host won't be available due to cross-site scripting limitations, but I'm wondering if other javascript hackery could suffice. Constraints on any potential solution inculde: I need to be able to run XmlHttpRequest calls inside the child page, and I need to validate that the hostname is in the same domain before I make those calls. (this makes a document.domain solution challenging because AFAIK setting document.domain disables the ability to make XmlHttpRequest calls. I can control client-side script and HTML on both parent or child (and I can create new pages if needed), but I can't make any server-side code changes. I can't simulate the above via server-side calls or proxies, because the child page's hostname uses a forms auth system with hostname-scoped cookies that I can't get access to from the parent page since it's on a different hostname. I don't have enough control over the child-frame site to be able to put both sites behind the same reverse-proxy or load-balancer (which would enable me to put both sites on the same hostname). I don't actually need to access any UI inside the IFrame-- the iframe is invisible and I'm only using it to run javascript within the security context of a site on a different hostname from the parent page. So at this point I'm stumped. Got any ideas? I want to make sure I'm not overlooking an easy solution before giving up.

    Read the article

  • Is there a way to restrict access to a public method to only a specific class in C#?

    - by Anon
    I have a class A with a public method in C#. I want to allow access to this method to only class B. Is this possible? UPDATE: This is what i'd like to do: public class Category { public int NumberOfInactiveProducts {get;} public IList<Product> Products {get;set;} public void ProcessInactiveProduct() { // do things... NumberOfInactiveProducts++; } } public class Product { public bool Inactive {get;} public Category Category {get;set;} public void SetInactive() { this.Inactive= true; Category.ProcessInactiveProduct(); } } I'd like other programmers to do: var prod = Repository.Get<Product>(id); prod.SetInactive(); I'd like to make sure they don't call ProcessInactiveProduct manually: var prod = Repository.Get<Product>(id); prod.SetInactive(); prod.Category.ProcessInactiveProduct(); I want to allow access of Category.ProcessInactiveProduct to only class Product. Other classes shouldn't be able to call Category.ProcessInactiveProduct.

    Read the article

  • Using Array Controllers to restrict the view in one popup depending on the selection in another. Not

    - by mjohnh
    I am working on an app that is not core data based - the data feed is a series of web services. Two arrays are created from the data feed. The first holds season data, each array object being an NSDictionary. Two of the NSDictionary entries hold the data to be displayed in the popup ('seasonName') and an id ('seasonID') that acts as a pointer (in an external table) by matches defined for that season. The second array is also a collection of NSDictionaries. Two of the entries hold the data to be displayed in the popup ('matchDescription') and the id ('matchSeasonId') that points to the seasonId defined in the NSDictionaries in first array. I have two NSPopUps. I want the first to display the season names and the second to display the matches defined for that season, depending on the selection in the first. I'm new at bindings, so excuse me if I've missed something obvious. I've tried using ArrayControllers as follows: SeasonsArrayController: content bound to appDelegate seasonsPopUpArrayData. seasonsPopup: content bound to SeasonsArrayController.arrangedObjects; content value bound to SeasonsArrayController.arrangedObjects.seasonName I see the season names fine. I can obviously follow a similar route to see the matches, but I then see them all, instead of restricting the list to the matches for the season highlighted. All the tutorials I can find seem to revolve around core data and utilise the relationships defined therein. I don't have that luxury here. Any help very gratefully received.

    Read the article

  • How do I open iPhone camera and restrict to a frame?

    - by Thomas
    Hello All: I'd like to know how to open the camera inside of a pre-defined frame (not the entire screen). When the view loads, I have a box, and inside it, I want to display what the camera sees. I don't want to snap a picture, just basically use the camera as a viewfinder. I have searched this site and have not yet found what I'm looking for. Please help. Thanks! Thomas

    Read the article

  • Is it possible to restrict instantiation of an object to only one other (parent) object in VB.NET?

    - by Casey
    VB 2008 .NET 3.5 Suppose we have two classes, Order and OrderItem, that represent some type of online ordering system. OrderItem represents a single line item in an Order. One Order can contain multiple OrderItems, in the form of a List(of OrderItem). Public Class Order Public Property MyOrderItems() as List(of OrderItem) End Property End Class It makes sense that an OrderItem should not exist without an Order. In other words, an OrderItem class should not be able to be instantiated on its own, it should be dependent on an Order class to contain it and instantiate it. However, the OrderItem should be public in scope so that it's properties are accessible to other objects. So, the requirements for OrderItem are: Can not be instantiated as a stand alone object; requires Order to exist. Must be public so that any other object can access it's properties/methods through the Order object. e.g. Order.OrderItem(0).ProductID. OrderItem should be able to be passed to other subs/functions that will operate on it. How can I achieve these goals? Is there a better approach?

    Read the article

  • How to restrict a content of string to less than 4MB and save that string in DB using C#

    - by Pranay B
    I'm working on a project where I need to get the Text data from pdf files and dump the whole text in a DB column. With the help of iTextsharp, I got the data and referred it String. But now I need to check whether the string exceeds the 4MB limit or not and if it is exceeding then accept the string data which is less than 4MB in size. This is my code: internal string ReadPdfFiles() { // variable to store file path string filePath = null; // open dialog box to select file OpenFileDialog file = new OpenFileDialog(); // dilog box title name file.Title = "Select Pdf File"; //files to be accepted by the user. file.Filter = "Pdf file (*.pdf)|*.pdf|All files (*.*)|*.*"; // set initial directory of computer system file.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); // set restore directory file.RestoreDirectory = true; // execute if block when dialog result box click ok button if (file.ShowDialog() == DialogResult.OK) { // store selected file path filePath = file.FileName.ToString(); } //file path /// use a string array and pass all the pdf for searching //String filePath = @"D:\Pranay\Documentation\Working on SSAS.pdf"; try { //creating an instance of PdfReader class using (PdfReader reader = new PdfReader(filePath)) { //creating an instance of StringBuilder class StringBuilder text = new StringBuilder(); //use loop to specify how many pages to read. //I started from 5th page as Piyush told for (int i = 5; i <= reader.NumberOfPages; i++) { //Read the pdf text.Append(PdfTextExtractor.GetTextFromPage(reader, i)); }//end of for(i) int k = 4096000; //Test whether the string exceeds the 4MB if (text.Length < k) { //return the string text1 = text.ToString(); } //end of if } //end of using } //end try catch (Exception ex) { MessageBox.Show(ex.Message, "Please Do select a pdf file!!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } //end of catch return text1; } //end of ReadPdfFiles() method Do help me!

    Read the article

  • Php file outputting javascript for include as a JS file - need to restrict so its not opened in a browser window

    - by Ali
    Hi guys, I'm storing configuration details in a database which I need to use in javascript. I'm accessing all this using php and instead of outputting all the details into inline javascript code on the main page I've instead created a php file that outputs content type javascript and refernce it in my main page as an external javascript file. I want to set it up so that it can't be viewed in a browser window i.e : <script type="text/javascript" src="phpFileThatDoesJS.php" ></script> should work but typing www.mysite.com/phpFileThatDoesJS.php in the browser shouldn't EDIT ========== The thing is that I have to edit a script that for some oddball reason stores the username and password of a user in a javascript Object and outputs it within script tags. I have to set it up so that this is not viewable by a simple view source action. Thats why I thought of referencing it as an external javascript. Isnt there any htaccess tricks that I could use?

    Read the article

  • how to restrict a web portal to a particular computer?

    - by ZX12R
    I am in the process of creating a Ruby on rails portal This portal requires a lot of data feeding by the site owner's back-office personnel. My client has this problem : the office staff should not be able to access the back office interface from any other than his office computers I have no idea how to achieve this. Is there a method for this? Thanks in advance.

    Read the article

  • How do I restrict the WCF service called by an ASP.NET AJAX page to only allow calls for that page?

    - by NovaJoe
    I have an AjaxControlToolkit DynamicPopulate control that is updated by calls to a WCF service. I know I can check the HttpContext in the service request to see if a user of the page (and thus, the control) is authenticated. However, I don't want anyone clever to be able to call the service directly, even if they're logged in. I want access to the service to be allowed ONLY to requests that are made from the page. Mainly, I don't want anyone to be able to programatically make a large number of calls and then reverse-engineer the algorithm that sits behind the service. Any clever ideas on how this can be done? Maybe I'm over-thinking this? Thanks in advance.

    Read the article

  • How to restrict date range of a jquery datepicker by giving two dates?

    - by Harie
    I am having two dates that is stored in db and am selecting it using $.ajax() and what i need is to show the datepicker values between the dates I selected from db. Here is my code for it.But it is not working properly function setDatePickerSettings(isFisc) { var fSDate, fEDate; $.ajax({ type: "POST", url: '../Asset/Handlers/AjaxGetData.ashx?fisc=1', success: function(data) { alert(data); var res = data.split("--");//data will be 4/4/2010 12:00:00--5/4/2011 12:00:00 var sDate = res[0].split(getSeparator(res[0])); alert("Separator " + getSeparator(res[1]) + " Starts " + sDate); var eDate = res[1].split(getSeparator(res[1])); alert("End " + eDate); alert("sub " + sDate[0]); fSDate = new Date(sDate[2].substring(0, 4), sDate[0], sDate[1]); alert("Starts " + fSDate.substring(0, 4)); fEDate = new Date(eDate[2].substring(0, 4), eDate[0], eDate[1]); alert("eND " + fEDate.toString()); } }); var dtSettings = { changeMonth: true, changeYear: true, showOn: 'both', buttonImage: clientURL + 'images/calendar.png', buttonImageOnly: true, showStatus: true, showOtherMonths: false, dateFormat: 'dd/mm/yy', minDate:fSDate, //assigning startdate maxDate:fEDate //assigning enddate }; return dtSettings; } Pls provide some solution. I need the datetime picker which requires values between that range. Thanks in advance

    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

  • restrict the scope of variables in a mysql query? with brackets?

    - by Haroldo
    I can't remember what the method is meant to be for ensuring the scope of a variable in a query is restricted to prevent mysql injection. where should i put brackets in the following examples? UPDATE table SET col_1 = '$var', col_2 = '$var2' WHERE col_1 = '$var3' and SELECT * FROM table WHERE WHERE col_1 >= '$var1' (Obviously looking for answers not using PDO!)

    Read the article

  • Alert is showing two times. how to restrict?

    - by Dev
    function test(myObject, flag) { if ( (flag) || ((event.keyCode == 59) || (event.which == 59)) || ((event.keyCode == 44) || (event.which == 44))) {alert(myObject.value);} } function closeWin() {self.close();} --foaram name='test' --textaarea name='textareaName' cols='44' rows='3' onChange='test(this, true);' --onKeyPress='test(this);' onBlur='test(this, true);' ---inpaut type='text' name='textName' --inpaut type='button' name='buttonName' onclick='closeWin();' value='Cancel' --/foarm I have a problem: when input value(e.g: test;) into textareaName field, the test function is always run more one time. Please show me the way can run this only one time.

    Read the article

  • .NET security mechanism to restrict access between two Types in the same project?

    - by jdk
    Question: Is there a mechanism in the .NET Framework to hide one custom Type from another without using separate projects/assemblies? I'm using C# with ASP.NET in a Website project. Note: I'm not talking about access modifiers to hide members of a Type from another type - I mean to hide the Type itself. Background: I'm working in an ASP.NET Website project and the team has decided not to use separate project assemblies for different software layers. Therefore I'm looking for a way to have, for example, a DataAccess/ folder of which I disallow its classes to access other Types in the same ASP.NET Website project. In other words I want to fake the layers and have some kind of security mechanism around each layer to prevent it from accessing another. Obviously there's not a way to enforce this restriction using language-specific OO keywords so I am looking for something else, for example: maybe a permission framework or code access mechanism, maybe something that uses meta data like Attributes. Even something that restricts one namespace from accessing another. I'm unsure the final form it might take. If this were C++ I'd likely be using friend to make as solution, which doesn't translate to C# internal in this case although they're often compared. I don't really care whether the solution actually hides Types from each other or just makes them inaccessible; however I don't want to lock down one Type from all others, another reason access modifiers are not a solution. A runtime or design time answer will suffice. Looking for something easy to implement otherwise it's not worth the effort ...

    Read the article

  • Is it possible to restrict how a method can be called in PHP?

    - by Ashley Ward
    Given that my class looks like this: class Methods{ function a(){ return 'a'; } function b(){ $this->a(); } function c(){ $this->a(); } } Is it possible to ensure that function a can only be called from function b? In the above example function c should fail. I could just include it in function b, but in the future I may want to let a() be called by some new functions (e.g. d() or e())

    Read the article

  • Can SiteB Restrict Access Only to Users Authenticated on Site A? How?

    - by DaveDev
    I have recently been asked to estimate a piece of work which will provide functionality for authenticated users to access our site. The thing is, the user has to authenticate on a different site & domain to the one we are hosting. The user authenticates on SiteA.com and they are provided with a link to our site, SiteB. Only users who have authenticated on SiteA are allowed to access SiteB.com. I don't yet know what authentication system SiteA is using, but I thought I'd ask the community for some initial thoughts. Is this even possible? What do I need to consider? Thanks

    Read the article

  • How do I restrict accepting only one type in my generic method?

    - by kunjaan
    I have a generic function foo, which accepts any type and prints them out. public static <T> T foo(T... arg) { List<T> foo = Arrays.asList(arg); for (T t : foo) { System.out.println(t); } return null; } How do I make sure that the arguments received are of only 1 type. For example, {1,'a',3} should be invalid. It should either be all numbers or all characters.

    Read the article

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