Search Results

Search found 1204 results on 49 pages for 'jack smartie'.

Page 26/49 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Are programming languages and methods inefficient? (assembler and C knowledge needed)

    - by b-gen-jack-o-neill
    Hi, for a long time, I am thinking and studying output of C language compiler in assembler form, as well as CPU architecture. I know this may be silly to you, but it seems to me that something is very ineffective. Please, don´t be angry if I am wrong, and there is some reason I do not see for all these principles. I will be very glad if you tell me why is it designed this way. I actually truly believe I am wrong, I know the genius minds of people which get PCs together knew a reason to do so. What exactly, do you ask? I´ll tell you right away, I use C as a example: 1: Stack local scope memory allocation: So, typical local memory allocation uses stack. Just copy esp to ebp and than allocate all the memory via ebp. OK, I would understand this if you explicitly need allocate RAM by default stack values, but if I do understand it correctly, modern OS use paging as a translation layer between application and physical RAM, when address you desire is further translated before reaching actual RAM byte. So why don´t just say 0x00000000 is int a,0x00000004 is int b and so? And access them just by mov 0x00000000,#10? Because you wont actually access memory blocks 0x00000000 and 0x00000004 but those your OS set the paging tables to. Actually, since memory allocation by ebp and esp use indirect addressing, "my" way would be even faster. 2: Variable allocation duplicity: When you run application, Loader load its code into RAM. When you create variable, or string, compiler generates code that pushes these values on the top o stack when created in main. So there is actual instruction for do so, and that actual number in memory. So, there are 2 entries of the same value in RAM. One in form of instruction, second in form of actual bytes in the RAM. But why? Why not to just when declaring variable count at which memory block it would be, than when used, just insert this memory location?

    Read the article

  • Free or open source dictionaries

    - by jack
    I'm working on a multi-lingual search engine. I need to map keywords in English to corresponding words in following languages: Bulgarian Catalan Chinese Crotian Czech Danish Dutch Finish French German Greek Hungarian Italian Japanese Korean Lithuanian Litvian Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Spanish Swedish Thai Ukrainian Vietnamese I already known eudict and stardict. Could you recommend some other free or open source dictionaries cover one or more above languages?

    Read the article

  • Problem with PHP/Java bridge.

    - by Jack
    I am using Tomcat 6. I am running a php script using the JavaBridge. I get the following error when I run my code. Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\xxxx\xxxxx.php on line 534 Please help.

    Read the article

  • Repeatedly querying xml using python

    - by Jack
    I have some xml documents I need to run queries on. I've created some python scripts (using ElementTree) to do this, since I'm vaguely familiar with using it. The way it works is I run the scripts several times with different arguments, depending on what I want to find out. These files can be relatively large (10MB+) and so it takes rather a long time to parse them. On my system, just running: tree = ElementTree.parse(document) takes around 30 seconds, with a subsequent findall query only adding around a second to that. Seeing as the way I'm doing this requires me to repeatedly parse the file, I was wondering if there was some sort of caching mechanism I can use so that the ElementTree.parse computation can be reduced on subsequent queries. I realise the smart thing to do here may be to try and batch as many queries as possible together in the python script, but I was hoping there might be another way. Thanks.

    Read the article

  • Dynamic select menu Rails, Javascript HABTM

    - by Jack
    Hi, I am following a tutorial in one of Ryan Bates' Railscasts here. Basically I want a form where there are 2 drop down menus, the contents of one are dependent on the other. I have Years and Courses, where Years HABMT Courses and Courses HABTM Years. In the tutorial, the javascript is as follows: var states = new Array(); <% for state in @states -%> states.push(new Array(<%= state.country_id %>, '<%=h state.name %>', <%= state.id %>)); <% end -%> function countrySelected() { country_id = $('person_country_id').getValue(); options = $('person_state_id').options; options.length = 1; states.each(function(state) { if (state[0] == country_id) { options[options.length] = new Option(state[1], state[2]); } }); if (options.length == 1) { $('state_field').hide(); } else { $('state_field').show(); } } document.observe('dom:loaded', function() { countrySelected(); $('person_country_id').observe('change', countrySelected); }); Where I guess country has many states and state belongs to country. I think what I need to do is edit the first for statement to somehow loop through all of the courses for each year_id, but don't know how to do this. Any ideas? Thanks

    Read the article

  • Not able to pass multiple override parameters using nose-testconfig 0.6 plugin in nosetests

    - by Jaikit
    Hi, I am able to override multiple config parameters using nose-testconfig plugin only if i pass the overriding parameters on commandline. e.g. nosetests -c nose.cfg -s --tc=jack.env1:asl --tc=server2.env2:abc But when I define the same thing inside nose.cfg, than only the value for last parameter is modified. e.g. tc = server2.env2:abc tc = jack.env1:asl I checked the plugin code. It looks fine to me. I am pasting the part of plugin code below: parser.add_option( "--tc", action="append", dest="overrides", default = [], help="Option:Value specific overrides.") configure: if options.overrides: self.overrides = [] overrides = tolist(options.overrides) for override in overrides: keys, val = override.split(":") if options.exact: config[keys] = val else: ns = ''.join(['["%s"]' % i for i in keys.split(".") ]) # BUG: Breaks if the config value you're overriding is not # defined in the configuration file already. TBD exec('config%s = "%s"' % (ns, val)) Let me know if any one has any clue.

    Read the article

  • Applying attribute to SVG using JS prompts 'this.textBox.style is undefined'. Why?

    - by Jack Roscoe
    Hi, I'm using the following code to draw an SVG text box, and then change its text anchor attribute to 'left' as it defaults to center and that's nasty. The text generates correctly, but when I add this second line I get the error 'this.textBox.style is undefined' in my error console. Here's my code: RenderTextBox:function() { // Render Text this.textBox = paper.text(this.x, this.y, this.htmlText); this.textBox.style.textAnchor="left"; } Any ideas?

    Read the article

  • Webpage layout order for my webapp - does it matter if the Sidebar is programmatically displayed bef

    - by Jack W-H
    OK that's the worst title I could ever possibly think up. But I'm not too sure how to phrase it! What I mean is, is it inefficient for the browser, search engine optimisation, or any other important factors, if programmatically my float:righted sidebar appears in the markup before the main content div, which is set to float:left? To the user, the main content appears on the left, and the sidebar on the right. In the source code it appears like so: <div id="sidebar">This is where my sidebar goes </div> <div id="content">This is where my content goes </div> Will this affect SEO or other factors in my page?

    Read the article

  • Forcing deallocation of large cache object in Java

    - by Jack
    I use a large (millions) entries hashmap to cache values needed by an algorithm, the key is a combination of two objects as a long. Since it grows continuously (because keys in the map changes, so old ones are not needed anymore) it would be nice to be able to force wiping all the data contained in it and start again during the execution, is there a way to do effectively in Java? I mean release the associated memory (about 1-1.5gb of hashmap) and restart from the empty hashmap..

    Read the article

  • How do i simulate IIS6/ASP.net 4 settings on IIS7?

    - by Jack
    I have a Windows2k3/IIS6 server but at home i'm using Windows7/IIS7 pc. I just installed VS2010 and trying out the new Web form. After i setup a application in IIS7, I set the Application Pool to ASP.net v4.0 Classic thinking this is the correct setting to simulate IIS6 but when I browse to the website. I got HTTP Error 404.2 Not found but if i set the application pool settings to ASP.net v4.0 then everything run fine. Does anyone know how to simulate IIS6 with ASP.net 4 on Windows7/IIS7/ASP.net 4?

    Read the article

  • Rewrite a URL that's already been redirected?

    - by Jack
    Hi guys, I'm running an Apache2 web server with a dynamic IP address. I bought exampledomain.net, and I use no-ip.com's domain-update service to redirect any visitors to my current ip address (endnote #1). For example, someone visits exampledomain.net and they get redirected to 73.181.57.34. It works like a charm. However, it isn't all that user-friendly. Can I rewrite the redirected, ip-address URL? I tried these rewrite rules in the root folder's .htaccess... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ http://www.exampledomain.net/$1 [L,NC] # I simplified the RewriteCond. I would use regex in a real situation. Of course, this creates an infinite loop. The user visits www.exampledomain.net. They're redirected to 73.181.57.34:88 by no-ip. Apache redirects them to www.exampledomain.net which redirects them back to 73.181.57.34:88... so on and so forth. I'm a noob when it comes to rewriting, but is there a way to rewrite a URL without redirecting? I tried these rewrite rules too (a shot in the dark)... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ my.exampledomain.net/$1 [L,NC] # I'd read that Apache replied with a redirect header when you include http Thanks! (1) No-IP works like this: You download and install their dynamic update client on your server. Every couple of minutes it polls your server for its current external ip address. If it's changed, it updates your server's ip address in no-ip's records.

    Read the article

  • Best .NET Framework compression class?

    - by Jack
    Hi all Yes, I know GZipStream or DeflateStream is the common ones in .NET Framework which handle compression/decompression. I wish to have compress/decompress functions in my program, but I wish a .NET Framework C# one, not a 3rd party open source. I can't use because of those copyright restrictions in my program. GZipStream and DeflateStream are not so good. for e.g., GZipStream compress a file to 480KB while 7Zip compress the same file to the size of 57KB. Does Microsoft have other good compression methods??? Thanks

    Read the article

  • Fluxbox compiling problems after making a change.

    - by Jack
    I'm trying to make the change here: http://fluxbox-wiki.org/index.php?title=Howto_Make_dblclick_titlebar_maximize I am using the current git version of the fluxbox source. I assume that those instructions are perhaps no longer valid for the current git version. In the void FluxboxWindow::setupWindow() function I can see no references to CommandRef or frame. I would like to know if it is possible that I could work out where they should go in that function, with only having a limited knowledge? I am still trying to learn programming and don't know enough just yet to work out where they should go. I assume I can't just paste in the suggested lines anywhere in that function, but why not? I can paste the source if needed, but I am unsure where to paste to.

    Read the article

  • Force sending a user to custom QuerySet.

    - by Jack M.
    I'm trying to secure an application so that users can only see objects which are assigned to them. I've got a custom QuerySet which works for this, but I'm trying to find a way to force the use of this additional functionality. Here is my Model: class Inquiry(models.Model): ts = models.DateTimeField(auto_now_add=True) assigned_to_user = models.ForeignKey(User, blank=True, null=True, related_name="assigned_inquiries") objects = CustomQuerySetManager() class QuerySet(QuerySet): def for_user(self, user): return self.filter(assigned_to_user=user) (The CustomQuerySetManager is documented over here, if it is important.) I'm trying to force everything to use this filtering, so that other methods will raise an exception. For example: Inquiry.objects.all() ## Should raise an exception. Inquiry.objects.filter(pk=69) ## Should raise an exception. Inquiry.objects.for_user(request.user).filter(pk=69) ## Should work. inqs = Inquiry.objects.for_user(request.user) ## Should work. inqs.filter(pk=69) ## Should work. It seems to me that there should be a way to force the security of these objects by allowing only certain users to access them. I am not concerned with how this might impact the admin interface.

    Read the article

  • Storing a reference to an object in C#

    - by Jack
    I was wondering how one could store a reference to an object in .net. That is, I would like something like the following code (note, of course, that the following code may be way off from how to actually do it): class Test { private /*reference to*/ Object a; public Test(ref int a) { this.a = a; this.a = ((int)this.a) + 1; } public Object getA() { return this.a; } } /* * ... */ static void Main(string[] args) { int a; a=3; Test t = new Test(ref a); Console.WriteLine(a); Console.WriteLine(t.getA()); Console.ReadKey(); } To produce the following output: 4 4 Ideally, I would like to do this without writing a wrapper class around the integer. In other words, I think I want pointers in .Net.

    Read the article

  • How to center list tags inside an unordered list?

    - by Jack
    How can list tags that are given a display:block and are floated left, be centered inside an unordered list. The HTML: <div id="navigation"> <ul> <li>Home</li> <li>About Us</li> <li>Contact</li> <li>News</li> <li>Events</li> <li>Video</li> <li>Photos</li> </ul> </div><!-- navigation --> The CSS: #navigation { border: 3px solid orange; overflow: hidden; } #navigation ul { list-style-type: none; text-align: center; } #navigation ul li { float: left; display: block; padding: 10px 8px; border: 1px solid green; }

    Read the article

  • c++ defining a static member of a template class with type inner class pointer

    - by Jack
    I have a template class like here (in a header) with a inner class and a static member of type pointer to inner class template <class t> class outer { class inner { int a; }; static inner *m; }; template <class t> outer <t>::inner *outer <t>::m; when i want to define that static member i says "error: expected constructor, destructor, or type conversion before '*' token" on the last line (mingw32-g++ 3.4.5)

    Read the article

  • Is block style really this important?

    - by Jack Roscoe
    I just watched a video of Douglas Crockford's presentation about his 2009 book JavaScript: The Good Parts. In the video, he explains that the following block is dangerous because it produces silent errors: return { ok: false }; And that it should actually be written like this (emphasising that although seemingly identical the behavioural difference is crucial): return { ok: false }; You can see his comments around 32 minutes into the video here: http://www.youtube.com/watch?v=hQVTIJBZook&feature=player_embedded#!&start=1920 I have not heard this before, and was wondering if this rule still applies or if this requirement in syntax has been overcome by JavaScript developments since this statement was made. I found this very interesting as I have NOT been writing my code this way, and wanted to check that this information was not out of date.

    Read the article

  • cakephp why can't I have an admin route and a superuser route?

    - by Jack B Nimble
    In core.php I can define Configure::write('Routing.admin', 'admin'); and /admin/controller/index will work. but if I define both Configure::write('Routing.admin', 'admin'); Configure::write('Routing.superuser', 'superuser'); and try to look at /superuser/blah/index/ instead of it saying the controller doesn't exist it says Error: SuperuserController could not be found. instead of saying Error: BlahController could not be found. When I first read the documentation I was under the impression I could run both routes, and not just one or the other. Is there something more I need to do?

    Read the article

  • MySQL won't use index for query?

    - by Jack Sleight
    I have this table: CREATE TABLE `point` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `siteid` INT(11) NOT NULL, `lft` INT(11) DEFAULT NULL, `rgt` INT(11) DEFAULT NULL, `level` SMALLINT(6) DEFAULT NULL, PRIMARY KEY (`id`), KEY `point_siteid_site_id` (`siteid`), CONSTRAINT `point_siteid_site_id` FOREIGN KEY (`siteid`) REFERENCES `site` (`id`) ON DELETE CASCADE ) ENGINE=INNODB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci And this query: SELECT * FROM `point` WHERE siteid = 1; Which results in this EXPLAIN information: +----+-------------+-------+------+----------------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+----------------------+------+---------+------+------+-------------+ | 1 | SIMPLE | point | ALL | point_siteid_site_id | NULL | NULL | NULL | 6 | Using where | +----+-------------+-------+------+----------------------+------+---------+------+------+-------------+ Question is, why isn't the query using the point_siteid_site_id index?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >