Daily Archives

Articles indexed Tuesday June 15 2010

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

  • javascript image toggling

    - by Sunil Ramu
    I have a tree view which has a folder icon by default and once clicked it has to be changed to a checkbox icon. And further on clicking the checkbox icon should display a folder icon. Sample Code, Server side : c# htmlSb.AppendFormat(" {0}", emptyContent); JS code var Test= new Object(); Test.Controls=new Object(); Test.Controls.TreeView = new Object(); **Test.Controls.TreeView.SelectNode = function (TreeId, nodeLabel) { $("#" + TreeId + " li span, ul li span").css("background-color", "transparent"); nodeLabel.style.backgroundColor = "white"; nodeLabel.style.background = "url(../images/selected.gif) 0 0 no-repeat"; }** The other Image : if (nodeLabel.style.background = "url(../images/folderclosed.gif) 0 0 no-repeat") I need to toggle between "selected.gif" and "folderclosed.gif" images. If one is clicked the other should display. and vice versa. Please help.

    Read the article

  • question about frequency of updating access

    - by I__
    i have a table in an access database this access database is used on a regular basis, basically from 9-5 someone else has a copy of this exact table. sometimes records are added, sometimes deleted, and sometimes data within the records is updated. i need to update the access database table with the offsite table every hour or so. what is the best algorithm of updating the data? there are about 5000 records. would it severely lock up the table for a few seconds every hour? i would like to publicly apologize for my rude comment to david fenton

    Read the article

  • iPhone Development - calling external JSON API (will Apple reject?)

    - by RPM1984
    Ok guys, so im new to iPhone development, so apologies if this is a silly question, but before i actually create my app i want to know if this is possible, and if Apple will reject this. (Note this is all theoretical) So i'd have a API (.NET) that runs on a cloud server somewhere and can return HTML/JSON/XML. I'll have a website that can access this API and allow customers to do some stuff (but this is not important for this question). I would then like my iPhone app to make a call to this API which would return JSON data. So my iPhone app might make a call to http://myapp/Foos which would return a JSON string of Foo objects. The iPhone app would then parse this JSON and do some funky stuff with it. So, that's the background, now the questions: Is this possible? (that is, call an external cloud API over HTTP, parse JSON response?) What are the chances of Apple rejecting this application (because it would be calling a non-Apple API) Are there any limitations (security, libraries, etc) on the iPhone/Objective-C/Cocoa that might hinder this solution? On this website, they seem to be doing exactly what im asking. Thoughts, suggestions, links would be greatly appreciated...

    Read the article

  • Communicating from website to desktop application (not vice-versa)

    - by chakrit
    I am designing an application such that it will have to react to certain actions required by the website, mostly the same way Last.FM client does (if you have used one) The way Last.FM client works is that, it will register a custom protocol in Windows (lastfm://) and on their website, they use that protocol to trigger certain action on the player, e.g.: lastfm://artist//similarartists will actually direct any Last.FM client running to load up similar artists. I would like to do the same thing for my application. Is this a good idea? Is there any good alternatives to send a message from a website to a desktop client in this manner?

    Read the article

  • rails Rake and mysql ssh port forwarding.

    - by rube_noob
    Hello, I need to create a rake task to do some active record operations via a ssh tunnel. The rake task is run on a remote windows machine so I would like to keep things in ruby. This is my latest attempt. desc "Syncronizes the tablets DB with the Server" task(:sync => :environment) do require 'rubygems' require 'net/ssh' begin Thread.abort_on_exception = true tunnel_thread = Thread.new do Thread.current[:ready] = false hostname = 'host' username = 'tunneluser' Net::SSH.start(hostname, username) do|ssh| ssh.forward.local(3333, "mysqlhost.com", 3306) Thread.current[:ready] = true puts "ready thread" ssh.loop(0) { true } end end until tunnel_thread[:ready] == true do end puts "tunnel ready" Importer.sync rescue StandardError => e puts "The Database Sync Failed." end end The task seems to hang at "tunnel ready" and never attempts the sync. I have had success when running first a rake task to create the tunnel and then running the rake sync in a different terminal. I want to combine these however so that if there is an error with the tunnel it will not attempt the sync. This is my first time using ruby Threads and Net::SSH forwarding so I am not sure what is the issue here. Any Ideas!? Thanks

    Read the article

  • Aligning messageformat on printing a JTable.

    - by DanielFH
    I'm using this for the moment to print out my table, and it works. But I'm not really happy with the layout of the messageformatting, I would like to have both pagenumber and date in the footer, and date format aligned to the left side of the table, and page to the right. How can I do that? Been reading some stuff about overriding the PrintTable method, but seems to get pretty complex from what I've read. Hope you can help me with this issue, thank you. :) import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.standard.OrientationRequested; import javax.swing.JTable; import dk.beesys.rims.ui.WindowInventory; public class Print { private static Print INSTANCE; public static Print getInstance() { if (INSTANCE == null) { INSTANCE = new Print(); } return INSTANCE; } private Print(){ } public void printList(java.awt.event.ActionEvent ignore) { String strDate = MessageFormat.format("{0,date,short} {0,time,short}", new Date()); MessageFormat header = new MessageFormat("- {0} -"); MessageFormat footer = new MessageFormat("Printed: " + strDate); PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); aset.add(OrientationRequested.LANDSCAPE); try { WindowInventory.getInstance().getTable().print(JTable.PrintMode.FIT_WIDTH, header, footer, true, aset, true); } catch (java.awt.print.PrinterException e) { System.err.format("Cannot print %s%n", e.getMessage()); } }

    Read the article

  • Syntax error in SWIG using __thread keyword

    - by user366838
    I am trying to make some code thread safe for use with pthreads. This code is written in C++, but is linked to using SWIG. g++ compiles this correctly, but when swig tries to create a wrapper, I get: fast_alloc.hh:109: Error: Syntax error in input(3) The original, unsafe code that compiles correctly is: static void *freeLists[Num_Buckets]; and the error occurs when I change it to: static __thread void *freeLists[Num_Buckets]; I have made other parts thread safe adding "__thread", for example, this works: static __thread unsigned newCount[Num_Buckets];

    Read the article

  • Where'd my sounds go?

    - by Dane Man
    In my Row class I have the initWithCoder method and everything restored in that method works fine, but only within the method. After the method is called I loose an array of sounds that is in my Row class. The sounds class also has the initWithCoder method, and the sound plays fine but only in the Row class initWithCoder method. After decoding the Row object, the sound array disappears completely and is unable to be called. Here's my source for the initWithCoder: - (id) initWithCoder:(NSCoder *)coder { ... soundArray = [coder decodeObjectForKey:@"soundArray"]; NSLog(@"%d",[soundArray count]); return self; } the log shows the count as 8 like it should (this is while unarchiving). Then the row object I create gets assigned. And the resulting row object no longer has a soundArray. [NSKeyedArchiver archiveRootObject:row toFile:@"DefaultRow"]; ... row = [NSKeyedUnarchiver unarchiveObjectWithFile:@"DefaultRow"]; So now whenever I call the soundArray it crashes. //ERROR IS HERE NSLog(@"%d",[[row soundArray] count]); Help please (soundArray is an NSMutableArray).

    Read the article

  • Array split by range?

    - by acidzombie24
    I have an array, i don't know the length but i do know it will be =48bytes. The first 48bytes are the header and i need to split the header into two. Whats the easiest way? I am hoping something as simple as header.split(32); would work ([0] is 32 bytes [1] being 16 assuming header is an array of 48bytes) using .NET

    Read the article

  • How to cascade dependency resolution w/ CDI (WELD)

    - by mP
    I would like to have a central weld container that holds all my services and so on. This container would however be wrapped by a second container which contains local settings. THe goal is if a depdendency cannot be found in the outter container then i would like to then search the inner container. How can i achieve this ? I would prefer to do things in a standlike manner, without reverting to use of non standard WELD extensions.

    Read the article

  • Accessing web.config from Sharepoint web part

    - by philj
    I have a VS 2008 web parts project - in this project is a web.config file: something like this: <?xml version="1.0"?> <configuration> <connectionStrings/> <system.web> <appSettings> <add key="MFOwner" value="Blah" /> </appSettings> ……. In my web part I am trying to access values in the appSetting section: I've tried all of the code below and each returns null: string Owner = ConfigurationManager.AppSettings.Get("MFOwner"); string stuff1 = ConfigurationManager.AppSettings["MFOwner"]; string stuff3 = WebConfigurationManager.AppSettings["MFOwner"]; string stuff4 = WebConfigurationManager.AppSettings.Get("MFOwner"); string stuff2 = ConfigurationManager.AppSettings["MFowner".ToString()]; I've tried this code I found: NameValueCollection sAll; sAll = ConfigurationManager.AppSettings; string a; string b; foreach (string s in sAll.AllKeys) { a = s; b = sAll.Get(s); } and stepped through it in debug mode - that is getting things like : FeedCacheTimer FeedPageURL FeedXsl1 ReportViewerMessages which is NOT coming from anything in my web.config file....maybe a config file in sharepoint itself? How do I access a web.config (or any other kind of config file!) local to my web part??? thanks, Phil J

    Read the article

  • width of the bar in Jfreechart

    - by Harish
    Is there a way to adjust the width of the bars in a Barchart.I create my chart with the following code. final JFreeChart chart = ChartFactory.createBarChart("Report", // chart title "Date", // domain axis label "Number", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? );

    Read the article

  • Suggested php code to read file rating set by Adobe Bridge CS3

    - by DarwinIcesurfer
    Background: I have been attempting to read the rating that is assigned in Adobe Bridge CS3 using the creative commons Metadata toolkit for php without success. I am using shared hosting so I do not have an oppotunity to recompile php with different modules. Is php code available that could be used to read the rating that is embedded in the .jpg file? I have read that this is an xmp (xml) formatted section within the file.

    Read the article

  • How to display total record count against models in django admin

    - by Rog
    Is there a neat way to make the record/object count for a model appear on the main model list in the admin module? I have found techniques for showing counts of related objects within sets in the list_display page (and I can see the total in the pagination section at the bottom of the same), but haven't come across a neat way to show the record count at the model list level.

    Read the article

  • How do I rename a network interface using netsh?

    - by Alex Angas
    I'm building my first Windows 2008 Server Core machine (running R2) and want to rename the IPv4 network interfaces to something more meaningful. It seems most likely that this is done using netsh interface ipv4 set but looking through the help hasn't turned anything up. Could someone please advise the correct procedure?

    Read the article

  • using jQuery .animate to animate a div from right to left?

    - by Alex
    Hi, I have a div absolutely positioned at top: 0px and right: 0px, and I would like to use jquery's .animate() to animate it from it's current position to left: 0px. How does one do this? I can't seem to get this to work: $("#coolDiv").animate({"left":"0px"}, "slow"); Why doesn't this work and how does one accomplish what I am looking to do? Thanks!!

    Read the article

  • In Javascript event handling, why "return false" or "event.preventDefault()" and "stopping the event

    - by Jian Lin
    It is said that when we handle a "click event", returning false or calling event.preventDefault() makes a difference, in which the difference is that preventDefault will only prevent the default event action to occur, i.e. a page redirect on a link click, a form submission, etc. and return false will also stop the event flow. Does that mean, if the click event is registered several times for several actions, using $('#clickme').click(function() { … }) returning false will stop the other handlers from running? I am on a Mac now and so can only use Firefox and Chrome but not IE, which has a different event model, and tested it on FF and Chrome and all 3 handlers ran without any stopping…. so what is the real difference, or, is there a situation where "stopping the event flow" is not desirable? this is related to http://stackoverflow.com/questions/3042036/using-jquerys-animate-if-the-clicked-on-element-is-a-href-a and http://stackoverflow.com/questions/2017755/whats-the-difference-between-e-preventdefault-and-return-false

    Read the article

  • Screening (multi)collinearity in a reggresion model

    - by aL3xa
    I hope that this one is not going to be "ask-and-answer" question... here goes: (multi)collinearity refers to extremely high correlations between predictors in the regression model. How to cure them... well, sometimes you don't need to "cure" collinearity, since it doesn't affect regression model itself, but interpretation of an effect of individual predictors. One way to spot collinearity is to put each predictor as a dependent variable, and other predictors as independent variables, determine R2, and if it's larger than .9 (or .95), we can consider predictor redundant. This is one "method"... what about other approaches? Some of them are time consuming, like excluding predictors from model and watching for b-coefficient changes - they should be noticeably different. Of course, we must always bare in mind specific context/goal of analysis... Sometimes, only remedy is to repeat a research, but right now, I'm interested in various ways of screening redundant predictors when (multi)collinearity occurs in a regression model.

    Read the article

  • Dragging an UIView inside UIScrollView

    - by Sergey Mikhanov
    Hello community! I am trying to solve a basic problem with drag and drop on iPhone. Here's my setup: I have a UIScrollView which has one large content subview (I'm able to scroll and zoom it) Content subview has several small tiles as subviews that should be dragged around inside it. My UIScrollView subclass has this method: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { UIView *tile = [contentView pointInsideTiles:[self convertPoint:point toView:contentView] withEvent:event]; if (tile) { return tile; } else { return [super hitTest:point withEvent:event]; } } Content subview has this method: - (UIView *)pointInsideTiles:(CGPoint)point withEvent:(UIEvent *)event { for (TileView *tile in tiles) { if ([tile pointInside:[self convertPoint:point toView:tile] withEvent:event]) return tile; } return nil; } And tile view has this method: - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInView:self.superview]; self.center = location; } This works, but not fully correct: the tile sometimes "falls down" during the drag process. More precisely, it stops receiving touchesMoved: invocations, and scroll view starts scrolling instead. I noticed that this depends on the drag speed: the faster I drag, the quicker the tile "falls". Any ideas on how to keep the tile glued to the dragging finger? Thanks in advance!

    Read the article

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