Search Results

Search found 4793 results on 192 pages for 'protected'.

Page 80/192 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Program for keeping encrypted files.

    - by Giorgi
    I am looking for a program which will encrypt files specified by me and allow me to view/edit/delete those files without creating a virtual disk. I do not want to have virtual disk as a domain administrator can access it so truecrypt is not the possibility. One possibility is to use winrar with password protected archive but winrar serves a different goal so it is not very user friendly for this purpose. If it's possible it would be nice if the program does not creates temp files while I open the files. Any suggestions?

    Read the article

  • Gmail/Facebook/Hotmail not opening in Firefox/IE on Windows 7 Home

    - by singlepoint
    Hi, I am unable to open Gmail/Facebook/Hotmail on Firefox/IE on Widows 7 Home. I just unboxed a brand new hp laptop with Norton Security Suite running inside. I get following error message on Firefox. Please help. The connection has timed out The server at www.google.com is taking too long to respond. * The site could be temporarily unavailable or too busy. Try again in a few moments. * If you are unable to load any pages, check your computer's network connection. * If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web

    Read the article

  • CRM 2011 Plugin for CREATE (post-operational): Why is the value of "baseamount" zero in post entity image and target?

    - by Olli
    REFORMULATED QUESTION (Apr 24): I am using the CRM Developer Toolkit for VS2012 to create a CRM2011 plugin. The plugin is registered for the CREATE message of the "Invoice Product" entity. Pipeline-Stage is post-operational, execution is synchronous. I register for a post image that contains baseamount. The toolkit creates an execute function that looks like this: protected void ExecutePostInvoiceProductCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } IPluginExecutionContext context = localContext.PluginExecutionContext; Entity postImageEntity = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null; } Since we are in post operational stage, the value of baseamount in postImageEntity should already be calculated from the user input, right? However, the value of baseamountin the postImageEntity is zero. The same holds true for the value of baseamount in the target entity that I get using the following code: Entity targetEntity = (context.InputParameters != null && context.InputParameters.Contains("Target")) ? (Entity)context.InputParameters["Target"] : null; Using a retrieve request like the one below, I am getting the correct value of baseamount: Entity newlyCreated = service.Retrieve("invoicedetail", targetEntity.Id, new ColumnSet(true)); decimal baseAmount = newlyCreated.GetAttributeValue<Money>("baseamount").Value; The issue does not appear in post operational stage of an update event. I'd be glad to hear your ideas/explanations/suggestions on why this is the case... (Further information: Remote debugging, no isolation mode, plugin stored in database) Original Question: I am working on a plugin for CRM 2011 that is supposed to calculate the amount of tax to be paid when an invoice detail is created. To this end I am trying to get the baseamount of the newly created invoicedetail entity from the post entity image in post operational stage. As far as I understood it, the post entity image is a snapshot of the entity in the database after the new invoice detail has been created. Thus it should contain all properties of the newly created invoice detail. I am getting a "postentityimages" property of the IPluginExecutionContext that contains an entity with the alias I registered ("postImage"). This "postImage" entity contains a key for "baseamount" but its value is 0. Can anybody help me understand why this is the case and what I can do about it? (I also noticed that the postImage does not contain all but only a subset of the entities I registered for.) Here is what the code looks like: protected void ExecutePostInvoiceProductCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } // Get PluginExecutionContext to obtain PostEntityImages IPluginExecutionContext context = localContext.PluginExecutionContext; // This works: I get a postImage that is not null. Entity postImage = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null; // Here is the problem: There is a "baseamount" key in the postImage // but its value is zero! decimal baseAmount = ((Money)postImage["baseamount"]).Value; } ADDITION: Pre and post images for post operational update contain non-zero values for baseamount.

    Read the article

  • How can I monitor network traffic in an all Mac home network?

    - by raiglstorfer
    I have an all Mac network consisting of an Airport Extreme, 1 MacPro, 1 Mac Mini, 2 MackBook Pros, 2 iPads, and 2 iPhones. The Mac Pro is connected directly to the Airport Extreme via Cat5 and the rest is all running via Wireless. Lately I've been getting prompted by Google to enter Capchas frequently. The message states that I might have software running on my network I'm not aware of. My wireless router is password protected using WPA2 Personal and I frequently change my password so I don't think someone is using the network from outside (but I've no way to confirm this). I'm looking for a relatively cheap (preferably open source) solution that would enable me to monitor and profile the network usage by machine and port. Can someone recommend a solution?

    Read the article

  • How can I monitor network traffic in an all Mac home network?

    - by raiglstorfer
    I have an all Mac network consisting of an Airport Extreme, 1 MacPro, 1 Mac Mini, 2 MackBook Pros, 2 iPads, and 2 iPhones. The Mac Pro is connected directly to the Airport Extreme via Cat5 and the rest is all running via Wireless. Lately I've been getting prompted by Google to enter Capchas frequently. The message states that I might have software running on my network I'm not aware of. My wireless router is password protected using WPA2 Personal and I frequently change my password so I don't think someone is using the network from outside (but I've no way to confirm this). I'm looking for a relatively cheap (preferably open source) solution that would enable me to monitor and profile the network usage by machine and port. Can someone recommend a solution?

    Read the article

  • Source File not updating Destination Files in Excel

    - by user127105
    I have one source file that holds all my input costs. I then have 30 to 40 destination files (costing sheets) that use links to data in this source file for their various formulae. I was sure when I started this system that any changes I made to the source file, including the insertion of new rows and columns was updated automatically by the destination files, such that the formula always pulled the correct input costs. Now all of a sudden if my destination files are closed and I change the structure of the source file by adding rows - the destination files go haywire? They pick up changes to their linked cells, but don't pick up changes to the source sheet that have shifted their relative positions in the sheet. Do I really need to open all 40 destination files at the same time I alter the source file structure? Further info: all the destination files are protected, and I am working on DropBox.

    Read the article

  • Automate Win8 network and sharing settings

    - by RafaelBarriola
    I am trying to create a unattended DVD installation of Windows 8, but I can't seem to find a solution do this. What I'm looking for are to have the same settings on the Network and Sharing Center, to have the Turn on network discovery "on" for both the private and guest/public within the Control Panel. For private and guest/public, I need to: Turn on network discovery Turn on printer and file sharing Turn off public folder sharing Turn on password protected sharing Use user accounts and passwords to connect to other computers I've been searching for days and have not found a solution yet.

    Read the article

  • SOAP and NHibernate Session in C#

    - by Anonymous Coward
    In a set of SOAP web services the user is authenticated with custom SOAP header (username/password). Each time the user call a WS the following Auth method is called to authenticate and retrieve User object from NHibernate session: [...] public Services : Base { private User user; [...] public string myWS(string username, string password) { if( Auth(username, password) ) { [...] } } } public Base : WebService { protected static ISessionFactory sesFactory; protected static ISession session; static Base { Configuration conf = new Configuration(); [...] sesFactory = conf.BuildSessionFactory(); } private bool Auth(...) { session = sesFactory.OpenSession(); MembershipUser user = null; if (UserCredentials != null && Membership.ValidateUser(username, password)) { luser = Membership.GetUser(username); } ... try { user = (User)session.Get(typeof(User), luser.ProviderUserKey.ToString()); } catch { user = null; throw new [...] } return user != null; } } When the WS work is done the session is cleaned up nicely and everything works: the WSs create, modify and change objects and Nhibernate save them in the DB. The problems come when an user (same username/password) calls the same WS at same time from different clients (machines). The state of the saved objects are inconsistent. How do I manage the session correctly to avoid this? I searched and the documentation about Session management in NHibernate is really vast. Should I Lock over user object? Should I set up a "session share" management between WS calls from same user? Should I use Transaction in some savvy way? Thanks Update1 Yes, mSession is 'session'. Update2 Even with a non-static session object the data saved in the DB are inconsistent. The pattern I use to insert/save object is the following: var return_value = [...]; try { using(ITransaction tx = session.Transaction) { tx.Begin(); MyType obj = new MyType(); user.field = user.field - obj.field; // The fields names are i.e. but this is actually what happens. session.Save(user); session.Save(obj); tx.Commit(); return_value = obj.another_field; } } catch ([...]) { // Handling exceptions... } finally { // Clean up session.Flush(); session.Close(); } return return_value; All new objects (MyType) are correctly saved but the user.field status is not as I would expect. Even obj.another_field is correct (the field is an ID with generated=on-save policy). It is like 'user.field = user.field - obj.field;' is executed more times then necessary.

    Read the article

  • Would a switch be covered by a router's firewall

    - by Uh-yeah...
    So... Hopefully; this is the right place for this question. I need more Ethernet ports on my home network. Sadly, we already have an old router connected to the main router and we still need more ports. I feel dumb for asking; but, I just would like to double check. Would the devices connected to the switch be "protected" by the Main router's firewall? ? Up to this point I have assumed that was the case; but, a co-worker is convinced that is not the case [ I believe he is thinking of a situation in which the switch (un-managed) is before an access point]. [It would go modem to main router; main router then has the switch and old router connected to it.

    Read the article

  • Switch to switch encryption over a wireless bridge (TrustSec?)

    - by metatheorem
    I am planning to connect an existing Cisco 3750 switch to a 3560C switch over a wireless PTP bridge. The bridge will be WPA2 protected, but I am looking for an additional measure of security between the switches to prevent other wireless access through either switch. They do not support IPSec, only 802.1Q tunnels, and buying additional hardware is not likely an option. I am looking into using TrustSec manual mode between the switches. After some effort reading into TrustSec and MACsec, I am mostly certain this is a good choice over the wireless bridge, keeping in mind it is a shared medium. Two questions: Can I reliably prevent other wireless traffic from accessing the switches using TrustSec? Does anyone know of any better options with the 3000 series switches?

    Read the article

  • Store and Encrypt data over the internet.

    - by sotsec
    I am trying to build a system where I will be able to access my files remotely. I want to setup an external hard drive or a NAS that I will access over the internet, and I want every file that is stored on that system to be encrypted. Could you please suggest me what is the best way of doing that? Or if you have any knowledge, what is the best way to access your files remotely with maximum safety? but the same time the space that the files are allocated is protected against theft(encryption) etc. thank you

    Read the article

  • remove an open wifi of a service provider near my house

    - by wannik
    I'm using Win 7. There is an access point of a service provider wifi near my house. The wifi is not free and not WEB/WPA protected. Everyone can connect to it and it will show the company's login page. (if the username/password are put correctly, their customer can use the net.) I'm not the customer of the company and have my own access point in my house. But my computer always connect to the network of that company. I tried to remove the network but it keep coming back and connect to that access point instead of mine. What can I do to make my computer choose my access point first?

    Read the article

  • Windows 7 -Can't get access to shared folder from one computer to another.

    - by Carbonara
    I have 2 windows 7 computers and i'm trying to share a folder (that I want password protection on) outside of the homegroup. Both computers are part of the same workgroup and I have the same user account/password combination on both computers plus I have password protected sharing turned on in the network and sharing centre along with file and printer sharing turned on. On computer 1 I have right clicked and selected that I want the folder shared. When I navigate via the network on computer 2 to computer 1 the shared folder shows up on computer 2 but double clicking on it to open it gives me an alert saying I don't have permission to access it, no option to type in the user name and password (according to the help files I shouldn't even need to type the password in if both computers have the same username/password anyway but would need it if I'm logged in as a different user). It's just a blanket denial of access.

    Read the article

  • Sharepoint asks for NTLM credentials for every unique URL. How do I stop it?

    - by CamronBute
    I'm tasked with troubleshooting a problem we're having with a SP2010 site. The app is external, and there are several clients that must connect. Some clients are receiving a crazy amount of credential requests when trying to log on. It appears to ask for every unique URL (eg. every different picture, link, etc) and it won't stop. Other clients are having no problems. I cannot seem to replicate the issue, either. I'm attempting to replicate by restricting all settings (including cookies) on my own browser, but to no avail. I put the HTTP request under a microscope, and it's asking for NTLM credentials. The client is using IE8, and the browser is running in Protected Mode, but the browser settings cannot be determined... I'm guessing this is a webserver thing, simply because it appears to be an authentication thing. What might the problem be?

    Read the article

  • Programatically add UserControl with events

    - by schaermu
    Hi everybody I need to add multiple user controls to a panel for further editing of the contained data. My user control contains some panels, dropdown lists and input elements, which are populated in the user control's Page_Load event. protected void Page_Load(object sender, EventArgs e) { // populate comparer ddl from enum string[] enumNames = Enum.GetNames(typeof (SearchComparision)); var al = new ArrayList(); for (int i = 0; i < enumNames.Length; i++) al.Add(new {Value = i, Name = enumNames[i]}); scOperatorSelection.DataValueField = "Value"; scOperatorSelection.DataTextField = "Name"; ... The data to be displayed is added to the user control as a Field, defined above Page_Load. The signature of the events is the following: public delegate void ControlStateChanged(object sender, SearchCriteriaEventArgs eventArgs); public event ControlStateChanged ItemUpdated; public event ControlStateChanged ItemRemoved; public event ControlStateChanged ItemAdded; The update button on the user control triggers the following method: protected void UpdateCriteria(object sender, EventArgs e) { var searchCritCtl = (SearchCriteria) sender; var scEArgs = new SearchCriteriaEventArgs { TargetCriteria = searchCritCtl.CurrentCriteria.CriteriaId, SearchComparision = ParseCurrentComparer(searchCritCtl.scOperatorSelection.SelectedValue), SearchField = searchCritCtl.scFieldSelection.SelectedValue, SearchValue = searchCritCtl.scFilterValue.Text, ClickTarget = SearchCriteriaClickTarget.Update }; if (ItemUpdated != null) ItemUpdated(this, scEArgs); } The rendering page fetches the data objects from a storage backend and displays it in it's Page_Load event. This is the point where it starts getting tricky: i connect to the custom events! int idIt = 0; foreach (var item in _currentSearch.Items) { SearchCriteria sc = (SearchCriteria)LoadControl("~/content/controls/SearchCriteria.ascx"); sc.ID = "scDispCtl_" + idIt; sc.ControlMode = SearchCriteriaMode.Display; sc.CurrentCriteria = item; sc.ItemUpdated += CriteriaUpdated; sc.ItemRemoved += CriteriaRemoved; pnlDisplayCrit.Controls.Add(sc); idIt++; } When first rendering the page, everything is displayed fine, i get all my data. When i trigger an update event, the user control event is fired correctly, but all fields and controls of the user control are NULL. After a bit of research, i had to come to the conclusion that the event is fired before the controls are initialized... Is there any way to prevent such behavior / to override the page lifecycle somehow? I cannot initialize the user controls in the page's Init-event, because i have to access the Session-Store (not initialized in Page_Init). Any advice is welcome... EDIT: Since we hold all criteria informations in the storage backend (including the count of criteria) and that store uses the userid from the session, we cannot use Page_Init... just for clarification EDIT #2: I managed to get past some of the problems. Since i'm now using simple types, im able to bind all the data declaratively (using a repeater with a simple ItemTemplate). It is bound to the control, they are rendered in correct fashion. On Postback, all the data is rebound to the user control, data is available in the OnDataBinding and OnLoad events, everything looks fine. But as soon it enters the real event (bound to the button control of the user control), all field values are lost somehow... Does anybody know, how the page lifecycle continues to process the request after Databinding/Loading ? I'm going crazy about this issue...

    Read the article

  • Managing multiple ssh keys

    - by Mathijs Kwik
    I have a lot of ssh keys, they are all passphrase protected and managed by ssh-agent. As a result of this, I am now getting "Too many authentication failures" on some connections. As has been explained on this site before, this is because ssh will try all keys the agent throws at it. The proposed solution is to use IdentitiesOnly in the config, together with an IdentityFile. While this indeed stops offering wrong keys, it seems it completely disables the agent in full, so now I have to type the passphrase on every connection. I could not find clear info about this. Does IdentitiesOnly just disable getting keys from ssh-agent in full? Or should it just block out the keys that aren't mentioned? Thanks, Mathijs # here's my config ~% cat .ssh/config Host bluemote HostName some.host.com IdentitiesOnly yes IdentityFile /home/mathijs/.ssh/keys/bluebook_ecdsa # I had the key loaded into the agent, shown here ~% ssh-add -L ecdsa-sha2-nistp521 SOME_LONG_BASE64_NUMBER== /home/mathijs/.ssh/keys/bluebook_ecdsa # but it doesn't seem to get used ~% ssh bluemote Enter passphrase for key '/home/mathijs/.ssh/keys/bluebook_ecdsa':

    Read the article

  • Send nginx X-Accel-Redirect request from remote server

    - by phingage
    I have 2 server first (domain.com) is a django/apache server, second (f1.domain.com) is a file server (nginx) where some files are protected and should be allow download only to registred user, so i have setup a nginx server with a server { listen 80 default_server; server_name *.domanin.com; access_log /home/domanin/logs/access.log; location /files/ { internal; root /home/domanin; } } and from django I send a request via X-Accel-Redirect header, but dosen't work i think because come from a remote server, how can i accomplish my task? regards!

    Read the article

  • Only Execute Code on Certain Requests Java

    - by BillPull
    I am building a little API for class and the teacher supplied us with a link to a tutorial that provided a simple webserver that implements Runnable. I have already written some code that will parse arguments the arguments ( or at least get me the request string ) and some code that will return some simple xml. however I think certain requests like the one for the favicon are sent I think it is messing up my code. I wrapped that in an if else but it does not seem to be working. package server; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.util.*; import java.io.*; import java.net.*; import parkinglots.*; public class WorkerRunnable implements Runnable{ protected Socket clientSocket = null; protected String serverText = null; public WorkerRunnable(Socket clientSocket, String serverText) { this.clientSocket = clientSocket; this.serverText = serverText; } public Boolean authenticateAPI(String key){ //Authenticate Key against Stored Keys //TODO: Create Stored Keys and Compare return true; } public void run() { try { InputStream input = clientSocket.getInputStream(); OutputStream output = clientSocket.getOutputStream(); long time = System.currentTimeMillis(); //TODO: Parse args and output different formats and Authentication //Parse URL Arguments BufferedReader in = new BufferedReader( new InputStreamReader(clientSocket.getInputStream(), "8859_1")); String request = in.readLine(); //Server gets Favicon Request so skip that and goto args System.out.println(request); if ( request != "GET /favicon.ico HTTP/1.1" && request != "GET / HTTP/1.1" && request != null ){ String format = "", apikey =""; System.out.println("I am Here"); String request_location = request.split(" ")[1]; String request_args = request_location.replace("/",""); request_args = request_args.replace("?",""); String[] queries = request_args.split("&"); System.out.println(queries[0]); for ( int i = 0; i < queries.length; i++ ){ if( queries[i] == "format" ){ format = queries[i].split("=")[1]; } else if( queries[i] == "apikey" ){ apikey = queries[i].split("=")[1]; } } if( apikey == "" ){ apikey = "None"; } if( format == "" ){ format = "xml"; } Boolean auth = authenticateAPI(apikey); if ( auth ){ if ( format == "xml"){ // Retrieve XML Document String xml = LotFromDB.getParkingLotXML(); output.write((xml).getBytes()); }else{ //Retrieve JSON String json = LotFromDB.getParkingLotJSON(); output.write((json).getBytes()); } }else{ output.write(("Access Denied - User is Not Authenticated").getBytes()); } }else{ output.write(("Access Denied Must Pass API Key").getBytes()); } output.close(); input.close(); System.out.println("Request processed: " + time); } catch (IOException e) { //report exceptions e.printStackTrace(); } } } Console output I get I am Here format=json Request processed: 1333516648331 GET /favicon.ico HTTP/1.1 I am Here favicon.ico Request processed: 1333516648332 It always returns the XML as well. This is my first exposure to writing a web server and dealing with networking in Java, which frustrates me a lot in general, So any suggestions here are very appreciated.

    Read the article

  • Creating a Virtual Host with xampp

    - by Will
    i'm using xampp trying to set up a virtual host. Here's my httpd-vhosts.conf file: <VirtualHost *:80> DocumentRoot "C:\Users\wbaizer\PhpstormProjects\Test" ServerName test1.localhost </VirtualHost> my hosts file has the following: 127.0.0.1 test1.localhost when I try to access test1.localhost in Chrome it gives me this message: "You don't have permission to access the requested directory. There is either no index document or the directory is read-protected." What am I doing wrong, what do I need to do, and how do I do that?

    Read the article

  • listview not updating,inserting

    - by raging_boner
    Data entered in textboxes is not getting updated in database. In debug mode I see that textbox1 and textbox2 in ItemUpdating event contain the same values as they had before calling ItemUpdating. Here's my listview control: <asp:ListView ID="ListView1" runat="server" onitemediting="ListView1_ItemEditing" onitemupdating="ListView1_ItemUpdating" oniteminserting="ListView1_ItemInserting"> //LayoutTemplate removed <ItemTemplate> <td align="center" valign="top"> <asp:Label ID="Label2" runat="server" Text='<%#Eval("id")%>'></asp:Label><br /> <asp:Label ID="Label3" runat="server" Text='<%#Eval("text1")%>'></asp:Label> </td> <td> <asp:LinkButton ID="LinkButton2" CommandName="Edit" runat="server">Edit</asp:LinkButton> <asp:LinkButton ID="LinkButton4" CommandName="Delete" runat="server">Delete</asp:LinkButton> </td> </ItemTemplate> <EditItemTemplate> <td align="center" valign="top"> <asp:Label ID="Label1" runat="server" Text='<%#Eval("id")%>'></asp:Label> <asp:TextBox ID="TextBox1" runat="server" Text='<%#Eval("text1")%>' TextMode="MultiLine" /> <asp:TextBox ID="TextBox2" runat="server" Text='<%#Eval("text2")%>' Height="100" TextMode="MultiLine" /> <asp:LinkButton ID="LinkButton1" CommandName="Update" CommandArgument='<%# Eval("id")%>' runat="server">Update</asp:LinkButton> <asp:LinkButton ID="LinkButton5" CommandName="Cancel" runat="server">Cancel</asp:LinkButton> </td> </EditItemTemplate> <InsertItemTemplate> <td align="center" valign="top"> <asp:TextBox ID="TextBox3" runat="server" TextMode="MultiLine" Height="100"></asp:TextBox> <asp:TextBox ID="TextBox4" runat="server" Height="100" TextMode="MultiLine"></asp:TextBox><br/> <asp:LinkButton ID="LinkButton3" runat="server">Insert</asp:LinkButton> </td> </InsertItemTemplate> </asp:ListView> Codebehind file: protected void ListView1_ItemEditing(object sender, ListViewEditEventArgs e) { ListView1.EditIndex = e.NewEditIndex; BindList(); } protected void ListView1_ItemUpdating(object sender, ListViewUpdateEventArgs e) { ListViewItem myItem = ListView1.Items[ListView1.EditIndex]; Label id = (Label)myItem.FindControl("Label1"); int dbid = int.Parse(id.Text); TextBox text1 = (TextBox)myItem.FindControl("Textbox1"); TextBox text2 = (TextBox)myItem.FindControl("Textbox2"); //tried to work withNewValues below, but they don't work, "null reference" error is being thrown //text1.Text = e.NewValues["text1"].ToString(); //text2.Text = e.NewValues["text2"].ToString(); //odbc connection routine removed. //i know that there should be odbc parameteres: comm = new OdbcCommand("UPDATE table SET text1 = '" + text1.Text + "', text2 = '" + text2.Text + "' WHERE id = '" + dbid + "'", connection); comm.ExecuteNonQuery(); conn.Close(); ListView1.EditIndex = -1; //here I databind ListView1 } What's wrong with updating of text1.Text, text2.Text in ItemUpdating event? Should I use e.NewValues property? If so, how to use it? Thanks in advance for any help.

    Read the article

  • Templates, interfaces (multiple inheritance) and static functions (named constructors)

    - by fledgling Cxx user
    Setup I have a graph library where I am trying to decompose things as much as possible, and the cleanest way to describe it that I found is the following: there is a vanilla type node implementing only a list of edges: class node { public: int* edges; int edge_count; }; Then, I would like to be able to add interfaces to this whole mix, like so: template <class T> class node_weight { public: T weight; }; template <class T> class node_position { public: T x; T y; }; and so on. Then, the actual graph class comes in, which is templated on the actual type of node: template <class node_T> class graph { protected: node_T* nodes; public: static graph cartesian(int n, int m) { graph r; r.nodes = new node_T[n * m]; return r; } }; The twist is that it has named constructors which construct some special graphs, like a Cartesian lattice. In this case, I would like to be able to add some extra information into the graph, depending on what interfaces are implemented by node_T. What would be the best way to accomplish this? Possible solution I thought of the following humble solution, through dynamic_cast<>: template <class node_T, class weight_T, class position_T> class graph { protected: node_T* nodes; public: static graph cartesian(int n, int m) { graph r; r.nodes = new node_T[n * m]; if (dynamic_cast<node_weight<weight_T>>(r.nodes[0]) != nullptr) { // do stuff knowing you can add weights } if (dynamic_cast<node_position<positionT>>(r.nodes[0]) != nullptr) { // do stuff knowing you can set position } return r; } }; which would operate on node_T being the following: template <class weight_T, class position_T> class node_weight_position : public node, public node_weight<weight_T>, public node_position<position_T> { // ... }; Questions Is this -- philosophically -- the right way to go? I know people don't look nicely at multiple inheritance, though with "interfaces" like these it should all be fine. There are unfortunately problems with this. From what I know at least, dynamic_cast<> involves quite a bit of run-time overhead. Hence, I run into a problem with what I had solved earlier: writing graph algorithms that require weights independently of whether the actual node_T class has weights or not. The solution with this 'interface' approach would be to write a function: template <class node_T, class weight_T> inline weight_T get_weight(node_T const & n) { if (dynamic_cast<node_weight<weight_T>>(n) != nullptr) { return dynamic_cast<node_weight<weight_T>>(n).weight; } return T(1); } but the issue with it is that it works using run-time information (dynamic_cast), yet in principle I would like to decide it at compile-time and thus make the code more efficient. If there is a different solution that would solve both problems, especially a cleaner and better one than what I have, I would love to hear about it!

    Read the article

  • Unable to get my master & details gridview to work.

    - by Javier
    I'm unable to get this to work. I'm very new at programming and would appreciate any help on this. <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { } protected void DataGridSqlDataSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:SqlDataSource ID="DataGrid2SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:JobPostings1ConnectionString %>" SelectCommand="SELECT [Jobs_PK], [Position_Title], [Educ_Level], [Grade], [JP_Description], [Job_Status], [Position_ID] FROM [Jobs]" FilterExpression="Jobs_PK='@Jobs_PK'"> <filterparameters> <asp:ControlParameter Name="Jobs_PK" ControlId="GridView1" PropertyName="SelectedValue" /> </filterparameters> </asp:SqlDataSource> <asp:SqlDataSource ID="DataGridSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:JobPostings1ConnectionString %>" SelectCommand="SELECT [Position_Title], [Jobs_PK] FROM [Jobs]" onselecting="DataGridSqlDataSource_Selecting"> </asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Jobs_PK" DataSourceID="DataGridSqlDataSource" AllowPaging="True" AutoGenerateSelectButton="True" SelectedIndex="0" Width="100px"> <Columns> <asp:BoundField DataField="Position_Title" HeaderText="Position_Title" SortExpression="Position_Title" /> <asp:BoundField DataField="Jobs_PK" HeaderText="Jobs_PK" InsertVisible="False" ReadOnly="True" SortExpression="Jobs_PK" /> </Columns> </asp:GridView> <br /> <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="Jobs_PK" DataSourceID="DataGrid2SqlDataSource" Height="50px" Width="125px"> <Fields> <asp:BoundField DataField="Jobs_PK" HeaderText="Jobs_PK" InsertVisible="False" ReadOnly="True" SortExpression="Jobs_PK" /> <asp:BoundField DataField="Position_Title" HeaderText="Position_Title" SortExpression="Position_Title" /> <asp:BoundField DataField="Educ_Level" HeaderText="Educ_Level" SortExpression="Educ_Level" /> <asp:BoundField DataField="Grade" HeaderText="Grade" SortExpression="Grade" /> <asp:BoundField DataField="JP_Description" HeaderText="JP_Description" SortExpression="JP_Description" /> <asp:BoundField DataField="Job_Status" HeaderText="Job_Status" SortExpression="Job_Status" /> <asp:BoundField DataField="Position_ID" HeaderText="Position_ID" SortExpression="Position_ID" /> </Fields> </asp:DetailsView> </div> </form> </body> error message: Cannot perform '=' operation on System.Int32 and System.String. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.EvaluateException: Cannot perform '=' operation on System.Int32 and System.String.

    Read the article

  • htpasswd and htaccess in Plesk 9.3

    - by J White
    Greetings Here is my situation. I currently have one website on my dedicated server. As of now, I have protected the directory /exclusive using the Plesk control panel. I am having a billing company install their password management script on the server but they need the absolute location to the .htpasswd file. I can't find it or the .htaccess file. Would it be easier to unprotect the /exclusive directory and create the .htaccess file in notepad? If this is done, where should I place the .htpasswd file? -jw

    Read the article

  • Suspicious activity in access logs - someone trying to find phpmyadmin dir - should I worry?

    - by undefined
    I was looking over the access logs for a server that we are running on Amazon Web Services. I noticed that someone was obviously trying to find the phpmyadmin directory - they (or a bot) were trying different paths eg - admin/phpmyadmin/, db_admin, ... and the list goes on. Actually there isnt a database on this server and so this was not a problem, they were never going to find it, but should I be worried about such snooping? Is this just a really basic attempt at getting in to our system? Actually our database is held on another managed server which I assume is protected from such intrusions. What are your views on such sneaky activity?

    Read the article

  • Windows Sharing requires password

    - by Linux Intel
    I have 3 machines on my local network Machine A , Machine B and Machine C OS on all machines is : Windows 7 64bit. Sharing Permissions on all machines : Everyone ( Read/Write ) no domain. Sharing folder name : project Machine A is sharing folder over the network without password. Machine B is sharing folder over the network without password. Machine C is sharing folder over the network without password. Machine A can normally access B and C without password required. Machine B can normally access A and C without password required Machine C can normally access Machine B without password. My problem is *Machine C* requires a password when it access Machine A also the shared folder in Machine A don't have password protected and Machine B can access Machine A without a password ! How can i solve the problem .?

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >