Search Results

Search found 105 results on 5 pages for 'babu kong'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Deferred execution and eager evaluation

    - by babu M
    Hi Could you please give me an example for Deferred execution with eager evaluation in C#? I read from MSDN that deferred execution in LINQ can be implemented either with lazy or eager evaluation...i could find examples in the internet for Deferred execution with lazy evaluation ,however i could not find any example for Deferred execution with eager evaluation....please help me....its urgent... Moreover,how deferred execution differs from lazy evaluation?In my point of view,both are looking same.Could you please provide any example for this too?

    Read the article

  • Unable to import Eclipse project to Android studio

    - by Binoy Babu
    Whenever I try to import my Eclipse project to Android Studio I get the following error : You are using an old, unsupported version of Gradle. Please use version 1.8 or greater. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.) Consult IDE log for more details (Help | Show Log) Im using Android Studio 0.3 and Ubuntu, I also tried it on a Windows 8 box with fresh install but getting the same error. I'm using default gradle wrapper and I tried checking and unchecking auto import option. Is this a bug? How can I get around it. How do I update gradle to 1.8 or check the current gradle version? My build.gradle is given below. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.3' // I also tried using 0.6.1 and 0.5.+ } } apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 18 buildToolsVersion "18.0.1" sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } // Move the tests to tests/java, tests/res, etc... instrumentTest.setRoot('tests') // Move the build types to build-types/<type> // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... // This moves them out of them default location under src/<type>/... which would // conflict with src/ being used by the main source set. // Adding new build types or product flavors should be accompanied // by a similar customization. debug.setRoot('build-types/debug') release.setRoot('build-types/release') } }

    Read the article

  • The ternary (conditional) operator in C

    - by Bongali Babu
    What is the need for the conditional operator? Functionally it is redundant, since it implements an if-else construct. If the conditional operator is more efficient than the equivalent if-else assignment, why can't if-else be interpreted more efficiently by the compiler?

    Read the article

  • How to start a process from within a windows service

    - by BaBu
    I want to pop a browser with a given url from within a windows service. Like so: System.Diagnostics.Process.Start("http://www.venganza.org/"); Works fine when running in a console but not from within the service. No error messages, no exceptions, the Process.Start() command just seem to do nothing. It smells of some security issue, maybe something with the service properties and/or logon options? Annoying stuff this... Anybody? (Oh, and on windows 7/.NET framework 3.5.)

    Read the article

  • UIImages on UITableView?

    - by babu Kong
    what is the best method to display about 300 png images into a UITableView.. i dont wanna display them at the same time... i have 3 tableViewControllers that will each display about 100 imgaes.. (its for a catalog so the images are important to display) i used [uiimage imageNamed:] but that method caches the images and they dont get released so the memory usage is big.... is there any way to release the cache when the nav controller pushes a different view controller? i also tried [uiimage alloc] initWithContentsOfFile] but the images wont display.... any help?

    Read the article

  • Pasting images in TinyMCE on rails app

    - by Sam Kong
    Hi, I found a weird problem with TinyMCE editor. Copying & pasting images from another domain works fine but if the images are on the same domain the path are relative but not correct sometimes. I figured out that the problem is related to the rails URL scheme. Example) Images are copied from http://mydomain.com/index.html page and the real images path is http://mydomain.com/photos/image.jpg. Editor page: http://mydomain.com/posts/new = image path is set as ../photos/image.jpg http://mydomain.com/posts/edit/123 = image path is set as ../../photos/image.jpg So I tried http://mydomain.com/posts/new/ and it worked. How do I solve this problem? Thanks. Sam

    Read the article

  • Linq to SQL query error

    - by Tom Kong
    public class Service1 : IService1 { [OperationContract] public List<decmal> GetEnterCounts(DateTime StartTime, DateTime EndTime) { var db = new FACT_ENTER_EXIT(); return (from e in **db.ENTER_CNT** where StartTime < db.DATE_ID && db.DATE_ID > EndTime select e).ToList(); } } Ok, so I have this database FACT_ENTER_EXIT containing the field ENTER_CNT (nullable = false, type = decimal) which I want to return as a list VS2010 spits out the following error at 'db.ENTER_CNT': Error 1 Could not find an implementation of the query pattern for source type 'decimal'. 'Where' not found. I must be missing something, could someone please point out where I'm going wrong?? Thanks in advance, Tom

    Read the article

  • Hosting a WCF service in a Windows service. Works, but I can't reach it from Silverlight.

    - by BaBu
    I've made me an application hosted WCF service for my Silverlight application to consume. When I host the WCF service in a forms application everything works fine. But when I host my WCF service in a windows service (as explained brilliantly here) I get the dreaded 'NotFound' Web Exception when I call it from Silverlight. The 'WCF Test Client' tool does not complain. I'm' exposing a decent clientaccesspolicy.xml at root. Yet Silverlight won't have it. I'm stumped. Anybody have an idea about what could be going on here?

    Read the article

  • Rails 2.3 session

    - by Sam Kong
    Hi, I am developing a rails 2.3.2 app. I need to keep session_id for an order record, retrieve it and finally delete the session_id when the order is completed. It worked when I used cookies as session store but it doesn't for active_record store. (I restarted my browser, so no cache issue.) I know rails 2.3 implements lazy session load. I read some info about it but am still confused. Can somebody clarify how I use session_id for such a case? What I am doing is... A user make an order going through several pages. There is no sign-up, neither login. So I keep session_id in the order record so that no other user can access the order. @order = Order.last :conditions = {:id = params[:id], :session_id = session[:session_id] } When the order is finished, I set nil to session_id column. How would you implement such a case in lazy session(and active_record store) environment? Thanks. Sam

    Read the article

  • Passenger error message I can't figure out

    - by Sam Kong
    Hi, I am testing Rails 3 on DreamHost which just installed Rails 3. I created a simple controller and it failed. Browser shows 500 error (Internal Server Error) and the log shows the following message. Could not find i18n-0.5.0 in any of the sources Try running `bundle install`. *** Exception EOFError in spawn manager (Unexpected end-of-file detected.) (process 17951): from /dh/passenger/lib/phusion_passenger/utils.rb:306:in `unmarshal_and_raise_errors' from /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:71:in `spawn_application' from /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:41:in `spawn_application' from /dh/passenger/lib/phusion_passenger/spawn_manager.rb:159:in `spawn_application' from /dh/passenger/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' from /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__' from /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop' from /dh/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' from /dh/passenger/bin/passenger-spawn-server:61 [ pid=13245 file=ext/apache2/Hooks.cpp:727 time=2010-12-24 12:13:38.287 ]: Unexpected error in mod_passenger: Cannot spawn application '/home/cp_rails3/sites/rails3.codepremise.com': The spawn server has exited unexpectedly. Backtrace: in 'virtual boost::shared_ptr<Passenger::Application::Session> Passenger::ApplicationPoolServer::Client::get(const Passenger::PoolOptions&)' (ApplicationPoolServer.h:471) in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:523) It runs fine in console (app.get "url") and also ok with "rails server". What's wrong? Thanks. Sam

    Read the article

  • TinyMCE Editor acts weird on IE

    - by Sam Kong
    Hi, I use TinyMCE and it works fine on FireFox but it shows weird icons on IE 8.0. As you can see, forecolor and backcolor icons are repeated. This doesn't happen on FF. Has anybody seen this? How do I fix this? Sam

    Read the article

  • Remove first 'n' elements from list without itterating

    - by Eldhose M Babu
    I need an efficient way of removing items from list. If some condition happens, I need to remove first 'n' elements from a list. Can some one suggest the best way to do this? Please keep in mind: performance is a factor for me, so I need a faster way than itterating. Thanks. I'm thinking of a way through which the 'n'th item can be made as the starting of the list so that the 0-n items will get garbage collected. Is it possible?

    Read the article

  • How do I refresh TinyMCE for the code that I add with JavaScript

    - by Sam Kong
    Hi, I need to insert code for flash to TinyMCE with JavaScript. If I insert the same code using HTML menu of TinyMCE, it automatically add flash icon to the editor. But if I insert the code using JavaScript, the actual code is inserted but it shows nothing on the screen. One trick I found is toggle TinyMCE to normal textarea and back to TinyMCE. Then, it shows the flash icon. Is there a better way to do that? Thanks. Sam

    Read the article

  • Anybody know why the Output of this program is like this?(using iterator in c#)

    - by Babu
    using System; using System.Collections; namespace Iterator_test { class Day { int days_idx = -1; private String[] days = { "mon", "tue", "wed","thu","fri","sat","sun" }; public IEnumerable getdays() { days_idx++; yield return days[days_idx]; } } class Program { static void Main(string[] args) { Day d = new Day(); foreach (string day in d.getdays()) { Console.WriteLine(day); } } } } Actually the output should be, mon tue wed thu fri sat sun but its printing only "mon" as, mon What will be the reason?

    Read the article

  • Search and replace with sed

    - by Binoy Babu
    Last week I accidently externalized all my strings of my eclipse project. I need to revert this and my only hope is sed. I tried to create scripts but failed pathetically because I'm new with sed and this would be a very complicated operation. What I need to do is this: Strings in class.java file is currently in the following format(method) Messages.getString(<key>). Example : if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.89") + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.90") + i; //$NON-NLS-1$ break; } } } The key and matching Strings are in messages.properties file in the following format. VSDataSource.92=No of rows in db = VSDataSource.93=Verifying db entry : VSDataSource.94=DB is open VSDataSource.95=DB is closed VSDataSource.96=Invalid db entry for VSDataSource.97=\ removed. So I need the java file back in this format: if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + "String 2" + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + "String 1" + i; //$NON-NLS-1$ break; } } } How can I accomplish this with sed? Or is there an easier way?

    Read the article

  • Has anybody developed an auto part ecommerce site?

    - by Sam Kong
    Hi, I need to develop an e-Commerce site that sells auto parts. For that, I need a database that has year/make/model information that each part is applicable to. As far as I know, we need to purchase the database and subscribe updates. Is there any database available for free? (I may not need updates) Thanks. Sam

    Read the article

  • Where will this AsyncTask run?

    - by Binoy Babu
    Say I have this code in the AlertDialog.Builder(context) of my application. The question is in which Thread will it run? final Thread myPrettyOperation = new Thread() { @Override public void run() { //Do some really long operation. } }; class MyPrettyTask extends AsyncTask<Void, Integer, Boolean> { protected Boolean doInBackground( Void... voids) { myPrettyOperation.start(); return true; } protected void onProgressUpdate( Integer... progress) { } protected void onPostExecute(Boolean result) { } } new MyPrettyTask().execute();

    Read the article

  • How to tell a method has a varargs argument using reflection?

    - by Anthony Kong
    Here is a sample code package org.example; import java.lang.reflect.Method; class TestRef { public void testA(String ... a) { for (String i : a) { System.out.println(i); } } public static void main(String[] args){ Class testRefClass = TestRef.class; for (Method m: testRefClass.getMethods()) { if (m.getName() == "testA") { System.out.println(m); } } } } The output is public void org.example.TestRef.testA(java.lang.String[]) So the signature of the method is reported to take a array of String. Is there any mean in the reflection library I can tell that the method is originally declared to take a varargs?

    Read the article

  • how to work with javascript typed arrays without using for

    - by ramesh babu
    var sendBuffer = new ArrayBuffer(4096); var dv = new DataView(sendBuffer); dv.setInt32(0, 1234); var service = svcName; for (var i = 0; i < service.length; i++) { dv.setUint8(i + 4, service.charCodeAt(i)); } ws.send(sendBuffer); how to workout this wihout using for loop. for loop decreasing performance while works with huge amount of data.

    Read the article

  • System.Threading.Timer Doesn't Trigger my TimerCallBack Delegate

    - by Tom Kong
    Hi, I am writing my first Windows Service using C# and I am having some trouble with my Timer class. When the service is started, it runs as expected but the code will not execute again (I want it to run every minute) Please take a quick look at the attached source and let me know if you see any obvious mistakes! TIA using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess; using System.Text; using System.Threading; using System.IO; namespace CXO001 { public partial class Service1 : ServiceBase { public Service1() { InitializeComponent(); } /* * Aim: To calculate and update the Occupancy values for the different Sites * * Method: Retrieve data every minute, updating a public value which can be polled */ protected override void OnStart(string[] args) { Daemon(); } public void Daemon() { TimerCallback tcb = new TimerCallback(On_Tick); TimeSpan duetime = new TimeSpan(0, 0, 1); TimeSpan interval = new TimeSpan(0, 1, 0); Timer querytimer = new Timer(tcb, null, duetime, interval); } protected override void OnStop() { } static int[] floorplanids = new int[] { 115, 114, 107, 108 }; public static List<Record> Records = new List<Record>(); static bool firstrun = true; public static void On_Tick(object timercallback) { //Update occupancy data for the last minute //Save a copy of the public values to HDD with a timestamp string starttime; if (Records.Count > 0) { starttime = Records.Last().TS; firstrun = false; } else { starttime = DateTime.Today.AddHours(7).ToString(); firstrun = true; } DateTime endtime = DateTime.Now; GetData(starttime, endtime); } public static void GetData(string starttime, DateTime endtime) { string connstr = "Data Source = 192.168.1.123; Initial Catalog = Brickstream_OPS; User Id = Brickstream; Password = bstas;"; DataSet resultds = new DataSet(); //Get the occupancy for each Zone foreach (int zone in floorplanids) { SQL s = new SQL(); string querystr = "SELECT SUM(DIRECTIONAL_METRIC.NUM_TO_ENTER - DIRECTIONAL_METRIC.NUM_TO_EXIT) AS 'Occupancy' FROM REPORT_OBJECT INNER JOIN REPORT_OBJ_METRIC ON REPORT_OBJECT.REPORT_OBJ_ID = REPORT_OBJ_METRIC.REPORT_OBJECT_ID INNER JOIN DIRECTIONAL_METRIC ON REPORT_OBJ_METRIC.REP_OBJ_METRIC_ID = DIRECTIONAL_METRIC.REP_OBJ_METRIC_ID WHERE (REPORT_OBJ_METRIC.M_START_TIME BETWEEN '" + starttime + "' AND '" + endtime.ToString() + "') AND (REPORT_OBJECT.FLOORPLAN_ID = '" + zone + "');"; resultds = s.Go(querystr, connstr, zone.ToString(), resultds); } List<Record> result = new List<Record>(); int c = 0; foreach (DataTable dt in resultds.Tables) { Record r = new Record(); r.TS = DateTime.Now.ToString(); r.Zone = dt.TableName; if (!firstrun) { r.Occupancy = (dt.Rows[0].Field<int>("Occupancy")) + (Records[c].Occupancy); } else { r.Occupancy = dt.Rows[0].Field<int>("Occupancy"); } result.Add(r); c++; } Records = result; MrWriter(); } public static void MrWriter() { StringBuilder output = new StringBuilder("Time,Zone,Occupancy\n"); foreach (Record r in Records) { output.Append(r.TS); output.Append(","); output.Append(r.Zone); output.Append(","); output.Append(r.Occupancy.ToString()); output.Append("\n"); } output.Append(firstrun.ToString()); output.Append(DateTime.Now.ToFileTime()); string filePath = @"C:\temp\CXO.csv"; File.WriteAllText(filePath, output.ToString()); } } }

    Read the article

  • How I can use the HTTP headers to indicate in the Response that possibility?

    - by Cris Hong Kong CRISHK
    Finally I accomplished to cache dynamic images, css, and javascript files using HTTP headers BUT I have a problem now: I have specific dynamic images that are equal but has different URL's. For example: http://example.com/image/src/the-same-image.jpg http://example.com/image/custom/src/the-same-image2.jpg 1 and 2 has the same file content but different URL. This is a problem now because the navigator assumes that the file are different and need to be cached (due to the URL), when the real cached file is only one. I have the possibility to know if the file at the URL's are the same. How I can use the headers to indicate in the Response that possibility, and the navigator will cache only one file?

    Read the article

  • iOS: how to understand the role of rootviewcontroller and its relationship with other objects

    - by Anthony Kong
    I have created a UISplitViewController based iOS app in XCode 3.2.5 Below is a screen shot of Interface builder showing the rootviewcontroller and how it is linked to other objects. Being a beginner myself, I do not understand: 1) What is the role of the rootviewcontroller? Searched the documentation but what I found did not answer this question. 2) I thought a IBOutlet should only link to one corresponding object. Why in this case the rootviewcontroller is linked to two?

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >