Search Results

Search found 2495 results on 100 pages for 'tom rom'.

Page 50/100 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • JavaScript: Double script tags in Google Analytics tracking code

    - by Tom
    This is more a curiosity question than anything else... Google instructs to add the analytics tracking code as follows: <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {} </script> I'm wondering some JS guru here could tell me why they're separating it into two script tags instead of sticking it all inside one. I know that the top part could be put in the header and the bottom part just before body tag to ensure the page loaded before it's tracked, but I'm wondering if there's something more to it. Anyone who'd know that would likely know how to separate the code into two tags anyway. I'm only asking as this is coming from the Goog and is being used by millions of sites... Thanks

    Read the article

  • jQuery Prepend an Image

    - by Tom
    Hi Guys, I am trying to add a prepend of an image and then define it's attributes. Little confused as how to do this - currently I have the following but it's not working. The HTML is <div id="testID" class="test1"> <div id="testID2" class="test2" ></div> </div> And the JS is jQuery("#testID2").prepend('<img />').attr({ src: 'some src.gif', alt: '', height: '60' }); I am hoping to achieve <div id="testID" class="test1"> <div id="testID2" class="test2" > <img src='some src.gif' alt='' height='60' /> </div> </div> Any Ideas?

    Read the article

  • ORA- 01157 / Cant connect to database

    - by Tom
    Hi everyone, this is a follow up from this question. Let me start by saying that i am NOT a DBA, so i'm really really lost with this. A few weeks ago, we lost contact with one of our SID'S. All the other services are working, but this one in particular is not. What we got was this message when trying to connect ORA-01033: ORACLE initialization or shutdown in progress An attempt to alter database open ended up in ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: '/u01/app/oracle/oradata/xxx/xxx_data.dbf' I tried to shutdown / restart the database, but got this message. Total System Global Area 566231040 bytes Fixed Size 1220604 bytes Variable Size 117440516 bytes Database Buffers 444596224 bytes Redo Buffers 2973696 bytes Database mounted. ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: '/u01/app/oracle/oradata/xxx/xxx_data.dbf' When all continued the same, I erased the dbf files (rm xxx_data.dbf xxx_index.dbf), and recreated them using touch xxx_data.dbf. I also tried to recreate the tablespaces using `CREATE TABLESPACE DATA DATAFILE XXX_DATA.DBF` and got Database not open As I said, i don't know how bad this is, or how far i'm from gaining access to my database (well, to this SID at least, the others are working). I would imagine that a last resource would be to throw everything away, and recreating it, but I don't know how to, and I was hoping there's a less destructive solution. Any help will be greatly appreciated . Thanks in advance.

    Read the article

  • Best approach to create a security environment in Java

    - by Tom Brito
    I need to create a desktop application that will run third party code, and I need to avoid the third party code from export by any way (web, clipboard, file io) informations from the application. Somethig like: public class MyClass { private String protectedData; public void doThirdPartyTask() { String unprotedtedData = unprotect(protectedData); ThirdPartyClass.doTask(unprotectedData); } private String unprotect(String data) { // ... } } class ThirdPartyClass { public static void doTask(String unprotectedData) { // Do task using unprotected data. // Malicious code may try to externalize the data. } } I'm reading about SecurityManager and AccessControler, but I'm still not sure what's the best approach to handle this. What should I read about to do this implementation?

    Read the article

  • how to change string values in dictionary to int values

    - by tom smith
    I have a dictionary such as: {'Sun': {'Satellites': 'Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune,Ceres,Pluto,Haumea,Makemake,Eris', 'Orbital Radius': '0', 'Object': 'Sun', 'RootObject': 'Sun', 'Radius': '20890260'}, 'Earth': {'Period': '365.256363004', 'Satellites': 'Moon', 'Orbital Radius': '77098290', 'Radius': '63710.41000.0', 'Object': 'Earth'}, 'Moon': {'Period': '27.321582', 'Orbital Radius': '18128500', 'Radius': '1737000.10', 'Object': 'Moon'}} I am wondering how to change just the number values to ints instead of strings. def read_next_object(file): obj = {} for line in file: if not line.strip(): continue line = line.strip() key, val = line.split(": ") if key in obj and key == "Object": yield obj obj = {} obj[key] = val yield obj planets = {} with open( "smallsolar.txt", 'r') as f: for obj in read_next_object(f): planets[obj["Object"]] = obj print(planets)

    Read the article

  • Converted some PHP functions to c# but getting different results

    - by Tom Beech
    With a bit of help from people on here, i've converted the following PHP functions to C# - But I get very different results between the two and can't work out where i've gone wrong: PHP: function randomKey($amount) { $keyset = "abcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $randkey = ""; for ($i=0; $i<$amount; $i++) $randkey .= substr($keyset, rand(0, strlen($keyset)-1), 1); return $randkey; } public static function hashPassword($password) { $salt = self::randomKey(self::SALTLEN); $site = new Sites(); $s = $site->get(); return self::hashSHA1($s->siteseed.$password.$salt.$s->siteseed).$salt; } c# public static string randomKey(int amount) { string keyset = "abcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; string randkey = string.Empty; Random random = new Random(); for (int i = 0; i < amount; i++) { randkey += keyset.Substring(0, random.Next(2, keyset.Length - 2)); } return randkey; } static string hashPassword(string password) { string salt = randomKey(4); string siteSeed = "6facef08253c4e3a709e17d9ff4ba197"; return CalculateSHA1(siteSeed + password + salt + siteSeed) + siteSeed; } static string CalculateSHA1(string ipString) { SHA1 sha1 = new SHA1CryptoServiceProvider(); byte[] ipBytes = Encoding.Default.GetBytes(ipString.ToCharArray()); byte[] opBytes = sha1.ComputeHash(ipBytes); StringBuilder stringBuilder = new StringBuilder(40); for (int i = 0; i < opBytes.Length; i++) { stringBuilder.Append(opBytes[i].ToString("x2")); } return stringBuilder.ToString(); } EDIT The string 'password' in the PHP function comes out as "d899d91adf31e0b37e7b99c5d2316ed3f6a999443OZl" in the c# it comes out as: "905d25819d950cf73f629fc346c485c819a3094a6facef08253c4e3a709e17d9ff4ba197"

    Read the article

  • Merging a custom ContextMenuStrip with the system edit context menu in a DataGridView

    - by Tom
    I have a DataGridView in a VB.NET app that I have limited to cell selection only. The control has two columns, the first is not editable, the second is editable. I have a ContextMenuStrip that provides some additional functionality and I am able to make it appear when an editable cell receives a right click and is not in edit mode. Based on an example in a Microsoft forum, I am able to now show the context menu when an editable cell receives a right click while also in edit mode. That code is as follows: Private Sub DataGridView1_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing If TypeOf e.Control Is TextBox Then With DirectCast(e.Control, TextBox) .ContextMenuStrip = ContextMenuStrip1 End With End If End Sub This, however, completely overwrites the system context menu of the editing control. How can I merge my Context Menu Strip (ContextMenuStrip1) with the system context menu? For further information, I am using VS2008, but targeting the .NET 2.0 platform.

    Read the article

  • Websphere Java application startup

    - by Tom Barnett
    I have two Java applications running on a Websphere application server. The first application is COTS software (Plateau) I will call App1 and includes an API which can be used in custom applications to interact with App1. This app takes a couple minutes to start in Websphere. The second application is custom software I will call App2 and is deployed as a web service which utilizes the App1 API to interact with App1; so it is dependent on App1. This app takes just seconds to start in Websphere. I run into a problem in certain App1 functionality when we bounce Websphere and the App2 web service is called by a client before the App1 application has fully started. Is there a way I can delay App2 from starting until App1 is fully started in Websphere? Is there a way to design App2 to programmatically check that App1 is available before it attempts to use the API?

    Read the article

  • Permission Denied IE iFrame

    - by Tom
    Hi Guys, I have a site on A.com and an iframe on B.com which calls javascript from A.com. This works great in FF. In IE7 / 8 I am getting a Message: Access is denied. message. I have checked the HTTP Traffic via Fiddler - and I can see that it isn't blocked in Fiddler ? Any ideas what could be causing this and how to solve ?

    Read the article

  • Python raw strings and trailing back slashes.

    - by dash-tom-bang
    I ran across something once upon a time and wondered if it was a Python "bug" or at least a misfeature. I'm curious if anyone knows of any justifications for this behavior. I thought of it just now reading "Code Like a Pythonista," which has been enjoyable so far. I'm only familiar with the 2.x line of Python. Raw strings are strings that are prefixed with an r. This is great because I can use backslashes in regular expressions and I don't need to double everything everywhere. It's also handy for writing throwaway scripts on Windows, so I can use backslashes there also. (I know I can also use forward slashes, but throwaway scripts often contain content cut&pasted from elsewhere in Windows.) So great! Unless, of course, you really want your string to end with a backslash. There's no way to do that in a 'raw' string. In [9]: r'\n' Out[9]: '\\n' In [10]: r'abc\n' Out[10]: 'abc\\n' In [11]: r'abc\' ------------------------------------------------ File "<ipython console>", line 1 r'abc\' ^ SyntaxError: EOL while scanning string literal In [12]: r'abc\\' Out[12]: 'abc\\\\' So one slash before the closing quote is an error, but two slashes gives you two slashes! Certainly I'm not the only one that is bothered by this? Thoughts on why 'raw' strings are 'raw, except for slash-quote'? I mean, if I wanted to embed a single quote in there I'd just use double quotes around the string, and vice versa. If I wanted both, I'd just triple quote. If I really wanted three quotes in a row in a raw string, well, I guess I'd have to deal, but is this considered "proper behavior"?

    Read the article

  • How do you tell if two wildcards overlap?

    - by Tom Ritter
    Given two strings with * wildcards, I would like to know if a string could be created that would match both. For example, these two are a simple case of overlap: Hello*World Hel* But so are all of these: *.csv reports*.csv reportsdump.csv Is there an algorithm published for doing this? Or perhaps a utility function in Windows or a library I might be able to call or copy?

    Read the article

  • Java EE Website Planning Questions

    - by Tom Tresansky
    I'm a .NET programming who is soon moving to the Java EE world. I have plenty of experience with .NET web technologies, web services, WebForms and MVC. I am also very familiar with the Java language, and have written a few servlets and modified a couple of JSP pages, but I haven't touched EE yet. I'd like to set up a public website using Java EE so I can familiarize myself with whats current. I'm thinking just a technology playground at this point with no particular purpose in mind. What Java technologies are the current hotness for this sort of thing? (For example, if someone asked me what I'd recommend learning to set up a new .NET site, I'd say use ASP MVC instead of WebForms and recommend LINQ-to-SQL as a quick, simple and widely used ORM.) So, what I'd like to know is: Is there a recommended technology for the presentation layer? Is JSP considered a good approach, or is there anything cleaner/newer/more widespread? Is Hibernate still widely used for persistence? Is it obsolete? Is there anything better out there? (I've worked with NHibernate some, so I wouldn't be starting from scratch.) Is cheap Java EE web hosting available? What should I know being a .NET web developer moving to the Java world?

    Read the article

  • Returning Database Blobs in TurboGears 2.x / FCGI / Lighttpd extremely slow

    - by Tom
    Hey everyone, I am running a TG2 App on lighttpd via flup/fastcgi. We are reading images (~30kb each) from BlobFields in a MySQL database and return those images with a custom mime type via a controller method. Caching these images on the hard disk makes no sense because they change with every request, the only reason we cache these in the DB is that creating these images is quite expensive and the data used to create the images is also present in plain text on the website. Now to the problem itself: When returning such an image, things get extremely slow. The code runs totally fine on paster itself with no visible delay, but as soon as its running via fcgi/lighttpd the described phenomenon happens. I profiled the method of my controller that returns my blob, and the entire method runs in a few miliseconds, but when "return" executes, the entire app hangs for roughly 10 seconds. We could not reproduce the same error with PHP on FCGI. This only seems to happen with Turbogears or Pylons. Here for your consideration the concerned piece of source code: @expose(content_type=CUSTOM_CONTENT_TYPE) def return_img(self, img_id): """ Return a DB persisted image when requested """ img = model.Images.by_id(img_id) #get image from DB response.headers['content-type'] = 'image/png' return img.data # this causes the app to hang for 10 seconds

    Read the article

  • UIButton only responds in a small area

    - by Tom Irving
    I'm trying to add a UIButton to a UIView, but am having some trouble with getting it to respond to touches. I have a method which returns UIButtons after I provide it with a tag: - (UIButton*)niceSizeButtonWithTag:(int)tag { UIButton * aButton = [UIButton buttonWithType:UIButtonTypeCustom]; [aButton setTag:tag]; [aButton addTarget:self action:@selector(buttonWasTapped:) forControlEvents:UIControlEventTouchUpInside]; CGRect newFrame = aButton.frame; newFrame.size.width = 44; newFrame.size.height = 44; [aButton setFrame:newFrame]; return aButton; } As you can see I'm creating a new button and increasing the size. I use this in the following way: UIButton * anotherButton = [self niceSizeButtonWithTag:1]; [anotherButton setImage:[UIImage imageNamed:@"image" withExtension:@"png"] forState:UIControlStateNormal]; [anotherButton setCenter:CGPointMake(middleOfView)]; [aView addSubview:anotherButton]; I create a lot of buttons like this, hence the reason for the method. The buttons are always created and added to the subview perfectly. I can see the image and they're in the correct position. The problem is that they only respond to touches in a tiny strip. In this attached image, The yellow shows the whole frame of the button, The red shows the area that will respond to touches. The grey shows a section of the view the button is added to. If anyone could shed some light on why this is happening, it would be really useful.

    Read the article

  • virtualenv on Windows: not over-riding installed package

    - by Tom
    My current setup is Python 2.5/ Django 1.1.1 on Windows. I want to start using Django 1.2 on some projects, but can't use it for everything. Which is just the sort of thing I've got virtualenv for. However, I'm running into a problem I've never encountered and it's hard to Google for: installing Django 1.2 into a virtualenv has no effect for me. If I then activate the environment and do python import django django.VERSION I get "1.1.1 Final". Django is installed in the site-packages directory of my environment and the init file in the root shows that it is 1.2. But the environment falls back to 1.1.1, even if I create the environment with the --no-site-packages flag. What am I screwing up?

    Read the article

  • Symfony 1.4: Is it possible to prevent escaping of a redirect URL?

    - by Tom
    Hi, If I do a redirect in action as normal: $this->redirect('@mypage?apple=1&banana=2&orange=3'); ... Symfony produces the correct URL: /something/something?apple=1&banana=2&orange=3 However, the following gets escaped for some bizarre reason: $string = 'apple=1&banana=2&orange=3'; $this->redirect('@mypage?'.$string); ... and the following URL is produced: /something/something?apple=1&amp;banana=2&amp;orange=3 Is there a way to avoid this escaping and have the ampersands appear correctly in the URL? I've tried everything I can think of and it's driving me mad. I need this for a situation where I'm pulling a saved query as a string from the database and would just like to latch it onto the URL. I'm aware that I could generate an array from the string and then generate a brand new URL from the array, but it just seems like a lot of overhead because of this silly escaping. Thanks.

    Read the article

  • Service Application too visible

    - by Tom
    Working on a service application in Delphi 5 that is intended to run on Windows XP - 7. Most of the application is coming together nicely, but I'm running into one issue. Part of this service application is a form that displays data occasionally (similar to the slider box Avast uses to let you know its updated). When the service shows the form, the form displays on the taskbar, but we don't want it to. Does anyone have any suggestions as to how to hide the form's button on the taksbar? None of the standard methods I've found for regular applications have worked so far. Thanks.

    Read the article

  • Problem while looping on a NSDictionary

    - by Tom
    Hi! The end of my loop causes a EXC_BAD_ACCESS. Here's my dictionary (AppDelegate.data): 1 = ( 3, "Test 1", False, "" ); 2 = ( 4, "Test 2", False, "" ); And here is my loop: for (id theKey in AppDelegate.data) { if (theKey = nil) { NSLog(@"HOLY COW"); } else { NSLog(@"Key: %@ ?", theKey); } } It never says holy cow, and it says the right key but at the end it crashes... Do you have any idea why? It should only loop on 1 and two and then exit the loop... I know that there's always a "nil" object at the end that's why I did a condition with it but it doesn't look like it works at all.. Thanks!

    Read the article

  • Double script tags in Google Analytics tracking code

    - by Tom
    This is more a curiosity question than anything else... Google instructs to add the analytics tracking code as follows: <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {} </script> I'm wondering some JS guru here could tell me why they're separating it into two script tags instead of sticking it all inside one. I know that the top part could be put in the header and the bottom part just before body tag to ensure the page loaded before it's tracked, but I'm wondering if there's something more to it. Anyone who'd know that would likely know how to separate the code into two tags anyway. I'm only asking as this is coming from the Goog and is being used by millions of sites... Thanks

    Read the article

  • Using FFmpeg or wrapper to get mp3 from mp4 in C#

    - by Tom Allen
    I'm trying to extract an mp3 from a flash compatible mp4 file and have so far found FFMpeg and a bunch of different wrappers that all claim to be able to do the job. Ideally, I'd like to not have to rely on shelling to the FFMpeg exe, but none of the wrappers I've tried seem to work.... Has anyone got any code or advice for how to go about this? Thanks!

    Read the article

  • Detecting an online poker cheat

    - by Tom Gullen
    It recently emerged on a large poker site that some players were possibly able to see all opponents cards as they played through exploiting a security vulnerability that was discovered. A naïve cheater would win at an incredibly fast rate, and these cheats are caught very quickly usually, and if not caught quickly they are easy to detect through a quick scan through their hand histories. The more difficult problem occurs when the cheater exhibits intelligence, bluffing in spots they are bound to be called in, calling river bets with the worst hands, the basic premise is that they lose pots on purpose to disguise their ability to see other players cards, and they win at a reasonably realistic rate. Given: A data set of millions of verified and complete information hand histories Theoretical unlimited computer power Assume the game No Limit Hold'em, although suggestions on Omaha or limit poker may be beneficial How could we reasonably accurately classify these cheaters? The original 2+2 thread appeals for ideas, and I thought that the SO community might have some useful suggestions. It's an interesting problem also because it is current, and has real application in bettering the world if someone finds a creative solution, as there is a good chance genuine players will have funds refunded to them when identified cheaters are discovered.

    Read the article

  • Specifying schema for temporary tables

    - by Tom Hunter
    I'm used to seeing temporary tables created with just the hash/number symbol, like this: CREATE TABLE #Test ( [Id] INT ) However, I've recently come across stored procedure code that specifies the schema name when creating temporary tables, for example: CREATE TABLE [dbo].[#Test] ( [Id] INT ) Is there any reason why you would want to do this? If you're only specifying the user's default schema, does it make any difference? Does this refer to the [dbo] schema in the local database or the tempdb database?

    Read the article

  • Converting the value from string to integer in a nested dictionary

    - by tom smith
    I want to change the numbers in my dictionary to int values for use later in my program. So far I have import time import math x = 400 y = 300 def read_next_object(file): obj = {} for line in file: if not line.strip(): continue line = line.strip() key, val = line.split(": ") if key in obj and key == "Object": yield obj obj = {} obj[key] = val yield obj planets = {} with open( "smallsolar.txt", 'r') as f: for obj in read_next_object(f): planets[obj["Object"]] = obj print(planets) scale=250/int(max([planets[x]["Orbital Radius"] for x in planets if "Orbital Radius" in planets[x]])) print(scale) and the output is {'Sun': {'Object': 'Sun', 'Satellites': 'Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune,Ceres,Pluto,Haumea,Makemake,Eris', 'Orbital Radius': '0', 'RootObject': 'Sun', 'Radius': '20890260'}, 'Moon': {'Object': 'Moon', 'Orbital Radius': '18128500', 'Period': '27.321582', 'Radius': '1737000.10'}, 'Earth': {'Object': 'Earth', 'Satellites': 'Moon', 'Orbital Radius': '77098290', 'Period': '365.256363004', 'Radius': '6371000.0'}} 3.2426140709476178e-06 I want to be able to convert the numbers in the dict to ints for further use. Any help in greatly appreciated.

    Read the article

  • Best computer-science universities in Europe?

    - by Tom
    I am in 11th grade and only one year left when I finish my school. I am sure I want to dedicate my life to programming. In my country the education's level is not so high as in Europe, so I want to emigrate and study not just for a diploma, but for knowledge too. So, what universities would you suggest me which has subject Computer-Science? I prefer web programming. Please do not delete this message though it is quite offtopic, but it's the best place for me to get suggestions from advanced programmers who have already finished their university. And I hope here comes also teenagers who can make the best decision choosing university. Thank you. Please read the whole my message before voting to close this thread, thanks.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >