Search Results

Search found 141 results on 6 pages for 'n sai harish'.

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

  • Get top 2 rows from each unique field in a column

    - by Sai
    I have a table named tblItemResources in which I want to get the only 2 rows from each unique field in a column named effectiveDate (order by: ascending): tblItemResources Table |   empID   |   effectiveDate    |    Company   |    Description |   0-123    |    2014-01-23     |   DFD Comp  |   Analyst |   0-234    |    2014-01-23     |   ABC Comp   |  Manager |   0-222    |    2012-02-19     |   CDC Comp  |  Janitor |   0-213    |    2012-03-13     |   CBB Comp  |  Teller and so on. Any help would be much appreciated.

    Read the article

  • how to play the 30 seconds sample itunes music

    - by sai
    I'm trying to figure out if its possible for programmers to build an itunes client app for iphone or android where the user has the option to browse and listen to the song preview, something similar to this page: itunes link maker I greatly appreciate any pointers or links in this direction thanks

    Read the article

  • location getting some times and sometimes not

    - by Chaitanya Sai
    // in this i'm getting location sometimes and sometimes location is not retrieving i had turned gps and gprs on and added permissions required . i'm bot getting what actually the problem is package com.example.addr; import java.util.List; import java.util.Locale; import android.location.Address; import android.location.Criteria; import android.location.Geocoder; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.app.Activity; import android.content.Context; import android.view.Menu; import android.widget.TextView; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); LocationManager locationManager; String context = Context.LOCATION_SERVICE; locationManager = (LocationManager)getSystemService(context); Criteria crta = new Criteria(); crta.setAccuracy(Criteria.ACCURACY_FINE); crta.setAltitudeRequired(false); crta.setBearingRequired(false); crta.setCostAllowed(true); crta.setPowerRequirement(Criteria.POWER_LOW); String provider = locationManager.getBestProvider(crta, true); // String provider = LocationManager.GPS_PROVIDER; Location location = locationManager.getLastKnownLocation(provider); updateWithNewLocation(location); locationManager.requestLocationUpdates(provider, 2000, 10, locationListener); } private final LocationListener locationListener = new LocationListener() { @Override public void onLocationChanged(Location location) { updateWithNewLocation(location); } @Override public void onProviderDisabled(String provider) { updateWithNewLocation(null); } @Override public void onProviderEnabled(String provider) { } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } }; private void updateWithNewLocation(Location location) { String latLong; TextView myLocation; myLocation = (TextView) findViewById(R.id.myLocation); String addressString = "Sorry No Address Found"; if(location!=null) { double lat = location.getLatitude(); double lon = location.getLongitude(); latLong = "Lat:" + lat + "\nLong:" + lon; double lattitude = location.getLatitude(); double longitude = location.getLongitude(); Geocoder gc = new Geocoder(this,Locale.getDefault()); try { List<Address> addresses= gc.getFromLocation(lattitude, longitude, 1); StringBuilder sb = new StringBuilder(); if(addresses.size()>0) { Address address=addresses.get(0); for(int i=0;i<address.getMaxAddressLineIndex();i++) sb.append(address.getAddressLine(i)).append("\n"); sb.append(address.getLocality()).append("\n"); sb.append(address.getPostalCode()).append("\n"); sb.append(address.getCountryName()); } addressString = sb.toString(); } catch (Exception e) { } } else { latLong = " NO Location Found "; } myLocation.setText("Current Position is :\n"+ latLong + "\n"+ addressString ); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } }

    Read the article

  • Window resolution handling without javascript

    - by Sai Sasdhar
    Is there any CSS property to deal window resolution. I created a HTML page taking total resolution width as 1424px.When I open it on different resolution I see a scroll bar & resolution of HTML does not adjust automatically. I don't want the scrollbar to be seen in maximized size of the page. Is it possible without using javascript.At the same time how to increase the resolution when itself is created in lower res.

    Read the article

  • Adding a child node to a JSON node dynamically

    - by Sai
    I have to create a nested multi level json depending on the resultset that I get from MYSQL. I created a json object initially. Now I want to add child nodes to the already child nodes in the object. d = collections.OrderedDict() jsonobj = {"test": dict(updated_at="today", ID="ID", ads=[])} for rows1 in rs: jsonobj['list']["ads"].append(dict(unit = "1", type ="ad_type", id ="123", updated_at="today", x_id="111", x_name="test")) cur.execute("SELECT * from f_test") rs1 = cur.fetchall() for rows2 in rs1: propertiesObj = [] d["name"]="propName" d["type"]="TypeName" d["value"]="Value1" propertiesObj.append(d) jsonobj['play_list']["ads"].append() Here in the above line I want to add another child node to [play_list].[ads] which is a array list again. the output should look like the following [list].[ads].[preferences].

    Read the article

  • Unknown Column 'template' in where clause, while using a stored procedure.

    - by sai
    Hello, I have a stored procedure, which has got executed without any errors, but gives me an error "#1054: Unknown column 'templateName' in where clause" when I run it. The stored procedure is delimiter // DROP PROCEDURE getData// CREATE DEFINER=root@localhost PROCEDURE getData(IN templateName VARCHAR(45),IN templateVersion VARCHAR(45),IN userId VARCHAR(45)) BEGIN set @version = CONCAT("SELECT 'saveOEMsData_answersVersion' FROM saveOEMsData where 'saveOEMsData_templateName' = ",templateName," and 'saveOEMsData_templateVersion' = ",templateVersion," and 'saveOEMsData_userId'= ",userId); PREPARE s1 from @version; EXECUTE S1; END // delimiter ; Now I call it using "call getData('templateName','1','285');". And whenever I call it, I get the mentioned error. What could the problem be?? It surely is syntactical, I have been reading the mysql manuals for 2 days and have come out without!! Any help would be great!! Thanks

    Read the article

  • Building TimeZone object in Java

    - by Harish
    I build a Java TimeZone object using the TimeZone String like GMT-8,GMT,PST,EST etc. This did not consider whether the timezone is daylight saving enabled or not.Now there is a requirement to include this check and instead of giving the input as PDT or EDT the daylight saving is given as a seperate flag.I am not sure whether TimeZone has a direct method to change the dayLight saving property of that TimeZone. So if I get an input like PST and DaylightSaving as true then I have to change the string as PDT.Whats even worse is sometimes I will get inputs like GMT-8 or GMT-6 with Day light flag as either true or false. Is there a way out ? I can't use thirdparty TimeZone related classes Code Sample: TimeZone timeZone = TimeZone.getTimeZone("EST"); TimeZone timeZone = TimeZone.getTimeZone("PST"); TimeZone timeZone = TimeZone.getTimeZone("GMT-8");

    Read the article

  • Merging column headers alone in JTable

    - by Harish
    Is there a way to merge column headers on click of a button but the values in the cell should get appeneded with each other? For instance: 10 15 20 25 30 A B C D E B C D A E 10 20 30 AB CD E BC DA E Actually the value A represents 10-15 B represents 15-20 and so on.Is this possible in JTable? Please don't confuse my earlier question with this.Here we try to merge two column headers not cells at the same time we append the values of the cell.

    Read the article

  • jQuery ajax callback function not working

    - by Harish Kurup
    I am using Symfony PHP Framework to create web application, and using symfony Forms to create the HTML forms. I am trying to load the data in Select element using Ajax, for that i am using jQuery's Ajax functions. It is working fine as it sends and gets the response correctly(status as 200), but not calling the Callback function in some browsers such as IE,Chrome and Safari.It works fine in Firefox and Opera. the Code that is not working, $.ajax({ type: 'POST', url: 'form/ajax', async: true, cache: false, dataType : 'json', data: 'id='+ids, success: function(jsonData){ alert("ok go"); } }); the alert "OK Go" is not called in Chrome,IE and Safari But $.ajax({ type: 'POST', url: 'form/ajax', async: true, cache: false, dataType : 'json', data: 'id='+ids, success: alert("ok go"); }); this works, but as per the project i want the JSON data to load in my Select element. is there any thing wrong in the return JSON format or the bug in the jQuery Ajax functions, please help.

    Read the article

  • Excel Macro to create sheets

    - by Harish
    I have a Excel sheet with two columns and I need to create new sheets based on the values of the first column.ie A B test1 Value21 test1 Values22 test2 Value21 test2 Value32 test3 Values32 IN this case I need to create three sheets namely test1,test2 and test3 Sheet 1 should contain test1 field and its corresponding values.Similarly sheet 2 and 3 should contain corresponding values. Can anyone help me in writing an Excel Macro for this

    Read the article

  • How to get a particular part of a String

    - by Harish
    I am writing a macro in Excel where I need to get a substring from a String. Its like this. ~/tester/test/hai/bye ~/stack/overflow/hai/bye In the above cases I need to take the String tester from the first one and stack from the second one.I tried using the Instr but its not useful.Can anyone help this?

    Read the article

  • Excel Macro to concatenate

    - by Harish
    Need help in creating an Excel Macro.I have an Excel sheet.The Excel sheet is not consistent. I am planning to make it uniform and structured. Eg. A B C D 1 test tester tester 2 hai test 3 Bye test tested 4 GN test tested Fine A B C D 1 test testertester 2 hai test 3 Bye testtested 4 GN testtestedFine Basically I have to find the last cell where element is placed so based on that I can write my CONCATENATE funciton. In this case it would be Column D and hence my concatenate function would have been =CONCATENATE(B1,C1,D1) Again I would like the result to be in B1 but not a problem if I have to hide. Can anyone help me in doing this?

    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

  • UNIX script to convert queries

    - by Harish
    I need a UNIX shell script to convert my queries from Java compatible to Oracle compatible format. ie. I have all the java compatible queries: java: SELECT a, b, c, d, e, f,g "+// "from test where year(timestamp)=year(today) and month(timestamp)=month(today) " +// "and day(timestamp)=2 and h='" + "W" + "'" Oracle SELECT a, b, c,d,e,f,g from test where year(timestamp)=year(today) and month(timestamp)=month(today) and day(timestamp)=2 and h='W' Is it possible using sed or awk?

    Read the article

  • Merging columns in a JTable

    - by Harish
    I am working in JTable and I have a requirement like this. Say There are 4 columns namely 10,20,30,40 Now the value usually comes like 10-20 20-30 and 30-40 So it was easy for us to display the name for this range. But recently the values have started to come randomly like 15-25 10-25,25-30 In this case our JTable should dynamically adjust the size of the row such that it represents that range only meaning it should not disturb the existing cells and only rows which diverge from the normal range. TO be more precise I should be able to merge and split cells based on the content of the cell.

    Read the article

  • JDBC query to Oracle

    - by Harish
    Hi, We are planning to migrate our DB to Oracle.We need to manually check each of the embedded SQL is working in Oracle as few may follow different SQL rules.Now my need is very simple. I need to browse through a file which may contain queries like this. String sql = "select * from test where name="+test+"and age="+age; There are nearly 1000 files and each file has different kind of queries like this where I have to pluck the query alone which I have done through an unix script.But I need to convert these Java based queries to Oracle compatible queries. ie. select * from test where name="name" and age="age" Basically I need to check the syntax of the queries by this.I have seen something like this in TOAD but I have more than 1000 files and can't manually change each one.Is there a way? I will explain more i the question is not clear

    Read the article

  • MIgrating to Oracle

    - by Harish
    We are using a JEE application and we are right now using Informix DB.Our code hits the DB with queries like "select first 10 * from test" Now as far as I know Oracle does not support 'first 10 *' kind of statements.We have more than 1000 queries like this.Should we manually change this or can have some manual customization?

    Read the article

  • To Create a Search, with values from multiple selection element?

    - by Harish
    I am working in PHP(with Symfony Framework) and i want to create a search based on multiple values selected from multiple selection element, i.e there will be multiple selection dropdown elements for like countries, cities, age etc.. and the values from them will query a data table and give the desired search output. (all values are not mandatory, will work with atleast one value). the idea will also do..

    Read the article

  • MouseMotionListener inside JTable

    - by Harish
    I am trying to add MouseMotion event to the label and move it based on the dragging of the mouse and make it move along with my mouse.However the mousemotion is very difficult to control making this action not usable. Here is the code import java.awt.Color; import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; public class TableTest { public TableTest() { String[] columnNames = { "FileName", "Integer" }; Object[][] data = { { new FileName("AAA.jpg", Color.YELLOW), new Integer(2) }, { new FileName("BBB.png", Color.GREEN), new FileName("BBB.png", Color.GREEN) }, { new FileName("CCC.jpg", Color.RED), new Integer(-1) }, }; DefaultTableModel model = new DefaultTableModel(data, columnNames) { public Class getColumnClass(int column) { System.out.println("column is" + column); return getValueAt(0, column).getClass(); } }; JTable table = new JTable(model); //JTable table = new JTable(data, columnNames); table.setDefaultRenderer(FileName.class, new FileNameCellRenderer()); final JLabel label = new JLabel("TESTING", SwingConstants.CENTER); label.setBackground(java.awt.Color.RED); label.setBounds(450, 100, 90, 20); label.setOpaque(true); label.setVisible(true); label.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent arg0) { label.setBounds(arg0.getX(), arg0.getY(), 90, 20); } public void mouseMoved(MouseEvent arg0) { // TODO Auto-generated method stub } }); table.add(label); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(table); frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); } static class FileNameCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object v, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, v, isSelected, hasFocus, row, column); FileName fn = (FileName) v; setBorder(BorderFactory.createMatteBorder(0, 60, 0, 0, new java.awt.Color(143, 188, 143))); return this; } } static class FileName { public final Color color; public final String label; FileName(String l, Color c) { this.label = l; this.color = c; } public String toString() { return label; } } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new TableTest(); } }); } } I just want to make the label follow the label follow my mouse and the label should be attached to the table.Is there an easy way than this.

    Read the article

  • Mouse event in Java

    - by Harish
    I am trying to move a JComponent say a label over a table.I am tracking this event using MouseMotionListener's mouseDragged method.This method perfectly helps me in tracking the item.Is there a way to track the mouse release after dragging is complete(.ie the dropping event). tktLabel1.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent arg0) { tktLabel1.setBounds(tktLabel1.getX() + arg0.getX(), tktLabel1.getY() + arg0.getY(), width, height); } public void mouseMoved(MouseEvent arg0) { } });

    Read the article

  • Shell script to process files

    - by Harish
    I need to write a Shell Script to process a huge folder of nearly 20 levels.I have to process each and every file and check which files contain lines like select insert update When I mean line it should take the line till I find a semicolon in that file. I should get a result like this C:/test.java select * from dual C:/test.java select * from test C:/test1.java select * from tester C:/test1.java select * from dual and so on.Right now I have a script to read all the files #!bin/ksh FILE=<FILEPATH to be traversed> TEMPFILE=<Location of Temp file> cd $FILE for f in `find . ! -type d`; do cat $FILE/addedText.txt>>$TEMPFILE/newFile.txt cat $f>>$TEMPFILE/newFile.txt rm $f cat $TEMPFILE/newFile.txt>>$f rm $TEMPFILE/newFile.txt done I have very little knowledge of awk and sed to proceed further in reading each file and achieve what I want to.Can anyone help me in this

    Read the article

  • Selecting Update queries alone from list of files using shell script

    - by Harish
    I am trying to get Update queries from a list of files using this script.I need to take lines containing "Update" alone and not "Updated" or "UpdateSQL"As we know all update queries contain set I am using that as well.But I need to remove cases like Updated and UpdatedSQL can anyone help? nawk -v file="$TEST" 'BEGIN{RS=";"} /[Uu][Pp][Dd][Aa][Tt][Ee] .*[sS][eE][tT]/{ gsub(/.*UPDATE/,"UPDATE");gsub(/.*Update/,"Update");gsub(/.*update/,"update");gsub(/\n+/,"");print file,"#",$0;} ' "$TEST" >> $OUT

    Read the article

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