Search Results

Search found 951 results on 39 pages for 'restricted'.

Page 34/39 | < Previous Page | 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Casting Type array to Generic array?

    - by George R
    The short version of the question - why can't I do this? I'm restricted to .NET 3.5. T[] genericArray; // Obviously T should be float! genericArray = new T[3]{ 1.0f, 2.0f, 0.0f }; // Can't do this either, why the hell not genericArray = new float[3]{ 1.0f, 2.0f, 0.0f }; Longer version - I'm working with the Unity engine here, although that's not important. What is - I'm trying to throw conversion between its fixed Vector2 (2 floats) and Vector3 (3 floats) and my generic Vector< class. I can't cast types directly to a generic array. using UnityEngine; public struct Vector { private readonly T[] _axes; #region Constructors public Vector(int axisCount) { this._axes = new T[axisCount]; } public Vector(T x, T y) { this._axes = new T[2] { x, y }; } public Vector(T x, T y, T z) { this._axes = new T[3]{x, y, z}; } public Vector(Vector2 vector2) { // This doesn't work this._axes = new T[2] { vector2.x, vector2.y }; } public Vector(Vector3 vector3) { // Nor does this this._axes = new T[3] { vector3.x, vector3.y, vector3.z }; } #endregion #region Properties public T this[int i] { get { return _axes[i]; } set { _axes[i] = value; } } public T X { get { return _axes[0];} set { _axes[0] = value; } } public T Y { get { return _axes[1]; } set { _axes[1] = value; } } public T Z { get { return this._axes.Length (Vector2 vector2) { Vector vector = new Vector(vector2); return vector; } public static explicit operator Vector(Vector3 vector3) { Vector vector = new Vector(vector3); return vector; } #endregion }

    Read the article

  • IE Information Bar, download file...how do I code for this?

    - by flatline
    I have a web page (asp.net) that compiles a package then redirects the user to the download file via javascript (window.location = ....). This is accompanied by a hard link on the page in case the redirect doesn't work - emulating the download process on many popular sites. When the IE information bar appears at the top due to restricted security settings, and a user clicks on it to download the file, it redirects the user to the page, not the download file, which refreshes the page and removes the hard link. What is the information bar doing here? Shouldn't it send the user to the location of the redirect? Am I setting something wrong in the headers of the download response, or doing something else wrong to send the file in the first place? C# Code: m_context.Response.Buffer = false; m_context.Response.ContentType = "application/zip"; m_context.Response.AddHeader("Content-Length", fs.Length.ToString()); m_context.Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}_{1}.zip", downloadPrefix, DateTime.Now.ToString("yyyy-MM-dd_HH-mm"))); //send the file

    Read the article

  • Installing a group of .deb files in Ubuntu

    - by p00ya
    Hi. I have a directory of .deb files which I copied from the cache folder of apt. There are many applications and Ubuntu updates among them. but there's no dependency failure because they were all downloaded by 'add/remove applications' and 'update manager' automatically. Now I have installed the same version of Ubuntu (9.04) and I want to install those apps and updates again(though they are not new versions). In other words, I want to make this fresh Ubuntu install exactly like the old one but without downloading any thing and using only those .deb files that I copied. All I have is an archive folder containing the .deb files and a 'pkgcache.bin' file. I know I can double-click the .deb files and install them manually but then I have to find out and follow the dependencies one by one from the installer errors. I have also tried adding an offline repository but it didn't work. I think because all of my .deb's are in on folder, and there is no separate 'main', 'restricted', ... folder?! Is there a way to do all of this automatically? thanks

    Read the article

  • Table index design

    - by Swoosh
    I would like to add index(s) to my table. I am looking for general ideas how to add more indexes to a table. Other than the PK clustered. I would like to know what to look for when I am doing this. So, my example: This table (let's call it TASK table) is going to be the biggest table of the whole application. Expecting millions records. IMPORTANT: massive bulk-insert is adding data in this table table has 27 columns: (so far, and counting :D ) int x 9 columns = id-s varchar x 10 columns bit x 2 columns datetime x 5 columns INT COLUMNS all of these are INT ID-s but from tables that are usually smaller than Task table (10-50 records max), example: Status table (with values like "open", "closed") or Priority table (with values like "important", "not so important", "normal") there is also a column like "parent-ID" (self - ID) join: all the "small" tables have PK, the usual way ... clustered STRING COLUMNS there is a (Company) column (string!) that is something like "5 characters long all the time" and every user will be restricted using this one. If in Task there are 15 different "Companies" the logged in user would only see one. So there's always a filter on this one. Might be a good idea to add an index to this column? DATE COLUMNS I think they don't index these ... right? Or can / should be?

    Read the article

  • WPF C# Client/Server announcement system

    - by manemawanna
    I'm currently in the process of creating an announcement system at my place of work. The role of this system will be to replace all users email due to people misusing it and generally abusing the facility. The system will consist of: Web Portal: Will allow staff to enter any important announcements (this will be restricted via AD). SQL Server 2k5 DB: Will hold the announcements along with records of staff members and if they've read the announcements etc. Front End: Created in WPF & C# which is nearly complete, it will display the announcements to the users. Web Page: Client will contact every so often, which will return an xml file for the client to read. However my boss has now shifted the goal posts and would like the announcements to appear to the user once they are written to the database, rather than waiting on the client to contact the webpage. So now I'm a bit unsure as to how to go about this. I have one idea where I would create a small server application to monitor for new announcements then contact the clients to inform them to approach the website for the information they need. But I'm just looking to see if theres a better or more efficient way to do this or if someone else has a more appropriate idea or suggestion.

    Read the article

  • Azure Mobile Services with persistent authentication

    - by akshay2000
    I am trying to implement authentication with Windows Azure Mobile Services in my Windows Phone app. I have followed the official tutorials and the authentication works fine. The issue is that, whenever the app is closed and started again, the user has to enter username and password. Since the services only use authentication tokens, the 'Remember me' option on log in page is not likely to work. The official documentation for Windows Azure shows possibility of Single Sign On with the Microsoft account using the Live SDK. The Live SDK provides authentication token in form of string. However, even this token expires in about 24 hours. Moreover, this is restricted to the Microsoft Account only. What are my possibilities if I want to cache the user's identity and enable automatic log in? I have already gone through the article here. User will still have to log in again once the token expires. I have seen apps which require user to sign in only once!

    Read the article

  • Invoke Command When "ENTER" Key Is Pressed In XAML

    - by bitxwise
    I want to invoke a command when ENTER is pressed in a TextBox. Consider the following XAML: <UserControl ... xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" ...> ... <TextBox> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyUp"> <i:InvokeCommandAction Command="{Binding MyCommand}" CommandParameter="{Binding Text}" /> </i:EventTrigger> </i:Interaction.Triggers> </TextBox> ... </UserControl> and that MyCommand is as follows: public ICommand MyCommand { get { return new DelegateCommand<string>(MyCommandExecute); } } private void MyCommandExecute(string s) { ... } With the above, my command is invoked for every key press. How can I restrict the command to only invoke when the ENTER key is pressed? I understand that with Expression Blend I can use Conditions but those seem to be restricted to elements and can't consider event arguments. I have also come across SLEX which offers its own InvokeCommandAction implementation that is built on top of the Systems.Windows.Interactivity implementation and can do what I need. Another consideration is to write my own trigger, but I'm hoping there's a way to do it without using external toolkits.

    Read the article

  • c++ specialized overload?

    - by acidzombie24
    -edit- i am trying to close the question. i solved the problem with boost::is_base_and_derived In my class i want to do two things. 1) Copy int, floats and other normal values 2) Copy structs that supply a special copy function (template T copyAs(); } the struct MUST NOT return int's unless i explicitly say ints. I do not want the programmer mistaking the mistake by doing int a = thatClass; -edit- someone mention classes dont return anything, i mean using the operator Type() overload. How do i create my copy operator in such a way i can copy both 1) ints, floats etc and the the struct restricted in the way i mention in 2). i tried doing template <class T2> T operator = (const T2& v); which would cover my ints, floats etc. But how would it differentiate from structs? so i wrote T operator = (const SomeGenericBase& v); The idea was the GenericBase would be unsed instead then i can do v.Whatever. But that backfires bc the functions i want wouldnt exist, unless i use virtual, but virtual templates dont exist. Also i would hate to use virtual I think the solution is to get rid of ints and have it convert to something that can do .as(). So i wrote something up but now i have the same problem, how does that differentiate ints and structs that have the .as() function template?

    Read the article

  • best practices question: How to save a collection of images and a java object in a single file? File

    - by Richard
    Hi all, I am making a java program that has a collection of flash-card like objects. I store the objects in a jtree composed of defaultmutabletreenodes. Each node has a user object attached to it with has a few string/native data type parameters. However, i also want each of these objects to have an image (typical formats, jpg, png etc). I would like to be able to store all of this information, including the images and the tree data to the disk in a single file so the file can be transferred between users and the entire tree, including the images and parameters for each object, can be reconstructed. I had not approached a problem like this before so I was not sure what the best practices were. I found XLMEncoder (http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html) to be a very effective way of storing my tree and the native data type information. However I couldn't figure out how to save the image data itself inside of the XML file, and I'm not sure it is possible since the data is binary (so restricted characters would be invalid). My next thought was to associate a hash string instead of an image within each user object, and then gzip together all of the images, with the hash strings as the names and the XMLencoded tree in the same compmressed file. That seemed really contrived though. Does anyone know a good approach for this type of issue? THanks! Thanks!

    Read the article

  • Where to add an overloaded operator for the tr1::array?

    - by phlipsy
    Since I need to add an operator& for the std::tr1::array<bool, N> I wrote the following lines template<std::size_t N> std::tr1::array<bool, N> operator& (const std::tr1::array<bool, N>& a, const std::tr1::array<bool, N>& b) { std::tr1::array<bool, N> result; std::transform(a.begin(), a.end(), b.begin(), result.begin(), std::logical_and<bool>()); return result; } Now I don't know in which namespace I've to put this function. I considered the std namespace as a restricted area. Only total specialization and overloaded function templates are allowed to be added by the user. Putting it into the global namespace isn't "allowed" either in order to prevent pollution of the global namespace and clashes with other declarations. And finally putting this function into the namespace of the project doesn't work since the compiler won't find it there. What had I best do? I don't want to write a new array class putted into the project namespace. Because in this case the compiler would find the right namespace via argument dependent name lookup. Or is this the only possible way because writing a new operator for existing classes means extending their interfaces and this isn't allowed either for standard classes?

    Read the article

  • Problem with making a simple JS XmlHttpRequest call

    - by recipriversexclusion
    I have to create a very simple client that makes GET and POST calls to our server and parses the returned XML. I am writing this in JavaScript, problem is I don't know how to program in JS (started to look into this just this morning)! As n initial test, I am trying to ping to the Twitter API, here's the function that gets called when user enters the URL http://api.twitter.com/1/users/lookup.xml and hits the submit button: function doRequest() { var req_url, req_type, body; req_url = document.getElementById('server_url').value; req_type = document.getElementById('request_type').value; alert("Connecting to url: " + req_url + " with HTTP method: " + req_type); req = new XMLHttpRequest(); req.open(req_type, req_url, false, "username", "passwd");// synchronous conn req.onreadystatechange=function() { if (req.readyState == 4) { alert(req.status); } } req.send(null); } When I run this on FF, I get a Access to restricted URI denied" code: "1012 error on Firebug. Stuff I googled suggested that this was a FF-specific problem so I switched to Chrome. Over there, the second alert comes up, but displays 0 as HTTP status code, which I found weird. Can anyone spot what the problem is? People say this stuff is easier to use with JQuery but learning that on top of JS syntax is a bit too much now.

    Read the article

  • parsing multiple child with sax parser in Android

    - by Ahmad Naqibul Arefin
    I can parse xml file with sax parser, but when I need to add child attribute under a attribute then how I can get the value? my xml file is here: <?xml version="1.0" encoding="UTF-8"?> <marketlist> <market> <name restricted="yes">boss</name> <motorway>M6</motorway> <junction>J3</junction> <petrol_hour> <mon>7am - 8pm</mon> <tues>7am - 8pm</tues> </petrol_hour> </market> I want to parse and get mon and tues values. Any suggesstion? My android code for parsing is here: public void endElement(String uri, String localName, String qName) throws SAXException { elementOn = false; /** * Sets the values after retrieving the values from the XML tags * */ if (localName.equalsIgnoreCase("name")) data.setMarketName(elementValue); else if (localName.equalsIgnoreCase("motorway")) data.setMotorway(elementValue); else if (localName.equalsIgnoreCase("junction")) data.setJunction(elementValue);

    Read the article

  • Manage more Images to move in View

    - by David Pollak
    hi everyone, I'm creating an app which has more UIImageView on a View, they should move normally from a side to the other. I have an issue: after entering the second image, the two UIImageView start to behave crazy (!) because they don' move freely, but they are like restricted in two different areas not touching each other even if I said different things the first thing that I want to do, is to let them move normally; this is the code I am using: `- (void)viewDidLoad { [super viewDidLoad]; pos = CGPointMake(14.0, 7.0); [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; }` - (void) onTimer { pallone.center = CGPointMake(pallone.center.x+pos.x, pallone.center.y+pos.y); if(pallone.center.x > 320 || pallone.center.x < 0) pos.x = -pos.x; if(pallone.center.y > 480 || pallone.center.y < 0) pos.y = -pos.y; } and for the other image that has to enter after: - (IBAction)spara{ cos = CGPointMake(8.0, 4.0); [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(inTimer) userInfo:nil repeats:YES]; } - (void)inTimer{ bomba.center = CGPointMake(bomba.center.x+pos.x, bomba.center.y+pos.y); if(bomba.center.x > 50 || bomba.center.x < 0) pos.x = -pos.x; if(bomba.center.y > 480 || bomba.center.y < 0) pos.y = -pos.y; } what should I change ? and if I'd like the images to move only in one way (y) ? how do I do this ? I know, I'm a newbie thanks in advance

    Read the article

  • Sorting text and attached images in MFMailCompositeViewController?

    - by eOgas
    In the app I'm currently writing I'd like to populate the message body of an e-mail with a combination of text and images. It took me forever to find out that in order to get an embedded image, you had to have bold tags in the message body (...uhhh, yeah), otherwise the image just shows up as an attachment. But now I have the problem that all of the images just go to the end of the body, and I can't programmatically put text after or in between any of the attachments. So far I've tried: Adding images as part of the body string using tags and a base64 string. This would have worked, but most e-mail clients reject images embedded in this manner. Using normal tags with a references to the attached files, using the assigned filenames. Didn't work at all. Attaching images normally, but also attaching blocks of text to the e-mail. The text is not embedded in the same manner as the images. Turns out to be an attached txt file on the receiving end. Apple has restricted their MFMailComposieViewController class to the point of ridiculousness, but I know there has to be a way to do this, because they add in their stupid "Sent from my *apple device name here*" message at the end of every e-mail. So does anyone have any ideas?

    Read the article

  • How do I use Haml in a view in my new plugin?

    - by Eric
    I'm creating a new plugin for a jruby on rails application that will eventually be turned into a gem. Inside my plugin I have controllers, helpers and views. For my views I'd like to use Haml. The problem is that I can't seem to get it to recognize that they are haml templates. Is it even possible to do this? Is there a way for a plugin to have Haml as a dependency for its view? And by that I mean, I intend for the plugin that I'm creating to have a view created by the plugin, that can be used by the application developer. for example: vendor/ plugins/ my_plugin/ lib/ app/ views/ my_plugin_demo/ index.haml.html controllers/ my_plugin_demo_controller.rb helpers/ In my plugin's init.rb, I tried: require 'my_plugin' require 'haml' #doesn't seem to make a difference :( but that didn't seem to make any difference. Has anybody had any experience with this? I can't seem to find any documentation on how to make this work. Are plugin views restricted to .erb templates?

    Read the article

  • Apache's AuthDigestDomain and Rails Distributed Asset Hosts

    - by Jared
    I've got a server I'm in the process of setting up and I'm running into an Apache configuration problem that I can not get around. I've got Apache 2.2 and Passenger serving a Rails app with distributed asset hosting. This is the feature of Rails that lets you serve your static assets from assets0.example.com, assets1, assets2, and so on. The site needs to be passworded until launch. I've set up HTTP authentication on the site using Apache's mod_auth_digest. In my configuration I'm attempting to use the AuthDigestDomain directive to allow access to each of the asset URLs. The problem is, it doesn't seem to be working. I get the initial prompt for the password when I load the page, but then the first time it loads an asset from one of the asset URLs, I get prompted a 2nd, 3rd, or 4th time. In some browsers, I get prompted for every single resource on the page. I'm hoping that this is only a problem of how I'm specifying my directives and not a limitation of authorization in Apache itself. See the edited auth section below: <Location /> AuthType Digest AuthName "Restricted Site" AuthUserFile /etc/httpd/passwd/passwords AuthGroupFile /dev/null AuthDigestDomain / http://assets0.example.com/ http://assets1.example.com/ http://assets2.example.com/ http://assets3.example.com/ require valid-user order deny,allow allow from all </Location>

    Read the article

  • Is this a good way to generically deserialize objects?

    - by Damien Wildfire
    I have a stream onto which serialized objects representing messages are dumped periodically. The objects are one of a very limited number of types, and other than the actual sequence of bytes that arrives, I have no way of knowing what type of message it is. I would like to simply try to deserialize it as an object of a particular type, and if an exception is thrown, try again with the next type. I have an interface that looks like this: public interface IMessageHandler<T> where T : class, IMessage { T Handle(string message); } // elsewhere: // (These are all xsd.exe-generated classes from an XML schema.) public class AppleMessage : IMessage { ... } public class BananaMessage : IMessage { ... } public class CoconutMessage : IMessage { ... } Then I wrote a GenericHandler<T> that looks like this: public class GenericHandler<T> : IMessageHandler<T> where T: class, IMessage { public class MessageHandler : IMessageHandler { T IMessageHandler.Handle(string message) { T result = default(T); try { // This utility method tries to deserialize the object with an // XmlSerializer as if it were an object of type T. result = Utils.SerializationHelper.Deserialize<T>(message); } catch (InvalidCastException e) { result = default(T); } return result; } } } Two questions: Using my GenericHandler<T> (or something similar to it), I'd now like to populate a collection with handlers that each handle a different type. Then I want to invoke each handler's Handle method on a particular message to see if it can be deserialized. If I get a null result, move onto the next handler; otherwise, the message has been deserialized. Can this be done? Is there a better way to deserialize data of unknown (but restricted) type?

    Read the article

  • saving mySql row checkpoint in table ?

    - by Keet
    hello, I am having a wee problem, and I am sure there is a more convenient/simpler way to achieve the solution, but all searches are throw in up a blanks at the moment ! I have a mysql db that is regularly updated by php page [ via a cron job ] this adds or deletes entries as appropriate. My issue is that I also need to check if any details [ie the phone number or similar] for the entry have changed, but doing this at every call is not possible [ not only does is seem to me to be overkill, but I am restricted by a 3rd party api call limit] Plus this is not critical info. So I was thinking it might be best to just check one entry per page call, and iterate through the rows/entires with each successive page call. What would be the best way of doing this, ie keeping track of which entry/row in the table that the should be checked next? I have 2 ideas of how to implement this: 1 ) The id of current row could be save to a file on the server [ surely not the best way] 2) an extra boolean field [check] is add to the table, set to True on the first entry and false to all other. Then on each page call it; finds 'where check = TRUE' runs the update check on this row, 'set check = FALSE' 'set [the next row] check = TRUE' Si this the best way to do this, or does anyone have any better sugestion ? thanks in advance ! .k PS sorry about the title

    Read the article

  • How can I define an irregular area of the screen and find the closest point to the mouse in that area?

    - by JonathonG
    I'm looking for a method to define an area of the screen that the mouse cannot leave. I have been directed by rob mayoff, the answerer of this question, that I can use a Quartz Event Tap to detect mouse events. This puts me part of the way to the solution to THIS question. I need to define an irregular area of the screen, not just a rectangle, that the mouse cannot leave. I have been researching this and the only idea I can come up with is using a bitmap to define the irregular area, as it will be very oddly shaped. However, I am open to solutions other than using a bitmap. Since this must be done on a Mac, I've determined that I will have to use objective C / Cocoa . I need to know how to define the area and, equally importantly, how to find the closest point in the area to the mouse (so that I can move the mouse to it if the mouse tries to move outside of the area). This is similar to what the restricted area will look like: [edit:] Okay, I've come up with part of the answer to this. If I can do a basic (light-weight) point collision detection on the image mask, I can use a simple algorithm to detect the closest point to the mouse on the black area of the image. I could do this by calculating distance between a pre-defined point (P) inside the black area of the image and the target mouse position (T), taking the midpoint (M), then checking if the midpoint is inside or outside of the shape (black or white, respectively). If M is inside the shape, then move the P to M, otherwise move T to the M, continuously recalculate this until the distance between T and P is 1 pixel or less, then move the mouse to the final calculated position. All of that being said, I still need some way to test the position of the mouse against that same position on the bitmap (assume the bitmap is the same resolution as the monitor), and check if that point is black or white. All of this needs to be done in the background, without this application actually having focus, or the bitmap being visible... is this possible?

    Read the article

  • Redirecting http to https for a directory, via .htaccess, using mod_alias only

    - by Belinda
    I have the common problem of wanting to redirect requests for a certain restricted access directory from http to https, so that users' login credentials are sent in a secure way. However, I do not have mod_rewrite enabled on my server. I only have mod_alias. This means I have to use the RedirectMatch command. I can't use the usual solutions that use RewriteCond and RewriteRule. (A note on the politics: I am a small-fry subsite maintainer in a very large organisation, so the server admins are unlikely to be willing to change the server config for me!) The following line works, but forms an infinite loop (because the rewritten URL is still caught by the initial regular expression): RedirectMatch permanent ^/intranet(.*)$ https://example.com/intranet$1 One of my internal IT guys has suggested I avoid the infinite loop by moving the files to a new directory with a new name (eg /intranet2/). That seems pretty ugly to me. And people could still accidentally/deliberately revert to an insecure connection by visiting http://example.com/intranet2/ directly. Then I tried this, but it didn't work: RedirectMatch permanent ^http:(.*)/intranet(.*)$ https://example.com/intranet$1 I suspect it didn't work because the first argument must be a file path from the root directory, so it can't start with "http:". So: any better ideas how to do this?

    Read the article

  • why my pagination link doesnt appear ?

    - by udaya
    This is my script which i have used to paginate ,,The datas are restricted to 4 but the pagination link doesn't appear <? require_once ('Pager/Pager.php'); $connection = mysql_connect( "localhost" , "root" , "" ); mysql_select_db( "ssit",$connection); $result=mysql_query("SELECT dFrindName FROM tbl_friendslist", $connection); $row = mysql_fetch_array($result); $totalItems = $row['total']; $pager_options = array( 'mode' => 'Sliding', // Sliding or Jumping mode. See below. 'perPage' => 4, // Total rows to show per page 'delta' => 4, // See below 'totalItems' => $totalItems, ); $pager = Pager::factory($pager_options); echo $pager->links; list($from, $to) = $pager->getOffsetByPageId(); $from = $from - 1; $perPage = $pager_options['perPage']; $result = mysql_query("SELECT * FROM tbl_friendslist LIMIT 5 , $perPage",$connection); while($row = mysql_fetch_array($result)) { echo $row['dFrindName'].'</br>'; } ?>

    Read the article

  • Parallelizing for loop

    - by vman049
    I have MATLAB code which I'm trying to parallelize with a simple change from "for" to "parfor." I'm unable to do so because of an error I'm receiving on the variable "votes" which states: Valid indices for 'votes' are restricted in PARFOR loops. Explanation: For MATLAB to execute parfor loops efficiently, the amount of data sent to the MATLAB workers must be minimal. One of the ways MATLAB achieves this is by restricting the way variables can be indexed in parfor iterations. The indicated variable is indexed in a way that is incompatible with parfor. Suggested Action: Fix the indexing. For a description of the indexing restrictions, see “Sliced Variables” in the Parallel Computing Toolbox documentation. Below is my code: votes = zeros(num_layers, size(spikes, 1), size(SVMs_layer1, 1)); predDir = zeros(size(spikes, 1), 1); chronProb = zeros([num_layers, size(chronDists)]); for i = 1:num_layers switch i case 1 B = B1; k_elem_temp = k_elem1; rest_elem_temp = rest_elem1; case 2 B = B2; k_elem_temp = k_elem2; rest_elem_temp = rest_elem2; case 3 B = B3; k_elem_temp = k_elem3; rest_elem_temp = rest_elem3; end for j = 1:length(chronPred) if chronDists(i, j, :) ~= 0 parfor k = 1:8 chronProb(i, j, k) = logistic(B{k}(1) + chronDists(i, j, k).*(B{k}(2))); votes(i, j, k_elem_temp(k, :)) = votes(i, j, k_elem_temp(k, :)) + chronProb(i, j, k)/num_k(i)/num_layers; votes(i, j, rest_elem_temp(k, :)) = votes(i, j, rest_elem_temp(k, :)) + (1 - chronProb(i, j, k))/num_rest(i)/num_layers; end end end end Do you have any suggestions as to how I could adjust my code so that it runs in parallel? Thank you!

    Read the article

  • Directory listing through FTPS (TLS) is not working

    - by Aron Rotteveel
    We recently switched our server to require TLS for every connection. This is working flawlessly so far, but one of our clients is having problems. Some facts: Server uses Pure-FTPD Server has a passive port range configured Server has no firewall limitations regarding the FTP Client uses WS FTP Client is behind a router Client connects to the same IP as every other, using PASSIVE mode All other clients have no trouble connecting Because of the TLS requirement, connecting using ACTIVE mode is almost not possible, but PASSIVE is working fine for everyone except this specific client. It seems that he is able to connect, but once a LIST command is performed, things go wrong. Log: Finding Host <clienthost> ... Connecting to <serverip:21> Connected to <serverip:21> in 0.020000 seconds, Waiting for Server Response Initializing SSL Session ... 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 5 of 50 allowed. 220-Local time is now 22:14. Server port: 21. 220-This is a private system - No anonymous login 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 15 minutes of inactivity. AUTH TLS 234 AUTH TLS OK. SSL session NOT set for reuse SSL Session Started. Host type (1): Automatic Detect USER <user> 331 User <user> OK. Password required PASS (hidden) 230-User <user> has group access to: <user> 230 OK. Current restricted directory is / SYST 215 UNIX Type: L8 Host type (2): Unix (Standard) PBSZ 0 200 PBSZ=0 PROT P 200 Data protection level set to "private" PWD 257 "/" is your current location CWD /public_html 250 OK. Current directory is /public_html PWD257 "/public_html" is your current location TYPE A 200 TYPE is now ASCII PASV 227 Entering Passive Mode (<serverip>,132,100) connecting data channel to <serverip>:132,100(33892) Substituting connection address <serverip> for private address <serverip> from PASV Using external address <customer ext. ip> instead of local address <customer int. ip> for PORT command PORT 82,161,56,225,195,181 200 PORT command successful LIST Error reading response from server. It appears that the connection is dead. Attempting reconnect... Any help is appreciated.

    Read the article

  • Distinction between an extranet and a DMZ

    - by Markus Yrjölä
    I've been reading about intranets, extranets, DMZs and VPNs now, and I'd need some clarifications related to extranets and DMZs. I understand that they are different types of concepts - extranet allows limited access to some intranet resources, while DMZ is a subnet that sits between the internet and intranet and hosts the external-faced services. However, I'd like to know what is their distinction in practice in a usual setup? The Wikipedia article on extranets says that extranets are similar to DMZs because they are used for the same purpose (providing access to some services/resources without exposing the whole intranet). The article also states that an extranet is a part of a VPN, and this TechNet article also states that extranet access is often implemented similarly to remote intranet access, e.g. with a VPN. The TechNet article also says that commonly the extranet is hosted inside the DMZ. This Pearson article says "Although [the DMZ] is technically located within the intranet, [it] can serve as the extranet as well". This is slightly confusing. Consider this scenario: A company has a B2C website hosted in the DMZ. The website can be accessed from anywhere, but requires user authentication. The underlying web app has its database inside the intranet and also interacts with some web services that are hosted inside the intranet (i.e. it accesses intranet resources). The way I see it, the website does effectively offer a restricted access to the intranet. But can it be considered an extranet? If we take the Wikipedia definition of an extranet literally - "An extranet is a computer network that allows controlled access from outside of an organization's intranet" - I think it can. Let's say that the above can't be considered an extranet. What if we change the scenario slightly, and say it's a B2B website, where the access is e.g. limited to connections coming from a specific business partner (by using site-to-site VPN, for example). In this case it surely is an extranet, right? If this is the case, then the difference between extranet services and any other services hosted in the DMZ is simply access restrictions?

    Read the article

  • Rsync: windows 7, synology: login error and permission denied error

    - by loonboon
    Good day to all of you all, I'm running into strange/stupid errors, and I hope anybody would be so kind to help me out. I have to admit, I am by no means a guru, so please bear with me :-) Situation: -Synology NAS (runs Linux), and Windows 7 desktop (1 normal/restricted user Lisa and 1 admin user). - Data from W7 desktop to be rsynced to synology: /volume1/home/Lisa/Backup - Rsync command: c:\cygwin\bin\rsync -avz /cygdrive/e/Lisa/ [email protected]:/volume1/homes/Lisa/Backup - I've set up ssh per these two threads: a. http://www.cesareriva.com/archives/102 b. http://www.cesareriva.com/archives/112 Now the horrors begin: - root is allowed to run the rsync succesfully, however, he doesn't login automatically (so I can not use rsync in W7 batchscripts, which is of course required). - Lisa is allowed to login automatically but he can not succesfully finish the rsync command because of permission errors: rsync change dir /volume1/homes/Lisa/Backup failed: permissions denied. This happens for each and every file and subdir rsync tries to create. However, the main directory (Backup) is created. When I try to copy files from windows explorer to the directory 'Backup' using the very same user Lisa everything goes smoothly. So, obviously, there is a permission problem somewhere; either my rsync-command isn't correct, or the folder permissions for homes/Lisa aren't correct (but, then again, Windows 7 copies files to that folder without any problems, so that does make me believe the homes/Lisa-permissions don't appear to be the problem). I also tried adding: --chmod=Dugo+x --chmod=ugo+r which I found somewhere on the web, to the rsync-command, but this didn't solve any problem and gave the exact errors. Would anybody please please help me on how to fix this? I am utterly frustrated about this, because I have been trying for 1 month to get everything to work and it simply doesn't work. I bought the big Synology to end the horrors of 20 external USB-disks for once and for all (we have many pictures and home vids of our deceased dogs and want to watch these, the horrors being 'what material is on what disk'). I'll gladly return the favour of somebody helping me out by buying you a nice beer (paypal), if you could end my misery. I am not extremely skilled on Linux (not at all :-( ) so if you could give an extra word when possible so I understand what to do, I'd be very grateful. I really hope somebody can help me out, Thank you in advance, Lisa

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39  | Next Page >