Daily Archives

Articles indexed Wednesday April 28 2010

Page 13/119 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Communicating with remote server in Android

    - by primal
    Hi, As part of the college mini-project, I am developing a micro-blogging platform for Android. I am planning to use Django framework in python to handle the communication between Android and remote server so as to make database API independent. I heard its best practice to use HTTP methods for the communication. Which is the best site/book to learn using HTTP methods for Android? I

    Read the article

  • How do I remove an active outline from jquery accordion ?

    - by Ash
    I am using Jquery Accordion. The active link has an outline. I have tried using css: #accordion a:focus { outline: none; } #accordion a:active {outline: none; font-weight:bold;} and also #accordion a:-moz-any-link:focus { outline: none; } None of these seem to work. Can anyone advise a setting or another option to remove the dotted outline around the active links?

    Read the article

  • merging and manupulating files in matlab

    - by Paul
    Is there a way to run a loop through a folder and process like 30 files for a month and give the average,max of each columns and write in one excel sheet or so?? I have 30 files of size [43200 x 30] I ran a different matlab scrip to generate them so the names are easy File_2010_04_01.xls , File_2010_04_02.xls ..... and so on I cannot merge them as each are 20mbs and matlab would crash. Any ideas? Thanks

    Read the article

  • Is there a repo where you can download android virtual devices?

    - by thepearson
    Does anyone know, if vendors provide or if there is a site where one could download AVD profiles for existing android devices on the market so you can run your apps in the emulator and basically see how they will run on said devices? I know it's pretty easy to create a new device but it'd be great if one could just download the config file for each device and run it.

    Read the article

  • Javascript not working IE any version

    - by Ce.
    Hey everyone. I am having some issues on my end and hopefully it's just something on my end but, could someone take a look at THIS PAGE in IE and let me know if you can see what is wrong. Please check it out first in FF or Chrome or Safari because it all works fine in those browsers. The two scripts I am using are a custom-ish dropdown menu and another using jcarousel lite. I can't seem to figure out what the problem is. Thanks for any help!!!

    Read the article

  • Problem with migrating from Texture2D to CCTexture2D (Setting CCSprite texture)

    - by marie
    My problem is that whenever I change the texture of a sprite, the new texture will retain the size of the original sprite's texture. I have this code: mySprite = [CCSprite spriteWithFile:@"mySprite.png"]]; ... // change current stage here CCTexture2D *newTexture=[[[CCTexture2D alloc]initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"stage number %d.png",currentStageNumber]]]autorelease]; [mySprite setTexture:newTexture]; The new sprite is stretched or compressed depending on the size of the original sprite. If the original sprite is larger, the new texture is stretched. I didn't have this problem when I was using cocos2d v0.8 What am I doing wrong?

    Read the article

  • Transparent BITMAP WinAPI

    - by user146780
    I want to implement a layering system in my application and was thinking of creating a bunch of trabsparent bitmaps, adding content to them then blitting them on top of each other, how can this be done without setting each pixel to (0,0,0,0). I'm using Pure win32, not MFC, thanks.

    Read the article

  • How to use string interpolation when rendering templates?

    - by Senthil
    I found this code in a Rails cookbook. class BlogController < ApplicationController def display_by_date year = params[:year] month = params[:month] day = params[:day] day ='0'+day if day && day.size == 1 @day = day if ( year && month && day ) render(:template => "blog/#{year}/#{month}/#{day}") elsif ( year ) render(:template => "blog/#{year}/list") end end end I'm not sure what to name the templates so the router can find them. Thanks for your help.

    Read the article

  • Reset form with jQuery

    - by da5id
    I have a form with a standard reset button coded thusly: <input type="reset" class="button standard" value="Clear" /> Trouble is, said form is of the multi-stage sort, so if a user fills out a stage & then returns later, the 'remembered' values for the various fields won't reset when the Clear button is clicked. I'm thinking that attaching a jQuery function to loop over all the fields and clear them 'manually' would do the trick. I'm already using jQuery within the form, but am only just getting up to speed & so am not sure how to go about this, other than individually referencing each field by ID, which doesn't seem very efficient. TIA for any help.

    Read the article

  • Need help for a complex linq query

    - by Jipy
    Ok so I've got a DataTable here's the schema DataTable dt = new DataTable(); dt.Columns.Add("word", typeof(string)); dt.Columns.Add("pronunciation", typeof(string)); The table is filled already and I'm trying to make a linq query so that i can output to the console or anywhere something like : Pronunciation : akses9~R => (list of words) I want to output the pronunciations the most common and all the words that use it.

    Read the article

  • SQL Server installation leaves odd hotfix folders on the root

    - by Nick
    I have about a dozen weirdly named folders, for example 5e812807b3e1b04248ed046794a01b, on my d: drive after installing SQL Server 2008. Inside each folder are two subfolders: 1033 and hotfixexpress \1033\eula.txt \1033\finalsql2005information.rtf \1033\hotfix.rll \1033\sqlhotfix.chm \1033\sqlse.rll \hotfixexpress\files\sqlexpr.exe I get access denied whenever I try to delete any of these files / folders. I tried again after stopping all SQL server services, without luck. Any ideas?

    Read the article

  • Vertical Image Border Changes Alignment when Screen is not maximized

    - by Randy
    I have some pretty straightforward HTML code with a few tables to organize various items of text or images. All works fine except that I need to place a vertical border on both the left and right sides of the screen. I am able to do this with a 2x2 pixel image that I stretch out. When the user has their screen maximized, everything looks great. But when the user hits "Restore Down", then the borders stay in place, but the tables get shoved down so that they start below where the borders end, which is off screen. in other words, the relational alignment between the borders and the tables gets all screwed up. Does anybody know how to make this alignment stay consistent on a restore down? I'm pretty much a newbie with html and asp, so speak slowly. If there is a better method to accomplish this, I'm all ears. Thanks. Here is the relevant section of code: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" % <form id="form1" runat="server"> <asp:Image ID="LeftBorder" src="../Images/Border_Blue.jpg" runat="server" WIDTH="15" HEIGHT="1000" BORDER="0" alt="Image Missing" align="left"/> <asp:Image ID="RightBorder" src="../Images/Border_Blue.jpg" runat="server" WIDTH="15" HEIGHT="1000" BORDER="0" alt="Image Missing" align="right" /> <table id="BannerTable" style="height: 100px"> <tr> <td width="934px"> <img src="../Images/Header.jpg" alt="Image Missing" id="ImgBanner" align="left"/></td> </tr> </table>

    Read the article

  • Issue with Autofac 2 and MVC2 using HttpRequestScoped

    - by Page Brooks
    I'm running into an issue with Autofac2 and MVC2. The problem is that I am trying to resolve a series of dependencies where the root dependency is HttpRequestScoped. When I try to resolve my UnitOfWork (which is Disposable), Autofac fails because the internal disposer is trying to add the UnitOfWork object to an internal disposal list which is null. Maybe I'm registering my dependencies with the wrong lifetimes, but I've tried many different combinations with no luck. The only requirement I have is that MyDataContext lasts for the entire HttpRequest. I've posted a demo version of the code for download here. Autofac modules are set up in web.config Global.asax.cs protected void Application_Start() { string connectionString = "something"; var builder = new ContainerBuilder(); builder.Register(c => new MyDataContext(connectionString)).As<IDatabase>().HttpRequestScoped(); builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerDependency(); builder.RegisterType<MyService>().As<IMyService>().InstancePerDependency(); builder.RegisterControllers(Assembly.GetExecutingAssembly()); _containerProvider = new ContainerProvider(builder.Build()); IoCHelper.InitializeWith(new AutofacDependencyResolver(_containerProvider.RequestLifetime)); ControllerBuilder.Current.SetControllerFactory(new AutofacControllerFactory(ContainerProvider)); AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); } AutofacDependencyResolver.cs public class AutofacDependencyResolver { private readonly ILifetimeScope _scope; public AutofacDependencyResolver(ILifetimeScope scope) { _scope = scope; } public T Resolve<T>() { return _scope.Resolve<T>(); } } IoCHelper.cs public static class IoCHelper { private static AutofacDependencyResolver _resolver; public static void InitializeWith(AutofacDependencyResolver resolver) { _resolver = resolver; } public static T Resolve<T>() { return _resolver.Resolve<T>(); } } UnitOfWork.cs public interface IUnitOfWork : IDisposable { void Commit(); } public class UnitOfWork : IUnitOfWork { private readonly IDatabase _database; public UnitOfWork(IDatabase database) { _database = database; } public static IUnitOfWork Begin() { return IoCHelper.Resolve<IUnitOfWork>(); } public void Commit() { System.Diagnostics.Debug.WriteLine("Commiting"); _database.SubmitChanges(); } public void Dispose() { System.Diagnostics.Debug.WriteLine("Disposing"); } } MyDataContext.cs public interface IDatabase { void SubmitChanges(); } public class MyDataContext : IDatabase { private readonly string _connectionString; public MyDataContext(string connectionString) { _connectionString = connectionString; } public void SubmitChanges() { System.Diagnostics.Debug.WriteLine("Submiting Changes"); } } MyService.cs public interface IMyService { void Add(); } public class MyService : IMyService { private readonly IDatabase _database; public MyService(IDatabase database) { _database = database; } public void Add() { // Use _database. } } HomeController.cs public class HomeController : Controller { private readonly IMyService _myService; public HomeController(IMyService myService) { _myService = myService; } public ActionResult Index() { // NullReferenceException is thrown when trying to // resolve UnitOfWork here. // Doesn't always happen on the first attempt. using(var unitOfWork = UnitOfWork.Begin()) { _myService.Add(); unitOfWork.Commit(); } return View(); } public ActionResult About() { return View(); } }

    Read the article

  • Debugging EXC_BAD_ACCESS in an iPhone app

    - by Jeff
    Here's my stack trace. Where do I start to figure this out? I've tried a ton of NSLog()s and I can't track it down. #0 0x94e9ced7 in objc_msgSend () #1 0x04936318 in ?? () #2 0x0259b252 in __CFRunLoopDoObservers () #3 0x0259a65f in CFRunLoopRunSpecific () #4 0x02599c48 in CFRunLoopRunInMode () #5 0x02ae7615 in GSEventRunModal () #6 0x02ae76da in GSEventRun () #7 0x0061dfaf in UIApplicationMain () #8 0x000051cc in main

    Read the article

  • Set primary key on hibernate generated sequence table

    - by bungrudi
    setup: hibernate 3.3, MySQL 5 I have an hibernate entity that have its PK generated using a sequence table. The annotation looks like this: @GenericGenerator(name = "SCENARIO_TABLE_GEN", strategy = "org.hibernate.id.enhanced.TableGenerator", parameters = { @Parameter(name = "initial_value", value = "5"), @Parameter(name = "force_table_use", value = "true"), @Parameter(name = "table_name", value = "SEQ_TABLE"), @Parameter(name = "value_column_name", value = "VALUE_COL"), @Parameter(name = "segment_column_name", value = "KEY_COL"), @Parameter(name = "segment_value", value = "SCENARIO") }) The problem is, that hibernate generated sequence table (SEQ_TABLE in my case, generated using hbm2ddl) does not have a primary keys. How do I tell hibernate that I want to have the primary key for the sequence table set on KEY_COL ?

    Read the article

  • Powershell replace lose line breaks

    - by Fadrian Sudaman
    Hi, I am a newbie in powershell. I have a simple powershell script that just replace text but I found that the regex replace turn my multiline data source into a single line text when the output is produced. I want the line breaks to be preserved. Here is the dumb down version of the script. $source=(Get-Content textfile.txt) $process1 = [regex]::Replace($source, "line", "line2") $process1 | out-file -encoding ascii textfile2.txt You can create a test file call textfile.txt with simple lines like this to test it line line Some line More line here Have I missed something obvious? Thanks, Fadrian

    Read the article

  • protect_from_forgery & Unobtrusive Javascript

    - by Matt Grande
    Hi all, I have some javascript making an ajax call in my Rails site: $.ajax({type: "PUT", url: url, data: { dummy: data }, complete: function(data) {}}); When Rails gets it, it throws back an ActionController::InvalidAuthenticityToken Error. I'd like to keep the protect_from_forgery stuff in there, if possible... But I'm at a loss for how can I pass the auth token from a javascript file? Can anyone help me out?

    Read the article

  • How to combine a Distance and Keyword SQL query?

    - by Jason
    Hi Folks, I have a tables in my database called "points" and "category". A user will input info into both a location input and a keyword input text box. Then I want to find points in my table where the keyword matches either the "title" field in the points table, or the "category" but are within a certain distance from the user's location. I want to order the results by distance. Here are the 2 queries which btoh work independently: $mysql = "SELECT *, ( 3959 * acos( cos( radians('$search_lat') ) * cos( radians( lat ) ) * cos( radians( longi ) - radians('$search_lng') ) + sin( radians('$search_lat') ) * sin( radians( lat ) ) ) ) AS distance FROM points HAVING distance < '$radius'"; $mysql2 = "SELECT * FROM `points` LEFT JOIN category USING ( category_id ) WHERE (point_title LIKE '%$esc_catsearch%' OR category.title LIKE '%$esc_catsearch%')"; Here is what I tried: $sql_search = sprintf("SELECT *,point_id FROM points WHERE point_title LIKE '%%%s%%' UNION SELECT *, ( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( longi ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS distance FROM points HAVING distance < '%s' ORDER BY distance LIMIT %d , %d", $esc_catsearch, mysql_real_escape_string($search_lat), mysql_real_escape_string($search_lng), mysql_real_escape_string($search_lat), mysql_real_escape_string($radius), $offset, $rowsPerPage); But it tells me there is no know column "distance". If I remove the "Order By" phrase then it works but I'm still not sure this is giving me the results I want. I also tried the query the other way around with the distance search first but that seems to ignore my keyword. Any thoughts would be much appreciated!

    Read the article

  • Why is WCF Stream response getting corrupted on write to disk?

    - by Alvin S
    I am wanting to write a WCF web service that can send files over the wire to the client. So I have one setup that sends a Stream response. Here is my code on the client: private void button1_Click(object sender, EventArgs e) { string filename = System.Environment.CurrentDirectory + "\\Picture.jpg"; if (File.Exists(filename)) File.Delete(filename); StreamServiceClient client = new StreamServiceClient(); int length = 256; byte[] buffer = new byte[length]; FileStream sink = new FileStream(filename, FileMode.CreateNew, FileAccess.Write); Stream source = client.GetData(); int bytesRead; while ((bytesRead = source.Read(buffer,0,length))> 0) { sink.Write(buffer,0,length); } source.Close(); sink.Close(); MessageBox.Show("All done"); } Everything processes fine with no errors or exceptions. The problem is that the .jpg file that is getting transferred is reported as being "corrupted or too large" when I open it. What am I doing wrong? On the server side, here is the method that is sending the file. public Stream GetData() { string filename = Environment.CurrentDirectory+"\\Chrysanthemum.jpg"; FileStream myfile = File.OpenRead(filename); return myfile; } I have the server configured with basicHttp binding with Transfermode.StreamedResponse.

    Read the article

  • Call methods on native Javascript types without wrapping with ()

    - by Anurag
    In Javascript, we can call methods on string literals directly without enclosing it within round brackets. But not for other types such as numbers, or functions. It is a syntax error, but is there a reason as to why the Javascript lexer needs these other types to be enclosed in round brackets? For example, if we extend Number, String, and Function with an alert method and try calling this method on the literals, it's a SyntaxError for Number and Function, while it works for a String. function alertValue() { alert(this); } Number.prototype.alert = alertValue; String.prototype.alert = alertValue; Function.prototype.alert = alertValue; We can call alert directly on a string object: "someStringLiteral".alert() // alerts someStringLiteral but it's a SyntaxError on numbers, and functions. 7.alert(); function() {}.alert(); To work with these types, we have to enclose it within brackets: (7).alert(); // alerts "7" (function() {}).alert(); // alerts "function() {}"

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >