Search Results

Search found 15923 results on 637 pages for 'static reflection'.

Page 42/637 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Is it important to obfuscate C++ application code?

    - by user827992
    In the Java world, it seems to sometimes be a problem, but, what about C++? Are there different solutions? I was thinking about the fact that someone can replace the C++ library of a specific OS with a different version of the same library, but full of debug symbols to understand what my code does. IS tt a good thing to use standard or popular libraries? This can also happen with some dll library under Windows replaced with the "debug version" of that library. Is it better to prefer static compilation? In commercial applications, I see that for the core of their app they compile everything statically and for the most part the dlls (dynamic libraries in general) are used to offer some third party technologies like anti-piracy solutions (I see this in many games), GUI library (like Qt), OS libraries, etc. Is static compilation the equivalent to obfuscation in the Java world? In better terms, is it the best and most affordable solution to protect your code?

    Read the article

  • System.Reflection.AmbiguousMatchException

    - by grid-wpf-architect
    Hi , I added Designer support for my control. I got the following exception when setting the property value like below. var colStyle = visibleColumn.Properties["PropertyName"].SetValue(Value); The same above code works fine for VS 2010 project but it shows the following exception for VS 2008 project InnerException: System.Reflection.AmbiguousMatchException Message="Ambiguous match found." Source="mscorlib"

    Read the article

  • Recommended flexible website solution?

    - by Omega
    My site has a MyBB forums installation, and that is pretty much all I need. Forums. However, I need a homepage and a couple other static pages, for showing relevant information, links, etc. I don't need something fancy, all I need is something very flexible regarding theme and style editing, and just a couple simple modules, like public polls. That's all. I am very graphical, and I am looking for something to let me edit pretty much every aspect of the site. These are static pages, mainly, so I don't need something very complex. Some people tell me to use Dreamweaver, but quite honestly, that is not what I am looking for, even thought it does offer a lot of flexibility. I want something like, you know, Drupal or.. some other simple, deeply-editable in terms of graphics and style web platform. What would you recommend to me? Thank you.

    Read the article

  • Why does instanceof seem to work in a static generic function sometimes?

    - by michael
    Greetings. This is my first post in this site. I thought that because of type erasure, one could not expect the following code to compile, and indeed, it did not compile on an earlier version of Eclipse. My understanding was that instanceof was a run-time operator and could not know about the generic type which would be, by run-time, compiled away: public static <E extends Comparable<? super E>> void SampleForQuestion(E e) { if ( !(e instanceof String) ) System.out.println("I am not a String"); else System.out.println("I am a String"); } However, I was surprised to see that one of your threads actually included some code like this in an answer, and my latest Eclipse (Galileo on Windows with JVM 1.6 rev 20) is perfectly happy with it -- and it works, too. (I did notice that someone said it worked on Eclipse but not in another IDE/JDK in that thread, but don't remember the specifics.) Can someone explain why it works, and more importantly, because I have to guide my students, whether it should be expected to work in the future. Thank you. (I hope the code formatting comes through correctly - it looks indented correctly from my perspective and there are no tabs.)

    Read the article

  • Java - Calling all methods of a class

    - by Thomas Eschemann
    I'm currently working on an application that has to render several Freemarker templates. So far I have a Generator class that handles the rendering. The class looks more or less like this: public class Generator { public static void generate(…) { renderTemplate1(); renderTemplate2(); renderTemplate3(); } private static void render(…) { // renders the template } private static void renderTemplate1() { // Create config object for the rendering // and calls render(); }; private static void renderTemplate1() { // Create config object for the rendering // and calls render(); }; … } This works, but it doesn't really feel right. What I would like to do is create a class that holds all the renderTemplate...() methods and then call them dynamically from my Generator class. This would make it cleaner and easier to extend. I was thinking about using something like reflection, but it doesn't really feel like a good solution either. Any idea on how to implement this properly ?

    Read the article

  • C++: Declare static variable in function argument list

    - by MDC
    Is there any way at all in C++ to declare a static variable while passing it to a function? I'm looking to use a macro to expand to the expression passed to the function. The expression needs to declare and initialize a static variable on that particular line (based on the filename and line number using FILE and LINE). int foo(int b) { int c = b + 2; return c; } int main() { int a = 3; a = foo(static int h = 2); //<---- see this! cout << a; return 0; } The problem I'm trying to solve is getting the filename and line number with the FILE and LINE macros provided by the preprocessor, but then creating a lookup table with integer keys leading to the FILE, LINE pairs. For example, the key 89 may map to file foo.cpp, line 20. To get this to work, I'm trying to use local static variables, so that they are initialized only once per line execution. The static variable will be initialized by calling a function that calculates the integer key and adds an entry to the lookup table if it is not there. Right now the program uses a message class to send exception information. I'm writing a macro to wrap this class into a new class: WRAPPER_MACRO(old_class_object) will expand to NewClass(old_class_object, key_value). If I add the static variable declaration as a second line right before this, it should work. The problem is that in most places in the code, the old class object is passed as an argument to a function. So the problem becomes declaring and initializing the static variable somehow with the macro, while keeping the existing function calls.

    Read the article

  • Listbox - selected item to call the class method directly using reflection

    - by Karan
    I have a problem scenario like this:- 1) Listbox with values like Car, Scooter and Bike. A button to click. <div> <asp:ListBox ID="lst" runat="server"> <asp:ListItem Text="Bike" Value="Bike"></asp:ListItem> <asp:ListItem Text="Car" Value="Car"></asp:ListItem> <asp:ListItem Text="Scooter" Value="Scooter"></asp:ListItem> </asp:ListBox> <br /> <br /> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Invoke" /> </div> 2) Now i have three different class like below:- class Car { static string getData() { return "I like cars"; } } class Bike { static string getData() { return "I like Bike"; } } class Scooter { static string getData() { return "I dont like scooter"; } } 3) Now on the button click event handler "Button1_Click", i want to call the getData() method based on the selected value from the listbox using the REFLECTION only. Please help me out.

    Read the article

  • Objective-C Result from a Static Method saved to class instance variable giving "EXC_BAD_ACCESS" when used.

    - by KinGBin
    I am trying to store the md5 string as a class instance variable instead of the actual password. I have a static function that will return a md5 string which I'm trying to store in an instance variable instead of the actual password. I have the following setter for my class instance variable: -(void)setPassword:(NSString *)newpass{ if(newpass != password){ password = [utils md5HexDigest:newpass]; } } This will pass back the correct md5 string and save it to the password variable in my init function: [self setPassword:pword];. If I call another instance method and try to access self.password" I will get "EXC_BAD_ACCESS". I understand that the memory is getting released, but I have no clue to make sure it stays. I have tried alloc init with autorelease with no luck. This is the md5HexDigest function getting called during the init (graciously found in another stackoverflow question): + (NSString*)md5HexDigest:(NSString*)input { const char* str = [input UTF8String]; unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5(str, strlen(str), result); NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2]; for(int i = 0; i<CC_MD5_DIGEST_LENGTH; i++) { [ret appendFormat:@"%02x",result[i]]; } return ret; } Any help/pointers would be greatly appreciated. I would rather have the md5 string saved in memory than the actual password calling the md5 every time I needed to use the password. Thanks in advance.

    Read the article

  • When calling a static method on parent class, can the parent class deduce the type on the child (C#)

    - by Matt
    Suppose we have 2 classes, Child, and the class from which it inherits, Parent. class Parent { public static void MyFunction(){} } class Child : Parent { } Is it possible to determine in the parent class how the method was called? Because we can call it two ways: Parent.MyFunction(); Child.MyFunction(); My current approach was trying to use: MethodInfo.GetCurrentMethod().ReflectedType; // and MethodInfo.GetCurrentMethod().DeclaringType; But both appear to return the Parent type. If you are wondering what, exactly I am trying to accomplish (and why I am violating the basic OOP rule that the parent shouldn't have to know anything about the child), the short of it is this (let me know if you want the long version): I have a Model structure representing some of our data that persists to the database. All of these models inherit from an abstract Parent. This parent implements a couple of events, such as SaveEvent, DeleteEvent, etc. We want to be able to subscribe to events specific to the type. So, even though the event is in the parent, I want to be able to do: Child.SaveEvent += new EventHandler((sender, args) => {}); I have everything in place, where the event is actually backed by a dictionary of event handlers, hashed by type. The last thing I need to get working is correctly detecting the Child type, when doing Child.SaveEvent. I know I can implement the event in each child class (even forcing it through use of abstract), but it would be nice to keep it all in the parent, which is the class actually firing the events (since it implements the common save/delete/change functionality).

    Read the article

  • Proxy cache zone static is unknown

    - by AnApprentice
    I'm working to setup a reverse proxy cache. In nginx.conf I added the following: location /blog { # Reverse Proxy # Cache the Blog Pages from Heroku proxy_cache STATIC; proxy_cache_valid 200 10m; proxy_cache_valid 404 1m; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; rewrite ^/blog$ /; rewrite ^/blog/(.*)$ /$1; proxy_pass http://whispering-retreat-1.herokuapp.com; break; } However when trying to restart nginx I received the following error: $ /opt/nginx/sbin/nginx -s stop nginx: [emerg] "proxy_cache" zone "STATIC" is unknown in /opt/nginx/conf/nginx.conf:182 Any ideas what's the problem is with using STATIC? I just want to cache the blog pages so it doesn't hit heroku every time which is horribly slow. Thanks

    Read the article

  • Static NAT in AWS's Virtual Private Cloud (VPC)

    - by user1050797
    Currently in a VPC with a public and a private subnet, all internet bound traffic from the private subnet could be routed via an NAT instance. The NAT instance will port address translate the packet's source IP to use the NAT instance's elastic IP, so the public server can reply to this public address. This is a PAT mechanism. My question is there a way for me to do a static NAT on my NAT instance -- Using the same NAT instance to static NAT an unassociated but reserved elastic IP to a private subnet host. This NAT instance will behave like a physical firewall doing static nat'ing for a bunch of private ip's.

    Read the article

  • Configure static IP with port number which will point to multiple projects on different ports

    - by Yogesh Kadam
    I am developing a project in LAM* and using the Symfony framework. I have one static IP like 99.99.99.99:8000 which points on my Linux server machine. This static IP already has port number of 8000. This Linux server machine has multiple project hosted on it and we access each project in LAN with different port number like abc:81, pqr:82, xyz:83. Is is possible to access each project on same Linux machine by this static IP? If yes then please let me know how to configure and call each project using this IP address.

    Read the article

  • Problems accessing FileZilla FTP Server from static IP

    - by Kurru
    I'm trying to connect to my FTP server from my external IP address on Comcast Business. On the gateway I've set up port-forwarding on ports 20-21 to my server. Additionally I've forwarded ports 7000-8000 to my server for use in passive mode. In my FileZilla Server application I've set up passive mode to use my static IP and to use the subset of ports listed above. Unfortunately, it doesn't work through the external static IP for some reason, but I can internally. When I try to connect through static IP, the FileZila monitor says Connected, sending welcome message.... 220 FileZillaServer version 0.9.37 beta could not send reply, disconnected My firewall doesn't register any block events and windows firewall is disabled. What am I doing wrong or missing?

    Read the article

  • Static error page served by nginx when my application is down

    - by dreeves
    If my (Rails) application is down or undergoing database maintenance or whatever, I'd like to specify at the nginx level to server a static page. So every URL like http://example.com/* should server a static html file, like /var/www/example/foo.html. Trying to specify that in my nginx config is giving me fits and infinite loops and whatnot. I'm trying things like location / { root /var/www/example; index foo.html; rewrite ^/.+$ foo.html; } How would you get every URL on your domain to serve a single static file?

    Read the article

  • IIS 7.5 doesn't load static html pages

    - by Kizz
    There is an IIS 7.5 freshly installed on a dedicated server. ASP.NET 4.0 Web app copied to its folder, new website is created on its own IP on post 80, IIS_IUSR and IUSR accounts have read/execute rights on site's folder, the site is assigned to its own Integrated app pool with 4.0 .NET (I tried Classic pool with the same results). The problem: when I try to access this web site, browser only loads content generated by .NET resources such as aspx pages, .axd files, etc. Static images, static js, css and html files are in the page source but IIS doesn't serve them. Dev tools in all browsers complain that all those static resources have been sent by the server with wrong content type (plain text instead of image, styles, etc). What do I do wrong?

    Read the article

  • Setting up a static IP address (public) in Ubuntu

    - by ycseattle
    I have a business class internet connection and need to setup a static ip address for a machine. I did a search online and only find how to setup static local ip addresses (like 192.168..). I tried the same technique, and only setup the ip address and netmask, but after restart networking the computer could not connect to the outside world. This is what I did: 1) edit /etc/network/interfaces iface eth0 inet static address 173.10.xxx.xx netmask 255.255.255.252 2) edit /etc/resolv.conf search wp.comcast.net nameserver xx.xx.xx.xxx nameserver xx.xx.xx.xxx 3) restart network sudo /etc/init.d/networking restart Now the last step didn't report error, ifconfig shows the ip address was set, but this server cannot connect to outside world, ping google.com and reports "unknown host google.com". Any ideas?

    Read the article

  • serving static file from cookieless domain: alternative cookieless directory

    - by Simone Nigro
    I'm trying to follow all the guidelines of "Google Page Speed??". The directive "Minimize request overhead" requires static content (images, js, css, etc.) on a static server (ie cookieless): https://developers.google.com/speed/docs/best-practices/request I do not want to buy a new server and I was thinking of just setting a directory of my site without cookie with htaccess www.mysite.com/static/.htaccess Header unset Cookie Header unset Set-Cookie I do not know if it can be problematic. Looking on google it seems that no one ever has adopted this type of solution, so I think that it is incorrect. What do you think? alternatively you could do www.mysite.com/.htaccess <FilesMatch "\.(css|js|jpg|png|gif)$"> Header unset Cookie Header unset Set-Cookie </FilesMatch>

    Read the article

  • Configure TCP/IP to use DHCP and a Static IP Address at the Same Time

    - by Tiago
    My computer is configured to obtain a IP address automatically using DHCP. It only has one network adapter. How to configure an additional static IP address? I found a tutorial for Windows XP, but the procedure didn't work for Windows 7. Is it possible to configure two IP addresses on Windows 7, one being static e another being dynamic? How? The dynamic address I got now is 10.17.11.162. The static IP is 10.17.30.19. The network mask is the same: 255.255.224.0. Both work independently, but I don't know how to use both at the same time.

    Read the article

  • port forwarding using 3 static ip addresses

    - by Danny
    I am new to configuring routers. We have purchased a RV016 Cisco business router that has multiwan capability. What we are attempting to do is take map services from 3 different servers and assign 3 different static IP addresses and then forward port 80 through the router. A short term solution to building a proxy server. Is this possible? Right now we have a consumer grade Cisco router and assign a static IP and it works, we attempted the same settings on the business router and cannot get to the internet. We set it DHCP and it works fine, however we want to to forward the static ports not use DHCP.

    Read the article

  • Best way to use mod_rewrite to replace WordPress pages with static files

    - by David Moles
    Here's the situation: I've got an old WordPress installation that I'd like to archive as static files, but I'd also like to preserve old URLs. I've already created the static archive with wget and sorted out the filenames and links. Now I'd like to configure Apache to intercept requests for the old dynamic URL and replace them with the new static one, e.g.: http://www.example.org/log/?p=1234 or http://www.example.org/log/index.php?p=1234 should redirect to http://www.example.org/log/archives/1234.html I've tried adding the following to the VirtualHost config for example.org, but to no effect -- I just get the PHP page. RewriteCond %{REQUEST_URI} /log/ RewriteCond %{QUERY_STRING} p=([^&;]*) RewriteRule ^/$ http://%{SERVER_NAME}/log/archives/%1.html [R,L] I've enabled logging and I can see what look like other rules being applied, but not this one. None of my other guesses at match patterns for %{REQUEST_URI} seem to have any effect either (log, log/, log.*, even .*). I'm new to mod_rewrite and this is mostly cargo cult, so I'm pretty sure I've gotten it wrong. Anyone know what I should be doing here?

    Read the article

  • Ubuntu 11.04 Static IP doesn't take

    - by mrduclaw
    I'm trying to set a static IP address in Ubuntu 11.04. I did a server install. I edited my /etc/network/interfaces file to include: auto eth0 iface eth0 inet static address 10.0.0.100 netmask 255.255.255.0 gateway 10.0.0.1 When I do a /etc/init.d/networking restart this appears to take. After awhile though, that 10.0.0.100 will turn into something dished out by the DHCP server. My problem appears to be similar to this: Ubuntu intrepid - static IP networking keeps restarting with DHCP But I don't have Gnome installed. Is there anything else that's running in the background that could be doing this? And if so, how do I disable it?

    Read the article

  • Configure Virtualbox guest with static IP, SSH and internet access from host

    - by koskoz
    I have an Ubuntu Server 12 virtualbox guest running on a Windows 7 host which has a dynamic IP (and I don't wanna change this considering it's a laptop and I'm changing network frenquently). I want to have a static IP for my VM and a SSH access from my host but I still want to have the internet access on my VM. I tried added a second host only adapter and configured /etc/network/interface to set eth1 to a static ip, but I can't connect via SSH to it. Setting only adapter1 to host only works for SSH and static IP but I lose the internet access.

    Read the article

  • Tomcat directly serve static (css, js) files shared by multiple applications

    - by Josvic Zammit
    I'm using the ExtJS framework which has a bulk of js and css files that are used for all apps. I intend to share these between a number of web applications (different war files). For this reason I would like to serve ExtJS js and css directly from the web server, in my case Tomcat6, which can be used to serve static files, as in this helpful link. Therefore I put my files under /var/lib/tomcat6/webapps/ROOT/extjs/. The static files that are directly under that directory are served correctly, e.g. /extjs/ext.js correctly serves the file at /var/lib/tomcat6/webapps/ROOT/extjs/ext.js. However files in lower-level directories, for example /extjs/welcome/css/welcome.css, which should serve the file at /var/lib/tomcat6/webapps/ROOT/extjs/welcome/css/welcome.css, return a 404. TL/DR Tomcat serves static files only at top-level directory. A 404 is returned for files deeper in the hierarchy. Config file contents: server.xml application's web.xml

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >