Search Results

Search found 153 results on 7 pages for 'sachin shekhar'.

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

  • I am confused -- Will this code always work?

    - by Shekhar
    Hello, I have written this piece of code public class Test{ public static void main(String[] args) { List<Integer> list = new ArrayList<Integer>(); for(int i = 1;i<= 4;i++){ new Thread(new TestTask(i, list)).start(); } while(list.size() != 4){ // this while loop required so that all threads complete their work } System.out.println("List "+list); } } class TestTask implements Runnable{ private int sequence; private List<Integer> list; public TestTask(int sequence, List<Integer> list) { this.sequence = sequence; this.list = list; } @Override public void run() { list.add(sequence); } } This code works and prints all the four elements of list on my machine. My question is that will this code always work. I think there might be a issue in this code when two/or more threads add element to this list at the same point. In that case it while loop will never end and code will fail. Can anybody suggest a better way to do this? I am not very good at multithreading and don't know which concurrent collection i can use? Thanks Shekhar

    Read the article

  • You do not appear to be using the NVIDIA X driver

    - by Vishal shekhar
    my laptop has nvidia GT540m yesterday i install nvidia-current after updating fromsudo apt-add-repository ppa:ubuntu-x-swat/x-updates then i write sudo nvidia-xconfig and then reboot my desktop visual effect changes and it look good like nvidia is working but still glx i not working and nvidia-setting tells me that You do not appear to be using the NVIDIA X driver my dkms status is nvidia-current, 304.43, 3.2.0-30-generic-pae, i686: installed lspci |grep VGA output : 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev a1) also i can not login to my admin account but when i login to standard user or guest it works but still NVIDIA X driver is not working can any one suggest something so that NVIDIA X Driver start working as i seen many forum but none worked for me earlier i tried nvidia-173 ,nvidia-current(before x-swat/updates reprository) but none works for me

    Read the article

  • Why can't I change the AU_AU locale to en_US?

    - by sachin
    /bin/bash: warning: setlocale: LC_ALL: cannot change locale ( (unset)) Generating locales... en_US.ISO-8859-1... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done Generation complete. ganesha@ubuntu:~$ sudo update_locale LANG=en_US sudo: update_locale: command not found ganesha@ubuntu:~$ sudo update-locale LANG=en_US perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = " (unset)", LC_PAPER = "AU_AU.UTF-8", LC_ADDRESS = "AU_AU.UTF-8", LC_MONETARY = "AU_AU.UTF-8", LC_MEASUREMAUT = "AU_AU.UTF-8", LC_NUMERIC = "AU_AU.UTF-8", LC_TELEPHONE = "AU_AU.UTF-8", LC_MESSAGES = "AU_AU.UTF-8", LC_COLLATE = "AU_AU.UTF-8", LC_IDAUTIFICATION = "AU_AU.UTF-8", LC_CTYPE = "AU_AU.UTF-8", LC_TIME = "AU_AU.UTF-8", LC_NAME = "AU_AU.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). ganesha@ubuntu:~$ sudo update-locale LANG=en_US.UTF8 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = " (unset)", LC_PAPER = "AU_AU.UTF-8", LC_ADDRESS = "AU_AU.UTF-8", LC_MONETARY = "AU_AU.UTF-8", LC_MEASUREMAUT = "AU_AU.UTF-8", LC_NUMERIC = "AU_AU.UTF-8", LC_TELEPHONE = "AU_AU.UTF-8", LC_MESSAGES = "AU_AU.UTF-8", LC_COLLATE = "AU_AU.UTF-8", LC_IDAUTIFICATION = "AU_AU.UTF-8", LC_CTYPE = "AU_AU.UTF-8", LC_TIME = "AU_AU.UTF-8", LC_NAME = "AU_AU.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). ganesha@ubuntu:~$ gedit ~/.profile (process:6467): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. ganesha@ubuntu:~$ sudo update-locale LANG=en_US.UTF8 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = " (unset)", LC_PAPER = "AU_AU.UTF-8", LC_ADDRESS = "AU_AU.UTF-8", LC_MONETARY = "AU_AU.UTF-8", LC_MEASUREMAUT = "AU_AU.UTF-8", LC_NUMERIC = "AU_AU.UTF-8", LC_TELEPHONE = "AU_AU.UTF-8", LC_MESSAGES = "AU_AU.UTF-8", LC_COLLATE = "AU_AU.UTF-8", LC_IDAUTIFICATION = "AU_AU.UTF-8", LC_CTYPE = "AU_AU.UTF-8", LC_TIME = "AU_AU.UTF-8", LC_NAME = "AU_AU.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). ganesha@ubuntu:~$ sudo apt-get install --reinstall locales Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. Need to get 0 B/3359 kB of archives. After this operation, 0 B of additional disk space will be used. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = " (unset)", LC_TIME = "AU_AU.UTF-8", LC_MONETARY = "AU_AU.UTF-8", LC_CTYPE = "AU_AU.UTF-8", LC_COLLATE = "AU_AU.UTF-8", LC_ADDRESS = "AU_AU.UTF-8", LC_TELEPHONE = "AU_AU.UTF-8", LC_MESSAGES = "AU_AU.UTF-8", LC_NAME = "AU_AU.UTF-8", LC_MEASUREMAUT = "AU_AU.UTF-8", LC_IDAUTIFICATION = "AU_AU.UTF-8", LC_NUMERIC = "AU_AU.UTF-8", LC_PAPER = "AU_AU.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). (Reading database ... 157848 files and directories currently installed.) Preparing to replace locales 2.13+git20120306-3 (using .../locales_2.13+git20120306-3_all.deb) ... Unpacking replacement locales ... Processing triggers for man-db ... Setting up locales (2.13+git20120306-3) ... /bin/bash: warning: setlocale: LC_ALL: cannot change locale ( (unset)) Generating locales... en_AG.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_AU.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_BW.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_CA.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_DK.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_GB.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_HK.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_IE.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_IN.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_NG.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_NZ.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_PH.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_SG.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_US.ISO-8859-1... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_US.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_ZA.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_ZM.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done en_ZW.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale ( (unset)) done Generation complete. ganesha@ubuntu:~$ How to correct this?

    Read the article

  • Some problems after running ubuntu tweak application

    - by sachin
    I am a first time user of ubuntu 12.04 and must say that i am enjoying it. Somehow my skype on ubuntu is screwed up. The message that i am getting says (Disk IO error). Did any one face the problem before. Also i downloaded the ubuntu tweak application. After that application has clean some file, the application it self is not starting now.. I am quiet new to linux much and fear that if the tweak application has cleaned some files which were necessary. Is there anything i can fix these problems or short of auto-recovery, i have got some more leads: here seems to be the error but not sure how can i fix this. buntu-tweak:2887): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. Traceback (most recent call last): File "/usr/bin/ubuntu-tweak", line 122, in from ubuntutweak.main import UbuntuTweakWindow File "/usr/lib/python2.7/dist-packages/ubuntutweak/main.py", line 40, in from ubuntutweak.preferences import PreferencesDialog File "/usr/lib/python2.7/dist-packages/ubuntutweak/preferences.py", line 32, in from ubuntutweak.factory import WidgetFactory File "/usr/lib/python2.7/dist-packages/ubuntutweak/factory.py", line 24, in from ubuntutweak.gui.widgets import * File "/usr/lib/python2.7/dist-packages/ubuntutweak/gui/widgets.py", line 10, in from ubuntutweak.settings.compizsettings import CompizSetting File "/usr/lib/python2.7/dist-packages/ubuntutweak/settings/compizsettings.py", line 3, in import ccm File "/usr/lib/python2.7/dist-packages/ubuntutweak/settings/ccm/init.py", line 1, in from Conflicts import * File "/usr/lib/python2.7/dist-packages/ubuntutweak/settings/ccm/Conflicts.py", line 25, in from Constants import * File "/usr/lib/python2.7/dist-packages/ubuntutweak/settings/ccm/Constants.py", line 77, in locale.setlocale(locale.LC_ALL, "") File "/usr/lib/python2.7/locale.py", line 539, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

    Read the article

  • Will grub overwrite EasyBCD entry if I already have Windows 7 and Windows XP installed?

    - by Sachin
    Installing Ubuntu on EEE PC which already has Windows 7 and Windows XP in dual boot using Easy BCD I have an ASUS EEE PC 1015PEM with Windows 7 starter and Windows XP in dual boot configuration on separate partitions. Now I want to replace my Windows XP with Ubuntu 11. Earlier after installing XP on my system it failed to boot in Windows 7, which I restored easily using EasyBCD. If I install Ubuntu 11 will I be able to boot my Windows 7 also? Will grub overwrite the EasyBCD entry for XP?

    Read the article

  • Get 100 highest numbers from an infinite list

    - by Sachin Shanbhag
    One of my friend was asked this interview question - "There is a constant flow of numbers coming in from some infinite list of numbers out of which you need to maintain a datastructure as to return the top 100 highest numbers at any given point of time. Assume all the numbers are whole numbers only." This is simple, you need to keep a sorted list in descending order and keep a track on lowest number in that list. If new number obtained is greater than that lowest number then you have to remove that lowest number and insert the new number in sorted list as required. Then question was extended - "Can you make sure that the Order for insertion should be O(1)? Is it possible?" As far as I knew, even if you add a new number to list and sort it again using any sort algorithm, it would by best be O(logn) for quicksort (I think). So my friend told it was not possible. But he was not convinced, he asked to maintain any other data structure rather than a list. I thought of balanced Binary tree, but even there you will not get the insertion with order of 1. So the same question I have too now. Wanted to know if there is any such data structure which can do insertion in Order of 1 for above problem or it is not possible at all.

    Read the article

  • Multi user issue in Drupal 7

    - by sachin
    I am trying to create a web site in which there are different link for each user. Like if my site address is example.com and there are three users: u1,u2,u3... If any of them is logged in, then the site should redirect to example.com/u1 and if he create any link or block on this url, this link or block should not visible for remaining two links. Also all of them should have different admin pannel.

    Read the article

  • Questions related to writing your own file downloader using multiple threads java

    - by Shekhar
    Hello In my current company, i am doing a PoC on how we can write a file downloader utility. We have to use socket programming(TCP/IP) for downloading the files. One of the requirements of the client is that a file(which will be large in size) should be transfered in chunks for example if we have a file of 5Mb size then we can have 5 threads which transfer 1 Mb each. I have written a small application which downloads a file. You can download the eclipe project from http://www.fileflyer.com/view/QM1JSC0 A brief explanation of my classes FileSender.java This class provides the bytes of file. It has a method called sendBytesOfFile(long start,long end, long sequenceNo) which gives the number of bytes. import java.io.File; import java.io.IOException; import java.util.zip.CRC32; import org.apache.commons.io.FileUtils; public class FileSender { private static final String FILE_NAME = "C:\\shared\\test.pdf"; public ByteArrayWrapper sendBytesOfFile(long start,long end, long sequenceNo){ try { File file = new File(FILE_NAME); byte[] fileBytes = FileUtils.readFileToByteArray(file); System.out.println("Size of file is " +fileBytes.length); System.out.println(); System.out.println("Start "+start +" end "+end); byte[] bytes = getByteArray(fileBytes, start, end); ByteArrayWrapper wrapper = new ByteArrayWrapper(bytes, sequenceNo); return wrapper; } catch (IOException e) { throw new RuntimeException(e); } } private byte[] getByteArray(byte[] bytes, long start, long end){ long arrayLength = end-start; System.out.println("Start : "+start +" end : "+end + " Arraylength : "+arrayLength +" length of source array : "+bytes.length); byte[] arr = new byte[(int)arrayLength]; for(int i = (int)start, j =0; i < end;i++,j++){ arr[j] = bytes[i]; } return arr; } public static long fileSize(){ File file = new File(FILE_NAME); return file.length(); } } Second Class is FileReceiver.java - This class receives the file. Small Explanation what this file does This class finds the size of the file to be fetched from Sender Depending upon the size of the file it finds the start and end position till the bytes needs to be read. It starts n number of threads giving each thread start,end, sequence number and a list which all the threads share. Each thread reads the number of bytes and creates a ByteArrayWrapper. ByteArrayWrapper objects are added to the list Then i have while loop which basically make sure that all threads have done their work finally it sorts the list based on the sequence number. then the bytes are joined, and a complete byte array is formed which is converted to a file. Code of File Receiver package com.filedownloader; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.zip.CRC32; import org.apache.commons.io.FileUtils; public class FileReceiver { public static void main(String[] args) { FileReceiver receiver = new FileReceiver(); receiver.receiveFile(); } public void receiveFile(){ long startTime = System.currentTimeMillis(); long numberOfThreads = 10; long filesize = FileSender.fileSize(); System.out.println("File size received "+filesize); long start = filesize/numberOfThreads; List<ByteArrayWrapper> list = new ArrayList<ByteArrayWrapper>(); for(long threadCount =0; threadCount<numberOfThreads ;threadCount++){ FileDownloaderTask task = new FileDownloaderTask(threadCount*start,(threadCount+1)*start,threadCount,list); new Thread(task).start(); } while(list.size() != numberOfThreads){ // this is done so that all the threads should complete their work before processing further. //System.out.println("Waiting for threads to complete. List size "+list.size()); } if(list.size() == numberOfThreads){ System.out.println("All bytes received "+list); Collections.sort(list, new Comparator<ByteArrayWrapper>() { @Override public int compare(ByteArrayWrapper o1, ByteArrayWrapper o2) { long sequence1 = o1.getSequence(); long sequence2 = o2.getSequence(); if(sequence1 < sequence2){ return -1; }else if(sequence1 > sequence2){ return 1; } else{ return 0; } } }); byte[] totalBytes = list.get(0).getBytes(); byte[] firstArr = null; byte[] secondArr = null; for(int i = 1;i<list.size();i++){ firstArr = totalBytes; secondArr = list.get(i).getBytes(); totalBytes = concat(firstArr, secondArr); } System.out.println(totalBytes.length); convertToFile(totalBytes,"c:\\tmp\\test.pdf"); long endTime = System.currentTimeMillis(); System.out.println("Total time taken with "+numberOfThreads +" threads is "+(endTime-startTime)+" ms" ); } } private byte[] concat(byte[] A, byte[] B) { byte[] C= new byte[A.length+B.length]; System.arraycopy(A, 0, C, 0, A.length); System.arraycopy(B, 0, C, A.length, B.length); return C; } private void convertToFile(byte[] totalBytes,String name) { try { FileUtils.writeByteArrayToFile(new File(name), totalBytes); } catch (IOException e) { throw new RuntimeException(e); } } } Code of ByteArrayWrapper package com.filedownloader; import java.io.Serializable; public class ByteArrayWrapper implements Serializable{ private static final long serialVersionUID = 3499562855188457886L; private byte[] bytes; private long sequence; public ByteArrayWrapper(byte[] bytes, long sequenceNo) { this.bytes = bytes; this.sequence = sequenceNo; } public byte[] getBytes() { return bytes; } public long getSequence() { return sequence; } } Code of FileDownloaderTask import java.util.List; public class FileDownloaderTask implements Runnable { private List<ByteArrayWrapper> list; private long start; private long end; private long sequenceNo; public FileDownloaderTask(long start,long end,long sequenceNo,List<ByteArrayWrapper> list) { this.list = list; this.start = start; this.end = end; this.sequenceNo = sequenceNo; } @Override public void run() { ByteArrayWrapper wrapper = new FileSender().sendBytesOfFile(start, end, sequenceNo); list.add(wrapper); } } Questions related to this code 1) Does file downloading becomes fast when multiple threads is used? In this code i am not able to see the benefit. 2) How should i decide how many threads should i create ? 3) Are their any opensource libraries which does that 4) The file which file receiver receives is valid and not corrupted but checksum (i used FileUtils of common-io) does not match. Whats the problem? 5) This code gives out of memory when used with large file(above 100 Mb) i.e. because byte array which is created. How can i avoid? I know this is a very bad code but i have to write this in one day -:). Please suggest any other good way to do this? Thanks Shekhar

    Read the article

  • Vitality of Product Information Management Showcased at OpenWorld 2012

    - by Mala Narasimharajan
     By Sachin Patel Can you hear the countdown clock ticking!! OpenWorld 2012 is almost here and as I write this Oracle is buzzing with fresh new ideas and solutions that will be showcased this year. What an exciting time for all of us to be in midst of a digital revolution. Whether it is Apple fans clamoring to find every new feature that has been added to the iPhone 5 or a startup launching a new digital thermostat (has anyone looked at the new one from Nest ), product information is a vital for companies to grow and compete in this cut-throat market. Customer today struggle to aggregate and enrich this product data from the myriad of systems they have in place to run their businesses and operations. Having a product information strategy is paramount to align your sales channels and operations with the most accurate and upto date product data. We have a number of sessions this year at OpenWorld where you can gain more insight into how Oracle’s next generation of Fusion Applications, in this case Fusion Product Hub can provide you with a solution to streamline and get control of your Product Master Data. Enabling Trusted Enterprise Product Data with Oracle Fusion Product HubTuesday, October 2nd 11:45 am, Moscone West 2022 Join me Sachin Patel, Director of Product Strategy and Milan Bhatia, VP of Development as we discuss how you can enable trusted product master data in your enterprise. In this session we plan to cover the challenges companies face today in mastering product data. The discussion will also include how Fusion Product Hub brings new and innovative features to empower your product data owners to create a holistic and rich product definition that can be leveraged across your enterprise. We will also be joined by Pawel Fidelus from Fideltronik an Early Adopter for Fusion Product Hub who will showcase their plans to implement Fusion Product Hub and the value it will bring to Fideltronik Multichannel Fulfillment Excellence in Direct-to-Consumer Market Thursday, October 4th, 12:45 am, Moscone West 2024 Do you have multiple order capture systems? Do you have difficulty in fulfilling orders for your customers across various channels and suppliers? Mark Carson, Director, Fusion DOO and Brad Kerr, Director, AGSS will be showcasing the Fusion Distributed Order Orchestration solution and how companies can orchestrate orders from multiple order capture systems and route them to the appropriate fulfillment system. Sachin Patel, Director Product Strategy for Product MDM will highlight the business pain points in consolidating and commercializing data from a Multi Channel Commerce point of view and how Fusion Product Hub helps in allowing you to provide a single source of truth to drive a singular and rich customer experience. Oracle Fusion Supply Chain Management: Customer Adoption and Experiences                                                Wednesday, October 3rd 10:15 am, Moscone West 2003 This is a great session to attend to learn about how Fusion Supply Chain Management and Fusion Product Hub Early Adopters, including Boeing and Fideltronik are leveraging Fusion Applications to improve their Supply Chain operations. Have a great OpenWorld and see you soon!!

    Read the article

  • How to detect a background program (in Windows 7) which takes active focus automatically?

    - by Sachin Shekhar
    A background process/program steals focus from my currently active application. It disturbs me a lot when I type in an app or control an app using keyboard or play online flash games in full-screen. I want to remove this program from my PC, but I'm unable to detect it. I've analyzed all processes & scanned for viruses. All things are right from this side. I don't want to change focus behavior using registry tweak. Please, help me detecting that app..

    Read the article

  • Add folder name to beginning of filename

    - by shekhar
    I have a directory structure as below: Folder > SubFolder1 > FileName1.abc > Filename2.abc > ............. > SubFolder2 > FileName11.abc > Filename12.abc > .............. > .......... etc. I want to rename the files inside the subfolders as: SubFolder1_Filename1.abc SubFolder1_Filename2.abc SubFolder2_Filename11.abc SubFolder2_Filename12.abc i.e. add the folder name at the beginning of the file name with the delimiter "_". The directory structure should remain unchanged. Note: Beginning of file name is same. e.g. in above case File*. I made below Script for /r "PATH" %%G in (.) do ( pushd %%G for %%* in (.) do set MyDir=%%~n* FOR %%v IN (File*.*) DO REN %%v "%MyDir%_%%v" popd ) Problem with the above script is that it is taking only one Subfolder name and placing it to the beginning of file name irrespective of the folder.

    Read the article

  • Directory and Sub Directory listing

    - by shekhar
    I am trying to list the directory name (only name, not full path) and sub directories (only name, not full path) inside it. There is only one level of sub directories. I used below script to do this: @echo off&setlocal enableextensions for /r "PATH" %%G in (.) do ( Pushd %%G for %%* in (.) do set MyDir=%%~n* echo %MyDir% popd ) endlocal&goto :eof The problem with the above script is that it is showing root directory with the full path. How can I just make it show the directories in relation to the one I am working in?

    Read the article

  • let mysql use full resources

    - by shekhar
    We have a Windows server 2008 R2. It has 24GB RAM and 2.926 Mhz, 8 Core(s), 8 Logical Process. We have a large MySQL database and it's taking a lot of time to execute some queries. But while running queries, I have observed it's NOT utilizing full resources. I am thinking that if I let MySQL utilize maximum resources on my server, it can reduce execution time. How can I let my MySQL server utilize maximum resources in a healthy way?

    Read the article

  • Find and Replace String in filenames

    - by shekhar
    I have thousands of files with no specific extensions. What I need to do is to search for a sting in filename and replace with other string and further search for second string and replace with any other string and so on. I.e.: I have multiple strings to replace with other multiple strings. It may be like: "abc" in filename replaced with "def" * String "abc" may be in many files "jkl" in filename replaced with "srt" * String "jkl" may be in many files "pqr" in filename replaced with "xyz" * String "pqr" may be in many files I am currently using excel macro to get the file names in excel and then preserving original names in one column and replacing desired in the content copied in other column. then I create a batch file for the same. Like: rename Path\OriginalName1 NewName1 rename Path\OriginalName2 NewName2 Problem with the above procedure is that it takes a lot of time as the files are many. And As I am using excel 2003 there is limitation on number of rows as well. I need a script in batch like: replacestr abc with def replacestr pqr with xyz in a single directory. Will it be better to do in unix script?

    Read the article

  • Oracle MDM at the MDM Summit in San Francisco

    - by David Butler
    Oracle is sponsoring the Product MDM track at this year’s MDM & Data Governance San Francisco Summit. Sachin Patel, Director of Product Strategy, Product Hub Applications, at Oracle will present the keynote: Product Master Data Management for Today’s Enterprise. Here’s the abstract: Today businesses struggle to boost operational efficiency and meet new product launch deadlines due to poor and cumbersome administrative processes. One of the primary reasons enterprises are unable to achieve cohesion is due to various domain silos and fragmented product data. This adversely affects business performance including, but not limited to, excess inventories, under-leveraged procurement spend, downstream invoicing or order errors and lost sales opportunities. In this session, you will learn the key elements and business processes that are required for you to master an enterprise product record. Additionally you will gain insights into how to improve the accuracy of your data and deliver reliable and consistent product information across your enterprise. This provides a high level of confidence that business managers can achieve their goals. In this session, you will understand how adopting a Master Data Management strategy for product information can help your enterprise change course towards a more profitable, competitive and successful business. Cisco Systems will join Sachin and cover their experiences, lessons learned and best practices. If you are in the Bay Area and interested in mastering your product data for the benefit of multiple applications, business processes and analytical systems, please join us at the Hyatt, Fisherman’s Wharf this Thursday, June 30th.

    Read the article

  • Exporting a non public Type through public API

    - by sachin
    I am trying to follow Trees tutorial at: http://cslibrary.stanford.edu/110/BinaryTrees.html Here is the code I have written so far: package trees.bst; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; /** * * @author sachin */ public class BinarySearchTree { Node root = null; class Node { Node left = null; Node right = null; int data = 0; public Node(int data) { this.left = null; this.right = null; this.data = data; } } public void insert(int data) { root = insert(data, root); } public boolean lookup(int data) { return lookup(data, root); } public void buildTree(int numNodes) { for (int i = 0; i < numNodes; i++) { int num = (int) (Math.random() * 10); System.out.println("Inserting number:" + num); insert(num); } } public int size() { return size(root); } public int maxDepth() { return maxDepth(root); } public int minValue() { return minValue(root); } public int maxValue() { return maxValue(root); } public void printTree() { //inorder traversal System.out.println("inorder traversal:"); printTree(root); System.out.println("\n--------------"); } public void printPostorder() { //inorder traversal System.out.println("printPostorder traversal:"); printPostorder(root); System.out.println("\n--------------"); } public int buildTreeFromOutputString(String op) { root = null; int i = 0; StringTokenizer st = new StringTokenizer(op); while (st.hasMoreTokens()) { String stNum = st.nextToken(); int num = Integer.parseInt(stNum); System.out.println("buildTreeFromOutputString: Inserting number:" + num); insert(num); i++; } return i; } public boolean hasPathSum(int pathsum) { return hasPathSum(pathsum, root); } public void mirror() { mirror(root); } public void doubleTree() { doubleTree(root); } public boolean sameTree(BinarySearchTree bst) { //is this tree same as another given tree? return sameTree(this.root, bst.getRoot()); } public void printPaths() { if (root == null) { System.out.println("print path sum: tree is empty"); } List pathSoFar = new ArrayList(); printPaths(root, pathSoFar); } ///-------------------------------------------Public helper functions public Node getRoot() { return root; } //Exporting a non public Type through public API ///-------------------------------------------Helper Functions private boolean isLeaf(Node node) { if (node == null) { return false; } if (node.left == null && node.right == null) { return true; } return false; } ///----------------------------------------------------------- private boolean sameTree(Node n1, Node n2) { if ((n1 == null && n2 == null)) { return true; } else { if ((n1 == null || n2 == null)) { return false; } else { if ((n1.data == n2.data)) { return (sameTree(n1.left, n2.left) && sameTree(n1.right, n2.right)); } } } return false; } private void doubleTree(Node node) { //create a copy //bypass the copy to continue looping if (node == null) { return; } Node copyNode = new Node(node.data); Node temp = node.left; node.left = copyNode; copyNode.left = temp; doubleTree(copyNode.left); doubleTree(node.right); } private void mirror(Node node) { if (node == null) { return; } Node temp = node.left; node.left = node.right; node.right = temp; mirror(node.left); mirror(node.right); } private void printPaths(Node node, List pathSoFar) { if (node == null) { return; } pathSoFar.add(node.data); if (isLeaf(node)) { System.out.println("path in tree:" + pathSoFar); pathSoFar.remove(pathSoFar.lastIndexOf(node.data)); //only the current node, a node.data may be duplicated return; } else { printPaths(node.left, pathSoFar); printPaths(node.right, pathSoFar); } } private boolean hasPathSum(int pathsum, Node node) { if (node == null) { return false; } int val = pathsum - node.data; boolean ret = false; if (val == 0 && isLeaf(node)) { ret = true; } else if (val == 0 && !isLeaf(node)) { ret = false; } else if (val != 0 && isLeaf(node)) { ret = false; } else if (val != 0 && !isLeaf(node)) { //recurse further ret = hasPathSum(val, node.left) || hasPathSum(val, node.right); } return ret; } private void printPostorder(Node node) { //inorder traversal if (node == null) { return; } printPostorder(node.left); printPostorder(node.right); System.out.print(" " + node.data); } private void printTree(Node node) { //inorder traversal if (node == null) { return; } printTree(node.left); System.out.print(" " + node.data); printTree(node.right); } private int minValue(Node node) { if (node == null) { //error case: this is not supported return -1; } if (node.left == null) { return node.data; } else { return minValue(node.left); } } private int maxValue(Node node) { if (node == null) { //error case: this is not supported return -1; } if (node.right == null) { return node.data; } else { return maxValue(node.right); } } private int maxDepth(Node node) { if (node == null || (node.left == null && node.right == null)) { return 0; } int ldepth = 1 + maxDepth(node.left); int rdepth = 1 + maxDepth(node.right); if (ldepth > rdepth) { return ldepth; } else { return rdepth; } } private int size(Node node) { if (node == null) { return 0; } return 1 + size(node.left) + size(node.right); } private Node insert(int data, Node node) { if (node == null) { node = new Node(data); } else if (data <= node.data) { node.left = insert(data, node.left); } else { node.right = insert(data, node.right); } //control should never reach here; return node; } private boolean lookup(int data, Node node) { if (node == null) { return false; } if (node.data == data) { return true; } if (data < node.data) { return lookup(data, node.left); } else { return lookup(data, node.right); } } public static void main(String[] args) { BinarySearchTree bst = new BinarySearchTree(); int treesize = 5; bst.buildTree(treesize); //treesize = bst.buildTreeFromOutputString("4 4 4 6 7"); treesize = bst.buildTreeFromOutputString("3 4 6 3 6"); //treesize = bst.buildTreeFromOutputString("10"); for (int i = 0; i < treesize; i++) { System.out.println("Searching:" + i + " found:" + bst.lookup(i)); } System.out.println("tree size:" + bst.size()); System.out.println("maxDepth :" + bst.maxDepth()); System.out.println("minvalue :" + bst.minValue()); System.out.println("maxvalue :" + bst.maxValue()); bst.printTree(); bst.printPostorder(); int pathSum = 10; System.out.println("hasPathSum " + pathSum + ":" + bst.hasPathSum(pathSum)); pathSum = 6; System.out.println("hasPathSum " + pathSum + ":" + bst.hasPathSum(pathSum)); pathSum = 19; System.out.println("hasPathSum " + pathSum + ":" + bst.hasPathSum(pathSum)); bst.printPaths(); bst.printTree(); //bst.mirror(); System.out.println("Tree after mirror function:"); bst.printTree(); //bst.doubleTree(); System.out.println("Tree after double function:"); bst.printTree(); System.out.println("tree size:" + bst.size()); System.out.println("Same tree:" + bst.sameTree(bst)); BinarySearchTree bst2 = new BinarySearchTree(); bst2.buildTree(treesize); treesize = bst2.buildTreeFromOutputString("3 4 6 3 6"); bst2.printTree(); System.out.println("Same tree:" + bst.sameTree(bst2)); System.out.println("---"); } } Now the problem is that netbeans shows Warning: Exporting a non public Type through public API for function getRoot(). I write this function to get root of tree to be used in sameTree() function, to help comparison of "this" with given tree. Perhaps this is a OOP design issue... How should I restructure the above code that I do not get this warning and what is the concept I am missing here?

    Read the article

  • How \Deleted flag can be unset for all mails in cyrus-imapd mailbox?

    - by Sachin Divekar
    I have a 5GB mailbox which I moved using imapsync. But somehow I messed up with --delete/--delete2 option and end up with almost all the messages having \Deleted flag set. I do not have delayed expunge enabled, so I can not use unexpunge utility. I am using cyrus-imapd v2.3.7. Using cyrus-imapd's debugging feature I found out that email client(Roundcube in my case) fires following IMAP command to unset it. UID STORE 179 -FLAGS.SILENT (\Deleted) I don't know if somehow I can fire this command for all the mails. Is there any way I can unset \Deleted flag for all the mails in the mailbox? UPDATE: Using @geekosaur's tip of specifying range of message-ids in the above command, I could solve it for one mailbox under INBOX like INBOX.folder1. Is there any way I can do it for multiple mailboxes under INBOX recursively? Now I am working on solving it using/creating some script, maybe using Perl's IMAP related module. But still I need to solve it asap so inputs are welcome.

    Read the article

  • Site stopped working after adding NIC card

    - by Sachin Kainth
    My boss made a bit of blunder yesterday, he added a secondary NIC card to the a machine hosting a website so that it could be part of the local network. He also added it to the <blah>.local domain (which all our servers are being added too). The website failed following this. He thought this was because the machine was now called <blahblah>.<blah>.local, so he removed it from the domain and restarted. Same problem a asp.net error, something to do with a binding error. Sorry he didn’t make a note of it. He traced it back to the WCF services that are running on the site. Anyway, it looks like ASP.NET gets confused connecting to the database when there’s multiple network cards. The 173.x.x.x IP address (which is internal), doesn’t route to the internet.. Therefore it’s trying to connect via the wrong network. Any ideas about how to resolve it?

    Read the article

  • Share PC over network

    - by Sachin Verma
    I have a server installed on one local Win7 machine (say as 192.168.2.14:8080/myAPP) and I want to access that server from different computer (say ip as 192.168.2.16). Even they are connected to same network I can't access server from other computer. I guess the problem is in firewall. This is working when I disable firewall and not working when I allow certain ports in windows firewall but keeping firewall on (As a rule to allow incoming connections).

    Read the article

  • Not able to output to file in the Windows command line

    - by Sachin
    In the following code, I need to take the path and size of folder and subfolders into a file. But when the loop runs for the second time, path and size are not getting printed to the file. size.txt only contains the path and size of the 1st folder. Please somebody help me. @echo off SETLOCAL EnableDelayedExpansion SET xsummary= SET xsize= for /f "tokens=1,2 delims=C" %%i IN ('"dir /s /-c /a | find "Directory""') do (echo C%%j >> abcd.txt) for /f "tokens=*" %%q IN (abcd.txt) do ( cd "%%q" For /F "tokens=*" %%h IN ('"dir /s /-c /a | find "bytes" | find /v "free""') do Set xsummary=%%h For /f "tokens=1,2 delims=)" %%a in ("!xsummary!") do set xsize=%%b Set xsize=!xsize:bytes=! Set xsize=!xsize: =! echo.%%q >> size.txt echo.!xsize! >> size.txt )

    Read the article

  • Default maximum heap size -- Ubuntu 10.04 LTS, openjdk6-jre

    - by sachin
    I just installed openjdk6-jre on Ubuntu 10.04 java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu1~10.04.1) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode) Every time I run "java" I get this error: Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. This can be solved by specifying a maximum heap size and running "java -Xmx256m" But is there anyway to permanently fix this error (i.e. set the default heap size to 256MB so that I do not need to specify the max heap size every time I run the command)

    Read the article

  • How to include duplicate values when setting environmental variable SET in dos

    - by Sachin
    I am trying to get the values from a file which has duplilcates also. But while setting the values in environmental variable SET, it is not considering the duplicate values. I am using below code: for /f "tokens=1,2 delims=@" %%a in (test.txt) do ( set size=............%%b call set %%size:~-12%%=%%a ) for /f %%a in ('set .') do >>outfile.txt echo %%a Format of test.txt: "C\ab"@12345678 "C\ab\we"@345678905 "C\ad\df"@345678905

    Read the article

  • install play-framework in Ubuntu 9.10

    - by Shekhar
    I have copied zipped file from the playframework.org website and unzipped it at a location. I have inserted it in my .bashrc profile to set up as PATH environment. But still, the play command is not accessible from anywhere. And even in the installed directory of the framework, the play file is not running as it is. I have to prefix python before any play command to run it. Am i making a mistake somewhere? Please help me.

    Read the article

  • Java input method for Virtual Keyboad

    - by shekhar
    Hi, I am facing problem in implementing Input method for Virtual Keyboard, currently I am using robot class for sending input to any application from virtual keyboard. but for that I need to create mapping of key-code and unicode, which is not consistent on different keyboard layout, can I directly pass the UNICODE to any application using Input method without worry about mapping between keycode and unicode. any useful link or sample code will be useful. It is simple Java program which is always on top of any application and work as onscreen keyboard. using a mouse while you press any button (key) of the keyboard, the corresponding character will be typed in the application running below. This is working perfectly for English Alphabets. I am facing problem while I am doing for unicode.

    Read the article

  • Can python mechanize handle HTTP auth?

    - by Shekhar
    Mechanize (Python) is failing with 401 for me to open http digest URLs. I googled and tried debugging but no success. My code looks like this. import mechanize project = "test" baseurl = "http://trac.somewhere.net" loginurl = "%s/%s/login" % (baseurl, project) b = mechanize.Browser() b.add_password(baseurl, "user", "secret", "some Realm") b.open(loginurl)

    Read the article

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