Daily Archives

Articles indexed Saturday November 19 2011

Page 4/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Sluggish/unresponsive trackpad on pre-unibody MacBook Pro

    - by Art
    I am running Ubuntu Natty Narwhal on pre-unibody MacBook Pro (2007 I believe). There seems to be a problem with trackpad - it barely works, in order to move cursor you have to move your finger a lot, and it terminates the 'gestures' abruptly - say you are moving the cursor with your finger and out of the blue it just stops, although the finger is still in contact with the surface of the trackpad. Those issues seem to dissapear as soon as I boot Mac OS X, so I suspect it is something Ubuntu-specific. Also, if I try to move the cursor with not just fingertip but increase the contact area, it seems to work just fine, although it is hardly convenient.

    Read the article

  • Could not apply stored configuration for monitors

    - by Hernantz
    Well this happened when I upgraded to Natty. Not only seems I can't change my resolution to higher than 1024x768 but it appears at the left and using only 70% of the monitor's width. I tried logging in but in ubuntu classic mode, and i was able to change it, but that trick did not work anymore. (May this be a compiz problem?) Anyways, here is my /var/log/Xorg.0.log http://pastebin.com/Ew4wwLab and lspci -nn | grep VGA: 00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [8086:27a2] (rev 03) I tried using xrandr for adding manually a resolution of 1280x1768 but without luck. Here is the xrandr output Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096 LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1024x768 60.0*+ 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) TV1 disconnected (normal left inverted right x axis y axis) 1280x1024 (0xc6) 109.0MHz h: width 1280 start 1368 end 1496 total 1712 skew 0 clock 63.7KHz v: height 1024 start 1027 end 1034 total 1063 clock 59.9Hz

    Read the article

  • How to enable 3D acceleration under VMware workstation 8, Ubuntu 11.10 host, Ubuntu 11.10 guest

    - by Yan Zhou
    I saw there are similar questions, but I don't think they answer exactly my questions. Did anyone managed to get 3D acceleration work under VMWare workstation 8? I have VMware 8.01 installed on Ubuntu 11.10. The guest I am trying is also Ubuntu 11.10. I manually installed vmware-tools and it went well, except the X-config part was skipped as it said the distribution driver is used. The guest runs well but it seems fall back to 2D mode. Does any one has any idea how to enable 3D acceleration under VMWare workstaion with Linux guest?

    Read the article

  • Cannot access Compiz Config

    - by Xor power
    I was going through one article here and the topic was "Changing the Size and Appearance of the Unity Launcher" which required to open up CompizConfig from System Settings -- Desktop. I could find System Settings and could reach to control panel but cannot locate either Desktop or CompizConfig. When i go to Software center and search for compizconfig, it says that it is already installed.But when i search it from the list of installed applications, i couldn't find it.??

    Read the article

  • Switching hosting from Google Apps to GoDaddy

    - by Sahir M.
    I am in a pickle here. I just bought a hosting service from GoDaddy and I already have a domain registered with Google Apps. So I went into the domain control center from Google Apps and I changed the nameservers to point to GoDaddy's and then I deleted all the A records and also removed the www and main CNAME. Then I created an A record with host "@" which points to the IP address I got from GoDaddy (this is the server address I see under the category Server in the GoDaddy Hosting Control Center). Also, I see that in this domain center, the domain forwarding is set to forward to my address "www.domainsite.com". So right now when I go to my website I see the error "This website is temporarily unavailable, please try again later." Does anyone know how to set this up properly or know what problem I could be having? Thanks!

    Read the article

  • Directory access control with Apache: do I need to use a specific .htaccess?

    - by Mirror51
    I have an Apache webserver, and in the Apache configuration, I have Alias /backups "/backups" <Directory "/backups"> AllowOverride None Options Indexes Order allow,deny Allow from all </Directory> I can access files via http://127.0.0.1/backups. The problem is everyone can access that. I have a web interface, e.g. http://localhost/adminm that is protected with htaccess and password. Now I don't want separate .htaccess and .htpasswd for /backups, and I don't want a second password prompt when a user clicks on /backups in the web interface. Is there any way to use same .htaccess and .htpasswd for the backups directory?

    Read the article

  • Broken Links in different browsers

    - by kdorival
    Hi I'm having problems with our website, http://www.accessiblehomehealthcare.com, which is a wordpress 2.7 (version). All of a sudden our RSS links broke on the right side, which has happened before and I fixed it within 5 mins. Now, when I fix it, it doesn't look right in different version of I.E. or Firefox, I have I.E. 8 and Firefox 3.6.15 and it looks good for the most part, but there are a few parts where the links are broken. One browser the links would look ok but go to another page and the links or logos would be broken. Certain parts of the website should be static(identical) to the other pages of the site, but if a link is broken on one page, its perfect on another page. I was wondering was there a secret code for wordpress to keep the sites compatible with all browser versions or is there a bigger issue???? Any help or suggestions will help???

    Read the article

  • Move site to new domain divided by language across subdomains

    - by mark
    I managed to find a nice domain for a fairly fledgling site of mine that actually hasn't been parked by scumbag squatters. Given the upcoming move I'm thinking I'd take the opportunity to split the content across subdomains according to language, much like wikipedia for example: current: www.old-domain.com/en/subject # English www.old-domain.com/subjecto # Spanish (default so not locale in url) proposed en.new-domain.com/subject es.new-domain.com/subjecto The advantage of doing this is a fairly competitive keyword such that I may wish to put a copy of my application on a Spanish slice in order to gain a few serp's. Also pure vanity. Google's webmaster tools allows me to move to the new domain and I can add the root domain and the subdomains but forward to only one. I'll 301 from the old domain appropriately but is there anything I should know about webmaster tools in this respect where effectively I'm moving to two addresses? (Feel free to dissuade me from doing this if it's a bad idea in comments.) I've now asked this same question on google's forums.

    Read the article

  • Which browsers handle `Content-Encoding: gzip` and which of them has any special requirements on encodinq quality?

    - by user1049847
    I am creating a "hand made" HTTP 1/0, 1/1 server. I recently integrated zip lib so now I can stream encoded gziped data in and out. I wonder Which major browsers (alive ones - IE6-IE10, Chrome, FF, etc) send Accept-Encoding: deflate, gzip, ... and so can handle Content-Encoding: gzip today? Which of them send any quality expectations? Which of them can send encoded gziped post request and multypart/form data to my server?

    Read the article

  • What does Enable/Disable mean in Bing's URL Normalization feature?

    - by DisgruntledGoat
    I'm in Bing Webmaster Tools, under Index URL Normalization. Many parameters are listed in the table with 3 other columns: Status, Source, Date. The "Source" column says "Webmaster" where I have added parameters, and "Bing" where I assume the parameter has been auto-detected. "Date" is probably the last date it detected the parameter. I've tried searching the help files but I can't find what the Status column means. The top of the page says: This feature allows you to specify query parameters for Bing’s crawler to ignore. But it's not clear whether "Enable" or "Disable" is related to this, and if so what happens in each case. Does anyone know?

    Read the article

  • Some Adsense domain's ads are causing document.write() statements that remove the html from the page

    - by er1234
    All that is output on the page is the domain name of the advertiser, for example 'www.solar-aid.org'. The rest of the content is stripped, I believe because of a document.write() statement. I'd like to know if this is a common issue or something wrong with our setup. There are three domains causing the issue, which we've blocked from Adsense as a result. solar-aid.org kiva.org grameenfoundation.org Given the type of organizations I think they may be within the default group of 'public service ads' within the Backup Ads setting. If the issue doesn't completely resolve itself soon (one customer of ours complained today, even though I blocked them 5+ days ago), I'll disable public service ads and select the 'fill space with a solid color' option.

    Read the article

  • apache2 and htaccess help

    - by user1052448
    For some reason domain.com/YYYY-MM-DD redirects to domain.com/var/htdocs/public_html RewriteEngine On RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$ RewriteRule ^/(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule ^archive/index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^. /archive/index.php [L] trying to get anything after www.domain.com other than index.php and archive/index.php to display mysql content on archive/index.php (by grabbing PHP Request URI). The browser URL should remain www.domain.com/YYYY/MM/DD/blog-title or www.domain.com/YYYY/MM/ to display all posts from YYYY-MM

    Read the article

  • X Error of failed request: BadMatch [migrated]

    - by Andrew Grabko
    I'm trying to execute some "hello world" opengl code: #include <GL/freeglut.h> void displayCall() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); ... Some more code here glutSwapBuffers(); } int main(int argc, char *argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize(500, 500); glutInitWindowPosition(300, 200); glutInitContextVersion(4, 2); glutInitContextFlags(GLUT_FORWARD_COMPATIBLE); glutCreateWindow("Hello World!"); glutDisplayFunc(displayCall); glutMainLoop(); return 0; } As a result I get: X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 128 (GLX) Minor opcode of failed request: 34 () Serial number of failed request: 39 Current serial number in output stream: 40 Here is the stack trace: fghCreateNewContext() at freeglut_window.c:737 0x7ffff7bbaa81 fgOpenWindow() at freeglut_window.c:878 0x7ffff7bbb2fb fgCreateWindow() at freeglut_structure.c:106 0x7ffff7bb9d86 glutCreateWindow() at freeglut_window.c:1,183 0x7ffff7bbb4f2 main() at AlphaTest.cpp:51 0x4007df Here is the last piece of code, after witch the program crashes: createContextAttribs = (CreateContextAttribsProc) fghGetProcAddress("glXCreateContextAttribsARB" ); if ( createContextAttribs == NULL ) { fgError( "glXCreateContextAttribsARB not found" ); } context = createContextAttribs( dpy, config, share_list, direct, attributes ); "glXCreateContextAttribsARB" address is obtained successfully, but the program crashes on its invocation. If I specify OpenGL version less than 4.2 in "glutInitContextVersion()" program runs without errors. Here is my glxinfo's OpelGL version: OpenGL version string: 4.2.0 NVIDIA 285.05.09 I would be very appreciate any further ideas.

    Read the article

  • How to resolve concurrent ramp collisions in 2d platformer?

    - by Shaun Inman
    A bit about the physics engine: Bodies are all rectangles. Bodies are sorted at the beginning of every update loop based on the body-in-motion's horizontal and vertical velocity (to avoid sticky walls/floors). Solid bodies are resolved by testing the body-in-motion's new X with the old Y and adjusting if necessary before testing the new X with the new Y, again adjusting if necessary. Works great. Ramps (rectangles with a flag set indicating bottom-left, bottom-right, etc) are resolved by calculating the ratio of penetration along the x-axis and setting a new Y accordingly (with some checks to make sure the body-in-motion isn't attacking from the tall or flat side, in which case the ramp is treated as a normal rectangle). This also works great. Side-by-side ramps, eg. \/ and /\, work fine but things get jittery and unpredictable when a top-down ramp is directly above a bottom-up ramp, eg. < or > or when a bottom-up ramp runs right up to the ceiling/top-down ramp runs right down to the floor. I've been able to lock it down somewhat by detecting whether the body-in-motion hadFloor when also colliding with a top-down ramp or hadCeiling when also colliding with a bottom-up ramp then resolving by calculating the ratio of penetration along the y-axis and setting the new X accordingly (the opposite of the normal behavior). But as soon as the body-in-motion jumps the hasFloor flag becomes false, the first ramp resolution pushes the body into collision with the second ramp and collision resolution becomes jittery again for a few frames. I'm sure I'm making this more complicated than it needs to be. Can anyone recommend a good resource that outlines the best way to address this problem? (Please don't recommend I use something like Box2d or Chipmunk. Also, "redesign your levels" isn't an answer; the body-in-motion may at times be riding another body-in-motion, eg. a platform, that pushes it into a ramp so I'd like to be able to resolve this properly.) Thanks!

    Read the article

  • (Abstract) Game engine design

    - by lukeluke
    I am writing a simple 2D game (for mobile platforms) for the first time. From an abstract point of view, i have the main player controlled by the human, the enemies, elments that will interact with the main player, other living elements that will be controlled by a simple AI (both enemies and non-enemies). The human player will be totally controlled by the player, the other actors will be controlled by AI. So i have a class CActor and a class CActorLogic to start with. I would define a CActor subclass CHero (the main player controlled with some input device). This class will probably implement some type of listener, in order to capture input events. The other players controlled by the AI will be probably a specific subclass of CActor (a subclass per-type, obviously). This seems to be reasonable. The CActor class should have a reference to a method of CActorLogic, that we will call something like CActorLogic::Advance() or similar. Actors should have a visual representation. I would introduce a CActorRepresentation class, with a method like Render() that will draw the actor (that is, the right frame of the right animation). Where to change the animation? Well, the actor logic method Advance() should take care of checking collisions and other things. I would like to discuss the design of a game engine (actors, entities, objects, messages, input handling, visualization of object states (that is, rendering, sound output and so on)) but not from a low level point of view, but from an high level point of view, like i have described above. My question is: is there any book/on line resource that will help me organize things (using an object oriented approach)? Thanks

    Read the article

  • Parsing json in ios

    - by gaps
    i have the follwing json string ,can anybody tell me how to get the value of role_name {"response":"success","user":{"created_at":"2011-11-16T05:48:31Z","ud_id":"1234567890","last_sign_in_ip":"182.72.141.194","updated_at":"2011-11-19T08:58:27Z","account_id":21,"last_name":"dfg","role_name":"Parent","email":"[email protected]","first_name":"abc"},"status":"200"} code for parsing is NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; NSLog(@"resp--- %@",responseString); NSArray* latestLoans = [(NSDictionary*)[responseString JSONValue] objectForKey:@"user"]; NSDictionary* loan = [latestLoans objectAtIndex:0]; NSString* name = [loan objectForKey:@"last_name"];

    Read the article

  • Python 3 with numpy and object refernces

    - by user963386
    I need to create a large matrix (array) structure (3 axis) and each element should store the reference to a Python object (myclass instance). Is it possible to use numpy to create such an array. Which data type should I use in order to store Python references? The advantage of numpy is the support of slicing at different levels. The alternativee is to create a nested (nested) list but it is a cumbersome solution.

    Read the article

  • regex not working "within" javascript string

    - by Tim
    I'm trying to replace all mentions of [b] in a text string and replace it with <b>. The problem with what I'm using below this that it's replace every [b] on the page, and I only want it to change the [b]'s within the text string ("text") that I'm sending in. Taking out the 'g' for global in the regex doesn't work very well because it then doesn't replace them all... text = text.replace(new RegExp('(^|\\s|>)\\[b](\\S.*?\\S)\\[/b]($|\\s|<)', 'gim') , '$1<strong>$2</strong>$3'); any ideas? Thanks

    Read the article

  • wxpython - Nested Notebooks

    - by madtowneast
    I have been trying to make my nested notebooks a little bit more appealing code wise. At the moment, I got this #!/usr/bin/env python import os import sys import datetime import numpy as np from readmonifile import MonitorFile from sortmonifile import sort import wx class NestedPanelOne(wx.Panel): #---------------------------------------------------------------------- # First notebook that creates the tab to select the component number #---------------------------------------------------------------------- def __init__(self, parent, label, data): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) sizer = wx.BoxSizer(wx.VERTICAL) #Loop creating the tabs according to the component name nestedNotebook = wx.Notebook(self, wx.ID_ANY) for slabel in sorted(data[label].keys()): tab = NestedPanelTwo(nestedNotebook, label, slabel, data) nestedNotebook.AddPage(tab,slabel) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(nestedNotebook, 1, wx.ALL|wx.EXPAND, 5) self.SetSizer(sizer) class NestedPanelTwo(wx.Panel): #------------------------------------------------------------------------------ # Second notebook that creates the tab to select the main monitoring variables #------------------------------------------------------------------------------ def __init__(self, parent, label, slabel, data): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) sizer = wx.BoxSizer(wx.VERTICAL) nestedNotebook = wx.Notebook(self, wx.ID_ANY) for sslabel in sorted(data[label][slabel][data[label][slabel].keys()[0]].keys()): tab = NestedPanelThree(nestedNotebook, label, slabel, sslabel, data) nestedNotebook.AddPage(tab, sslabel) sizer.Add(nestedNotebook, 1, wx.ALL|wx.EXPAND, 5) self.SetSizer(sizer) class NestedPanelThree(wx.Panel): #------------------------------------------------------------------------------- # Third notebook that creates checkboxes to select the monitoring sub-variables #------------------------------------------------------------------------------- def __init__(self, parent, label, slabel, sslabel, data): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) labels=[] chbox =[] chboxdict={} for ssslabel in sorted(data[label][slabel][data[label][slabel].keys()[0]][sslabel].keys()): labels.append(ssslabel) for item in list(set(labels)): cb = wx.CheckBox(self, -1, item) chbox.append(cb) chboxdict[item]=cb gridSizer = wx.GridSizer(np.shape(list(set(labels)))[0],3, 5, 5) gridSizer.AddMany(chbox) self.SetSizer(gridSizer) ######################################################################## class NestedNotebookDemo(wx.Notebook): #--------------------------------------------------------------------------------- # Main notebook creating tabs for the monitored components #--------------------------------------------------------------------------------- def __init__(self, parent, data): wx.Notebook.__init__(self, parent, id=wx.ID_ANY, style= wx.BK_DEFAULT ) for label in sorted(data.keys()): print label tab = NestedPanelOne(self,label, data) self.AddPage(tab, label) ######################################################################## class DemoFrame(wx.Frame): #---------------------------------------------------------------------- # Putting it all together #---------------------------------------------------------------------- def __init__(self,data): wx.Frame.__init__(self, None, wx.ID_ANY, "pDAQ monitoring plotting tool", size=(800,400) ) panel = wx.Panel(self) notebook = NestedNotebookDemo(panel, data) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5) panel.SetSizer(sizer) self.Layout() #Menu Bar to be added later ''' menubar = wx.MenuBar() file = wx.Menu() file.Append(1, '&Quit', 'Exit Tool') menubar.Append(file, '&File') self.SetMenuBar(menubar) self.Bind(wx.EVT_MENU, self.OnClose, id=1) ''' self.Show() #---------------------------------------------------------------------- if __name__ == "__main__": if len(sys.argv) == 1: raise SystemExit("Please specify a file to process") for f in sys.argv[1:]: data=sort.sorting(f) print data['stringHub'].keys() print data.keys() print data[data.keys()[0]].keys() print 'test' app = wx.PySimpleApp() frame = DemoFrame(data) app.MainLoop() print 'testend' and I would like to reduce this whole mess into something that only has three nested for loops, so something like for label in sorted(data.keys()): self.SubNoteBooks[label] = wx.Notebook(self.Notebook, wx.ID_ANY) self.Notebook.AddPage(self.SubNoteBooks[label], label) for slabel in sorted(data[label].keys()): self.SubNoteBooks[label][slabel] = wx.Notebook(self, wx.ID_ANY) self.SubNoteBooks[label].AddPage(self.SubNoteBooks[label][slabel], slabel) for sslabel in sorted(data[label][slabel][data[label][slabel].keys()[0]].keys()): self.SubNoteBooks[label][slabel][sslabel] = wx.Notebook(self.Notebook, wx.ID_ANY) self.Notebook.AddPage(self.SubNoteBooks[label][slabel][sslabel], sslabel) I have been trying to fiddle this around but the problem seems to be the line self.SubNoteBooks[label][slabel] = wx.Notebook(self, wx.ID_ANY) I get the error: Traceback (most recent call last): File "./reducelinenumbers.py", line 162, in <module> frame = DemoFrame(data) File "./reducelinenumbers.py", line 126, in __init__ self.SubNoteBooks[label][slabel] = wx.Notebook(self, wx.ID_ANY) TypeError: 'Notebook' object does not support item assignment I understand why notebook is being type raises a TypeError here. Is there a way around this? Thanks a bunch in advance.

    Read the article

  • frame by frame animation not running

    - by abc
    well,i am a newbie to android..and i dont know whats wrong in my code.. this is my xml file <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" id="selected" android:oneshot="false"> <item android:drawable="@drawable/w1" android:duration="50" /> <item android:drawable="@drawable/w2" android:duration="50" /> </animation-list> my java file ImageView img = (ImageView)findViewById(R.id.s); img.setBackgroundResource(R.anim.shape_animation); // Get the background, which has been compiled to an AnimationDrawable object. AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground(); // Start the animation (looped playback by default). frameAnimation.start();

    Read the article

  • Using bash to copy file to spec folders

    - by Franko
    I have a folder with a fair amount of subfolders. In some of the subfolders do I have a folder.jpg picture. What I try to do find that folder(s) and copy it to all other subfolders that got the same artist and album information then continue on to the next album etc. The structure of all the folders are "artist - year - album - [encoding information]". I have made a really simple one liner that find the folders that got the file but there am I stuck. ls -F | grep / | while read folders;do find "$folders" -name folder.jpg; done Anyone have any good tip or ideas how to solve this or pointers how to proceed? Edit: First of all, i´m real new to this (like you cant tell) so please have patience. Ok, let me break it down even more. I have a folder structure that looks like this: artist1 - year - album - [flac] artist1 - year - album - [mp3] artist1 - year - album - [AAC] artist2 - year - album - [flac] etc I like to loop over the set of folders that have the same artist and album information and look for a folder.jpg file. When I find that file do I like to copy it to all of the other folders in the same set. Ex if I find one folder.jpg in artist1 - year - album - [flac] folder do I like to have that folder.jpg copied to artist1 - year - album - [mp3] & artist1 - year - album - [AAC] but not to artist2 - year - album - [flac]. The continue the loop until all the sets been processed. I really hope that makes it a bit more easy to understand what I try to do :)

    Read the article

  • android layout images bad quality

    - by user1028269
    when I add images on layout it show in bad quality <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/sbackground" /> how to fix it? (I need to fix it only without programmatically) thanks

    Read the article

  • Can I combine two functions into one using Javascript?

    - by Melissa
    I have the following code that I would like to simplify. With javascript and jQuery is there an easy way that I could combine these two functions? Most of the code is the same but I am not sure how I could create a single function that works differently depending on what is clicked. $(document).ready(function () { $('#ListBooks').click(ListBooks); $('#Create').click(Create); }); function Create() { var dataSourceID = $('#DataSourceID').val(); var subjectID = $('#SubjectID').val(); var contentID = $('#ContentID').val(); if (dataSourceID && dataSourceID != '00' && subjectID && subjectID != "00" && contentID && contentID != "00") { var e = encodeURIComponent, arr = ["dataSourceID=" + e(dataSourceID), "subjectID=" + e(subjectID), "contentID=" + e(contentID)]; window.location.href = '/Administration/Books/Create?' + arr.join("&"); } else { alert('Datasource, Subject and Content must be selected.'); } return false; } function ListBooks() { var dataSourceID = $('#DataSourceID').val(); var subjectID = $('#SubjectID').val(); var contentID = $('#ContentID').val(); if (dataSourceID && dataSourceID != '00' && subjectID && subjectID != "00" && contentID && contentID != "00") { var e = encodeURIComponent, arr = ["dataSourceID=" + e(dataSourceID), "subjectID=" + e(subjectID), "contentID=" + e(contentID)]; window.location.href = '/Administration/Books/ListBooks?' + arr.join("&"); } else { alert('Datasource, Subject and Content must be selected.'); } return false; }

    Read the article

  • Code refactoring homework?

    - by Hira
    This is the code that I have to refactor for my homework: if (state == TEXAS) { rate = TX_RATE; amt = base * TX_RATE; calc = 2 * basis(amt) + extra(amt) * 1.05; } else if ((state == OHIO) || (state == MAINE)) { rate = (state == OHIO) ? OH_RATE : MN_RATE; amt = base * rate; calc = 2 * basis(amt) + extra(amt) * 1.05; if (state == OHIO) points = 2; } else { rate = 1; amt = base; calc = 2 * basis(amt) + extra(amt) * 1.05; } I have done something like this if (state == TEXAS) { rate = TX_RATE; calculation(rate); } else if ((state == OHIO) || (state == MAINE)) { rate = (state == OHIO) ? OH_RATE : MN_RATE; calculation(rate); if (state == OHIO) points = 2; } else { rate = 1; calculation(rate); } function calculation(rate) { amt = base * rate; calc = 2 * basis(amt) + extra(amt) * 1.05; } How could I have done better? Edit i have done code edit amt = base * rate;

    Read the article

  • Top navigation link in Magento that I can't get rid of

    - by Chris Baily
    I'm working on a new theme for an existing Magento installation, and I've got a rogue link. The last guy apparently decided to hard code a link to the AW Blog extension he was using in the top navigation. See here: derm2go.com - link is "articles". I'm getting rid of AW Blog in favor of an integrated wordpress install, but when I uninstall AW Blog, the site breaks (everything after the nav dissapears) and I get this error in my logs: 2011-11-19T08:56:19+00:00 ERR (3): Warning: include() [function.include]: Failed opening 'Mage/Blog/Helper/Data.php' for inclusion (include_path='/chroot/home/dermtwog/derm2go.com/html/app/code/local:/chroot/home/dermtwog/derm2go.com/html/app/code/community:/chroot/home/dermtwog/derm2go.com/html/app/code/core:/chroot/home/dermtwog/derm2go.com/html/lib:.:/usr/share/pear') in /chroot/home/dermtwog/derm2go.com/html/lib/Varien/Autoload.php on line 93 I've searched everywhere, I can think of that might effect the nav menu, and I don't know where the link is coming from - it's not in the CMS/static blocks, its not in any of the default template files on the server (I deleted and reinstalled all of them) and it's showing up even when I change templates, so it's probably not in on the sub themes. Does anyone out there know of other files it could be hiding in? I'm assuming the last guy did a quick and dirty hack somehow - and maybe messed with core files? Would really rather not have to do a full reinstall.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >