Daily Archives

Articles indexed Sunday May 23 2010

Page 18/78 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Windows 7 Ult machine can see XP Pro but not vice versa

    - by Chadworthington
    My new Windows 7 Ult. PC can attach to my work laptop and pull files but my work laptop cannot find my Windows 7 on the network. Is there some sort of limitation going on here? Before I got the new XP machine, my old XP Pro PC could pull files from the XP Pro laptop but not vice versa. The common thread seems to be that the work laptop cannot see other PCs, Windows 7 or not. Could it be because that PC is on a work domain? When I pull files from the work PC, I am prompted for domain credentials, which I provide.

    Read the article

  • How to use javascript class from within document ready

    - by Richard
    Hi, I have this countdown script wrapped as an object located in a separate file Then when I want to setup a counter, the timeout function in the countdown class can not find the object again that I have setup within the document ready. I sort of get that everything that is setup in the document ready is convined to that scope, however it is possible to call functions within other document ready´s. Does anyone has a solution on how I could setup multiple counters slash objects. Or do those basic javascript classes have to become plugins This is some sample code on how the class begins function countdown(obj) { this.obj = obj; this.Div = "clock"; this.BackColor = "white"; this.ForeColor = "black"; this.TargetDate = "12/31/2020 5:00 AM"; this.DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; this.CountActive = true; this.DisplayStr; this.Calcage = cd_Calcage; this.CountBack = cd_CountBack; this.Setup = cd_Setup; } thanks, Richard

    Read the article

  • Does this code depend on string interning to work?

    - by Nick Gotch
    I'm creating a key for a dictionary which is a structure of two strings. When I test this method in a console app, it works, but I'm not sure if the only reason it works is because the strings are being interned and therefore have the same references. Foo foo1 = new Foo(); Foo foo2 = new Foo(); foo1.Key1 = "abc"; foo2.Key1 = "abc"; foo1.Key2 = "def"; foo2.Key2 = "def"; Dictionary<Foo, string> bar = new Dictionary<Foo, string>(); bar.Add(foo1, "found"); if(bar.ContainsKey(foo2)) System.Console.WriteLine("This works."); else System.Console.WriteLine("Does not work"); The struct is simply: public struct Foo { public string Key1; public string Key2; } Are there any cases which would cause this to fail or am I good to rely on this as a unique key?

    Read the article

  • Compiling simple gtk+ application

    - by sterh
    Hello, I try to compile simple gtk+ application in Anjuta IDE. Application is a simple window: # include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *label; GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "??????????, ???!"); label = gtk_label_new("??????????, ???!"); gtk_container_add(GTK_CONTAINER(window), label); gtk_widget_show_all(window); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_main(); return 0; } In make file i have: GTK_CFLAGS = -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 But i see error, when i try to compile project: gtk/gtk.h - No such file or directory Thank you.

    Read the article

  • Is CSS sprint menu not good for accessibility?

    - by metal-gear-solid
    I made a css menu with css sprites but the problem is with sprite we don't use inline image we use in background only so if images are disabled in browser then nothing will show . any solution for this ? For example : See this menu and turn off images : http://line25.com/wp-content/uploads/2009/css-menu/demo/demo.html

    Read the article

  • App_GlobalResources not detected on production server

    - by Hugo Zapata
    I have a asp.net web application project, with some global resources. If i deploy to my dev machine, the resources are used correctly, however in the production server the text appears in the default language so the global resources are not being read. Any ideas? (i copied the App_GlobalResources directory to the production web dir root)

    Read the article

  • php error: unexpected T_OBJECT_OPERATOR.... trying to install magento using ssh commands to dreamhos

    - by Jane
    I am trying to install magento (e-commerce platform) I am following a tutorial that tells me to run this command using ssh: ./pear mage-setup but i'm getting this error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/domainname.com/downloader/pearlib/php/System.php on line 400 Line 400 is commented in the code snippit from the system.php file: /* Magento fix for set tmp dir in config.ini */ if (class_exists('Maged_Controller',false)) { /*line 400 */ $magedConfig = Maged_Controller::model('Config',true)->load();** if ($magedConfig->get('use_custom_permissions_mode') == '1' && $mode = $magedConfig->get('mkdir_mode')) { $result = System::mkDir(array('-m' . $mode, $tmpdir)); } else { $result = System::mkDir(array('-p', $tmpdir)); } if (!$result) { return false; } } Can anyone help my demystify this error?

    Read the article

  • How to setup named instances using StructureMap profiles?

    - by khaledh
    I've done quite a bit of googling and searching here on SO, but couldn't find a similar question or answer. In typical SM configuration you can add multiple named instances for a single PluginType: ForRequestedType<IFoo>() .AddInstances( x => { x.OfConcreteType<FooA>().WithName( "FooA" ); x.OfConcreteType<FooB>().WithName( "FooB" ); } ); No problem there. The problem is that I can't do the same when creating a profile. Most examples explaining how to use profiles use the For<>() method of the passed ProfileExpression: CreateProfile( "Default", p => { p.For<IFoo>().UseConcreteType<FooC>(); } ); I can't seem to find a way to add multiple named instances for the same PluginType as you can do above with regular configuration. The only other method available through ProfileExpression is Type<>(), but I'm not sure if it can be used for this purpose. Edit: I tried to use Type<>() instead of For<>() and it seems to be taking me in the right direction, but I bumped into another problem. To better explain it here's a better example of what I'm trying to do (this is what I posted to the structuremap-users group, no answer yet): ObjectFactory.Initialize( x => { x.CreateProfile( "Nissan", p => { p.Type<ICar>().Is.OfConcreteType<NewNissanCar>().WithName( "New" ); p.Type<ICar>().Is.OfConcreteType<OldNissanCar>().WithName( "Old" ); } ); x.CreateProfile( "Honda", p => { p.Type<ICar>().Is.OfConcreteType<NewHondaCar>().WithName( "New" ); p.Type<ICar>().Is.OfConcreteType<OldHondaCar>().WithName( "Old" ); } ); } ); ObjectFactory.Profile = "Nissan"; ICar newCar = ObjectFactory.GetNamedInstance<ICar>( "New" ); // -> returns NewHondaCar ICar car = ObjectFactory.GetInstance<ICar>(); // -> returns OldNissanCar So even though I set the profile to "Nissan", GetNamedInstance<>("New") returned an instance from the incorrect profile - it should've returned NewNissanCar instead of NewHondaCar. Interestingly, GetInstance<>() uses the correct profile, but because I can't pass an instance name, it returns an arbitrary concrete type from that profile that implements ICar (I guess it just returns the last concrete type added for that interface).

    Read the article

  • Modules vs. Classes and their influence on descendants of ActiveRecord::Base

    - by Chris
    Here's a Ruby OO head scratcher for ya, brought about by this Rails scenario: class Product < ActiveRecord::Base has_many(:prices) # define private helper methods end module PrintProduct attr_accessor(:isbn) # override methods in ActiveRecord::Base end class Book < Product include PrintProduct end Product is the base class of all products. Books are kept in the products table via STI. The PrintProduct module brings some common behavior and state to descendants of Product. Book is used inside fields_for blocks in views. This works for me, but I found some odd behavior: After form submission, inside my controller, if I call a method on a book that is defined in PrintProduct, and that method calls a helper method defined in Product, which in turn calls the prices method defined by has_many, I'll get an error complaining that Book#prices is not found. Why is that? Book is a direct descendant of Product! More interesting is the following.. As I developed this hierarchy PrintProduct started to become more of an abstract ActiveRecord::Base, so I thought it prudent to redefine everything as such: class Product < ActiveRecord::Base end class PrintProduct < Product end class Book < PrintProduct end All method definitions, etc. are the same. In this case, however, my web form won't load because the attributes defined by attr_accessor (which are "virtual attributes" referenced by the form but not persisted in the DB) aren't found. I'll get an error saying that there is no method Book#isbn. Why is that?? I can't see a reason why the attr_accessor attributes are not found inside my form's fields_for block when PrintProduct is a class, but they are found when PrintProduct is a Module. Any insight would be appreciated. I'm dying to know why these errors are occurring!

    Read the article

  • Delphi: play memorystream in wmp activex

    - by junmats
    hi..I'm new to this site and I hope someone can help me with my problem. I am using a Delphi language. And I would want to play a memorystream to windowsmediaplayer ActiveX. Is this possible? If it is, can someone give me a hint or something.. sample code maybe. Thanks.

    Read the article

  • How does one write extconf.rb files when one extension includes header files from another?

    - by mohawkjohn
    This is a follow-up question for: Multiple Ruby modules under one directory What happens if these extensions include each other? For example, you have the following structure: ext/foo ext/bar In ext/bar/bar.h, you have a #include "foo.h" foo.h and foo.cpp compile to form foo.o, to make life a little more complicated. Finally, it is necessary that foo and bar be separate extensions. How is this managed? I can't figure out how to add ../foo to the search path for bar.h, primarily. Symbolic links seem hack-ish.

    Read the article

  • Including huge string in our c++ programs ?

    - by Xinus
    I am trying to include huge string in my c++ programs, Its size is 20598617 characters , I am using #define to achieve it. I have a header file which contains this statement #define "<huge string containing 20598617 characterd>" When I try to compile the program I get error as fatal error C1060: compiler is out of heap space I tried following command line options with no success /Zm200 /Zm1000 /Zm2000 How can I make successful compilation of this program? Platform: Windows 7

    Read the article

  • C# Localization - unexpected behaviour

    - by vikp
    Hi, I have the following line of code: <%= Html.Label((string) GetLocalResourceObject("Label_Email")) %> This generates a label within an HTML page. In the local resource file I have the following entry: Name: Label_Email Value:Email For some very strange reason when I load the page in the browser, it generates an HTML label with a value of "Email Address" instead of "Email". This is a serious problem for me because I need to localize the application and not have english word "address". When I replace Value in the local resouce file with "Email " (notice extra space), everything works fine, but this is a hack and I need to understand why my application is behaving this way. Thank you

    Read the article

  • Interactive Data Language, IDL: Does anybody care?

    - by Alex
    Anyone use a language called Interactive Data Language, IDL? It is popular with scientists. I think it is a poor language because it is proprietary (every terminal running it has to have an expensive license purchased) and it has minimal support (try searching for IDL, the language, right now on stack) . I am trying to convince my colleagues to stop using it and learn C/C++/Python/Fortran/Java/Ruby. Does anybody know about or even care about IDL enough to have opinions on it? What do you think of it? Should I tell my colleagues to stop wasting their time on it now? How can I convince them? Edit: People are getting the impression that I don't know or use IDL. Also, I said IDL has minimal support which is true in one sense, so I must clarify that the scientific libraries are indeed large. I use IDL all the time, but this is exactly the problem: I am only using IDL because colleagues use it. There is a file format IDL uses, the .sav, which can only be opened in IDL. So I must use IDL to work with this data and transfer the data back to colleagues, but I know I would be more efficient in another language. This is like someone sending you a microsoft word file in an email attachment and if you don't understand how wrong that is then you probably write too many words not enough code and you bought microsoft word. Edit: As an alternative to IDL Python is popular. Here is a list of The Pros of IDL (and the cons) from AstroBetter: Pros of IDL Mature many numerical and astronomical libraries available Wide astronomical user base Numerical aspect well integrated with language itself Many local users with deep experience Faster for small arrays Easier installation Good, unified documentation Standard GUI run/debug tool (IDLDE) Single widget system (no angst about which to choose or learn) SAVE/RESTORE capability Use of keyword arguments as flags more convenient Cons of IDL Narrow applicability, not well suited to general programming Slower for large arrays Array functionality less powerful Table support poor Limited ability to extend using C or Fortran, such extensions hard to distribute and support Expensive, sometimes problem collaborating with others that don’t have or can’t afford licenses. Closed source (only RSI can fix bugs) Very awkward to integrate with IRAF tasks Memory management more awkward Single widget system (useless if working within another framework) Plotting: Awkward support for symbols and math text Many font systems, portability issues (v5.1 alleviates somewhat) not as flexible or as extensible plot windows not intrinsically interactive (e.g., pan & zoom) Pros of Python Very general and powerful programming language, yet easy to learn. Strong, but optional, Object Oriented programming support Very large user and developer community, very extensive and broad library base Very extensible with C, C++, or Fortran, portable distribution mechanisms available Free; non-restrictive license; Open Source Becoming the standard scripting language for astronomy Easy to use with IRAF tasks Basis of STScI application efforts More general array capabilities Faster for large arrays, better support for memory mapping Many books and on-line documentation resources available (for the language and its libraries) Better support for table structures Plotting framework (matplotlib) more extensible and general Better font support and portability (only one way to do it too) Usable within many windowing frameworks (GTK, Tk, WX, Qt…) Standard plotting functionality independent of framework used plots are embeddable within other GUIs more powerful image handling (multiple simultaneous LUTS, optional resampling/rescaling, alpha blending, etc) Support for many widget systems Strong local influence over capabilities being developed for Python Cons of Python More items to install separately Not as well accepted in astronomical community (but support clearly growing) Scientific libraries not as mature: Documentation not as complete, not as unified Not as deep in astronomical libraries and utilities Not all IDL numerical library functions have corresponding functionality in Python Some numeric constructs not quite as consistent with language (or slightly less convenient than IDL) Array indexing convention “backwards” Small array performance slower No standard GUI run/debug tool Support for many widget systems (angst regarding which to choose) Current lack of function equivalent to SAVE/RESTORE in IDL matplotlib does not yet have equivalents for all IDL 2-D plotting capability (e.g., surface plots) Use of keyword arguments used as flags less convenient Plotting: comparatively immature, still much development going on missing some plot type (e.g., surface) 3-d capability requires VTK (though matplotlib has some basic 3-d capability)

    Read the article

  • Antlr Lexer Quoted String Problem

    - by Loki
    I'm trying to build a lexer to tokenize lone words and quoted strings. I got the following: STRING: QUOTE (options {greedy=false;} : . )* QUOTE ; WS : SPACE+ { $channel = HIDDEN; } ; WORD : ~(QUOTE|SPACE)+ ; For the corner cases, it needs to parse: "string" word1" word2 As three tokens: "string" as STRING and word1" and word2 as WORD. Basically, if there is a last quote, it needs to be part of the WORD were it is. If the quote is surrounded by white spaces, it should be a WORD. I tried this rule for WORD, without success: WORD: ~(QUOTE|SPACE)+ | (~(QUOTE|SPACE)* QUOTE ~QUOTE*)=> ~(QUOTE|SPACE)* QUOTE ~(QUOTE|SPACE)* ;

    Read the article

  • Large Scale VHDL modularization techniques

    - by oxinabox.ucc.asn.au
    I'm thinking about implimenting a 16 bit CPU in VHDL. A simplish CPU. ADD, MULS, NEG, BitShift, JUMP, Relitive Jump, BREQ, Relitive BREQ, i don't know somethign along these lines Probably all only working with 16bit operands. I might even cut it down and use only a single operand and a accumulator. With Some status regitsters, Carry, Zero, Neg (unless i use a Accumlator), I know how to design all the parts from logic gates, and plan to build them up from first priciples, So for my ALU I'll need to 'build' a ADDer, proably a Carry Look ahead, group adder, this adder it self is make up oa a couple of parts, wich are themselves made up of a couple of parts. Anyway, my problem is not the CPU design, or the VHDL (i know the language, more or less). It's how i should keep things organised. How should I use packages, How should I name my processes and port maps? (i've never seen the benifit of naming the port maps, or processes)

    Read the article

  • How do I check if a user is authenticated with NickServ using POE::Component::IRC::State in Perl?

    - by Troy
    I'm trying to test whether a user is registered on FreeNode. nick_info() doesn't seem to return information about this, so I want to use $irc-yield(whois = $nick); and then grab the irc_whois event's reply. The problem is that I want to wait until this event is fired, so I created a global variable $whois_result and wrote a sub like this: sub whois { my $nick = $_[0]; $whois_result = 0; $irc->yield(whois => $nick); while($whois_result == 0) { } return $whois_result; } with the irc_whois handler looking like: sub on_whois { $whois_result = $_[ARG0]; print "DEBUG: irc_whois fired.\n"; } Unfortunately, the event can't fire while the loop is running so this hangs. I'm sure there's a better way to do this, but I'm not familiar enough with this kind of programming to know. Any help would be greatly appreciated.

    Read the article

  • Are there any security issues to avoid when providing a email-or-username-can-act-as-username login

    - by Tchalvak
    I am in the process of moving from a "username/password" system to one that uses email for login. I don't think that there's any horrible problem with allowing either email or username for login, and I remember seeing sites that I consider somewhat respectable doing it as well, but I'd like to be aware of any major security flaws that I may be introducing. More specifically, here is the pertinent function (the query_row function parameterizes the sql). function authenticate($p_user, $p_pass) { $user = (string)$p_user; $pass = (string)$p_pass; $returnValue = false; if ($user != '' && $pass != '') { // Allow login via username or email. $sql = "SELECT account_id, account_identity, uname, player_id FROM accounts join account_players on account_id=_account_id join players on player_id = _player_id WHERE lower(account_identity) = lower(:login) OR lower(uname) = lower(:login) AND phash = crypt(:pass, phash)"; $returnValue = query_row($sql, array(':login'=>$user, ':pass'=>$pass)); } return $returnValue; } Notably, I have added the WHERE lower(account_identity) = lower(:login) OR lower(uname) = lower(:login) ...etc section to allow graceful backwards compatibility for users who won't be used to using their email for the login procedure. I'm not completely sure that that OR is safe, though. Are there some ways that I should tighten the security of the php code above?

    Read the article

  • Are you a good or bad programmer?

    - by Eli
    Hi All, I see a lot of questions on SO that are asked about 'good' programmers vs 'bad' programmers. For example, what is a good/bad programmer, how to tell a good/bad programmer, what to do about a bad programmer on a team, how to hire a good programmer. I know it's pretty easy to apply the words to other people, but I find myself wondering if anyone out there would actually define THEMSELVES in a Boolean fashion like this, rather than "good in some areas, weak in others..." I'm not asking as an either/or where you have to be one or the other, but as a 'both' - are you a good or bad programmer? If so (either one), why? Please note this isn't meant to be argumentative, or to define good/bad practices, etc. I just want to know how many people think they are good, bad, or neither out there.

    Read the article

  • wireless problem: Internet slow connection or limited connectivity

    - by jack
    Hi I have no idea on this problem. My wireless connection doesn't work sometimes. I find it's due to my XP and I have no problem with my Win 7 machine. The problem is - Internet Connection a bit slower than usual Limit connectivity issue I use netsh reset for resetting network configurations but it helps sometimes or not help at all. Any ideas? Thank you.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >