Search Results

Search found 396 results on 16 pages for 'arunkumar cr'.

Page 13/16 | < Previous Page | 9 10 11 12 13 14 15 16  | Next Page >

  • Boinc permissions problem on OS X

    - by Erik Vold
    I installed boinc 6.10.21 on my OS X 10.5 in order to upgrade from a 6.6 version that I was running today, and I am the admin user, and I was logged in as the admin user. As I was installing 6.10.21 I was asked if non admin users should be allowed to use Boinc, and I said 'yes' to this. Then when I tried to open Boinc I got a message like the following: "You currently are not authorized to manage the client. Either re-install and allow non-admin users or contact your administrator to add you to the 'boinc_master' user group." So I tried to reinstall first, and I was not asked if non admin users should be allowed to use Boinc.. so I retried a few times and got no different result.. So I downloaded 6.10.43 and installed that, and again I was not asked if non admin users should be allowed to use boinc.. and when I tried to run Boinc I got the same message like: "You currently are not authorized to manage the client. Either re-install and allow non-admin users or contact your administrator to add you to the 'boinc_master' user group." So I did a Google search trying to figure out how to add my admin user to the bonic_master user group and found this which suggested I run the following in terminal: "sudo dscl . -append /Groups/boinc_master GroupMembership <your user's short name> CR" So I did this and now I get the following error: BOINC ownership or permissions are not set properly; please reinstall BOINC (Error code -1200) So I reinstall and I am ever asked the question about allowing non admin users again, and I still get this error message every after every reinstall attempt.. What should I do?..

    Read the article

  • cisco 2900xl - SNMP - Get mac address of device connected to an interface

    - by ankit
    Hello all, Basically what i want to do is to find out what is the mac address of a device plugged in to an interface on the switch (FastEthernet0/1 for example) reading through the switch documentaion i found out that i can configure snmp trap on it to make it notify of any new mac address the switch detects by using the command snmp-server enable traps mac-notifiction but for some reason my switch does not support this feature. the only options i see are CORE_SWITCH(config)#snmp-server enable traps ? c2900 Enable SNMP c2900 traps cluster Enable Cluster traps config Enable SNMP config traps entity Enable SNMP entity traps hsrp Enable SNMP HSRP traps snmp Enable SNMP traps vlan-membership Enable VLAN Membership traps vtp Enable SNMP VTP traps <cr> so the other way would be for me to run a cronjon on my gateway to poll the switch periodically using snmp to get new mac addresses i have looked everywhere but cant seem to find the OID that would provide me this information. any help i can get would me very much appreciated ! here's the output from "show version" on my switch Cisco Internetwork Operating System Software IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5.4)WC(1), MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2001 by cisco Systems, Inc. Compiled Tue 10-Jul-01 11:52 by devgoyal Image text-base: 0x00003000, data-base: 0x00333CD8 ROM: Bootstrap program is C2900XL boot loader CORE_SWITCH uptime is 1 hour, 24 minutes System returned to ROM by power-on System image file is "flash:c2900XL-c3h2s-mz.120-5.4.WC.1.bin" cisco WS-C2912-XL (PowerPC403GA) processor (revision 0x11) with 8192K/1024K bytes of memory. Processor board ID FAB0409X1WS, with hardware revision 0x01 Last reset from power-on Processor is running Enterprise Edition Software Cluster command switch capable Cluster member switch capable 12 FastEthernet/IEEE 802.3 interface(s) 32K bytes of flash-simulated non-volatile configuration memory. Base ethernet MAC Address: 00:01:42:D0:67:00 Motherboard assembly number: 73-3397-08 Power supply part number: 34-0834-01 Motherboard serial number: FAB040843G4 Power supply serial number: DAB05030HR8 Model revision number: A0 Motherboard revision number: C0 Model number: WS-C2912-XL-EN System serial number: FAB0409X1WS Configuration register is 0xF thanks, -ankit

    Read the article

  • Networking problems in VMWare with wireless bridge

    - by Robert Koritnik
    Barebone data: virtualization: VMWare Workstation 6.5 (latest) Host: Windows Server 2008 x64 Guest: Windows Server 2008 x86 Host network adapter: Ethernet (see comment) Host network adapter: Wireless (see comment) Guest ethernet network adapter 1: Bridged VMNet (automatic) Guest ethernet network adapter 2: Host only VMNet comment: my host has LAN and Wifi but only one at the same time. I'm either wired or wireless. Never both. So bridged connection on VM goes either via wire or air. Problem When I'm wirelessly connected on the host and I access internet within VM my connection just gets stalled (not dropped). It doesn't experience any timeout whatsoever, it just stops downloading/communicating. For instance: I start downloading a file with a browser (IE/FF/CR doesn't matter) and I have to pause/restart download when speed drops to 0. I could wait indefinitely but connection won't pick-up automatically. What did I miss in my network configuration? Update 1 I've tested this in various combinations. This works fine when host is connected via Ethernet. But when host is connected via Wifi, the connection on the guest works as previously described. It connects fine. It gets a valid IP from DHCP... Everything is cool as long as you don't start doing some intensive network traffic (ie. download a 2MB file) In this case it starts downloading and stops after a while. Speed just drops to 0B/s... Sometimes it picks up back, sometimes it doesn't. Connection still stays and works. I can ping around with no problem.

    Read the article

  • Evernote from vim

    - by juanpablo
    I search a way to edit evernote notes from vim I begin with this #!/bin/bash evernoteDir="$HOME/Library/Application*Support/Evernote/data" dataDir=$(ls -trlh $evernoteDir| tail -n 1| awk '{print $NF}') contentDir="$evernoteDir/$dataDir/content" file=$(ls -trlh $contentDir | tail -n 1| awk '{print $NF}') vim -c 's/div>/div>\r/g' $contentDir/$file/content.html https://gist.github.com/1256416 or maybe create a vim plugin for this ... you have any suggestion? EDIT: for a more simple edition of the evernote note in html format, I make this vim function " Markup function {{{ fun! MkdToHtml() "{{{ " markdown to html silent! execute '%s/ $/<br\/>/g' silent! execute '%s/\*\*\(.*\)\*\*/<b>\1<\/b>/g' silent! execute '%s/\t*###\(.*\)/<H3>\1<\/H3>/g' endf "}}} command! -complete=command MkdToHtml call MkdToHtml() nn <silent> <leader>mm :MkdToHtml<CR> " }}} and a vim function for open the last note edited fun! LastEvernote() "{{{ " a better solution is with evernote api let evernoteDir=expand("$HOME")."/Library/Application*Support/Evernote/data" let dataDir=system("ls -trlh ".evernoteDir."| tail -n 1| awk '{print $NF}'") let contentDir=evernoteDir."/".dataDir."/content" let contentDir=substitute(contentDir,"\n","",'g') let note=system("ls -trlh ".contentDir." | tail -n 1| awk '{print $NF}'") let note=substitute(note,"\n","",'g') sil! exec 'sp '.contentDir.'/'.note.'/content.html' sil! exec '1s/>/>\r/g' sil! exec '%s/<br.*\/>/<br\/>\r/g' sil! exec '%s/<\//\r<\//g' sil! exec 'g/^\s*$/d' normal gg sil! exec '1,4fo' sil! exec '$-1,$fo' endf https://gist.github.com/1289727

    Read the article

  • Wireless Internet Connection Sharing in Ubuntu

    - by klutch2
    As the title states, I need to share a wireless connection with a laptop running Ubuntu as the AP. The setup will be as follows: Corporate WiFi <<== Laptop <<== Other Devices i.e. (iPad, iPhone) I want to be able to connect the "Other Devices" via WiFi to the laptop. I have thought of setting up an ad-hoc network by connecting to the Corporate WiFi and then setting up a new network and hoping the connection to both would stay, but that doesn't seem to work. If I set up the ad-hoc network by itself, I can see it from my "Other Devices". The reason I need this is because for some reason, my iPad and my iPhone will not connect to my corporate WiFi and I need to use them so I want to use my laptop to share the connection and act as an AP for my "Other Devices". My laptop is a Chrome CR-48 running Ubuntu and as some of you might know, it does not have an ethernet port, so having a wired connecting and then setting up a network is out of question. I want to connect to the Corporate WiFi and share that connection by having the laptop act as an AP for other devices.

    Read the article

  • sporadic routing to another website when opening a common url

    - by user226098
    I have a strange problem in our office: Sometimes when opening a url from one of our projects random url in any browser not the right website shows up but some other website. In most of the cases it redirects to google.com with some parameters like https://www.google.de/?gfe_rd=cr&ei=krOOU8_kGcSKswadyYDQBw&gws_rd=ssl or just the ugly google 404 page). But today it remains on the origial url but shows up the the content of http://debug.netdna-cdn.com/. This happens about 1 time a week and for no apparent reason. Even stranger it only occurs on a single pc in the network. It now happens on two different computers in the network. Both use windows 8. The problem cannot be fixed by clearing the browser cache but by rebooting the pc or using ipconfig /flushdns. So I think it has something to do with the dns cache of the machine. But I have no idea what the reason is for this and how i can figure out how to solve it. Any ideas?

    Read the article

  • whats wrong with the following code

    - by giri
    Hi i am trying to send sms to my mobile using java.When I run the application I am getting the the follwing error. package HelloWorld; import java.io.*; import java.util.BitSet; import javax.comm.*; import java.lang.*; public class SerialToGsm { InputStream in; OutputStream out; String lastIndexRead; String senderNum; String smsMsg; SerialToGsm(String porta) { try { // CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("serial0"); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(porta); SerialPort sp = (SerialPort)portId.open("Sms_GSM", 0); sp.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(sp.FLOWCONTROL_NONE); in = sp.getInputStream(); out = sp.getOutputStream(); // modem reset sendAndRecv("+++AT", 30); // delay for 20 sec/10 sendAndRecv("AT&F", 30); sendAndRecv("ATE0", 30); // echo off sendAndRecv("AT +CMEE=1", 30); // verbose error messages sendAndRecv("AT+CMGF=0", 70); // set pdu mode // sendAndRecv("AT V1E0S0=0&D2&C1", 1000000); } catch (Exception e) { System.out.println("Exception " + e); System.exit(1); } } private String sendAndRecv(String s, int timeout) { try { // clean serial port input buffer in.skip(in.available()); System.out.println("=> " + s); s = s + "\r"; // add CR out.write(s.getBytes()); out.flush(); String strIn = new String(); for (int i = 0; i < timeout; i++){ int numChars = in.available(); if (numChars > 0) { byte[] bb = new byte[numChars]; in.read(bb,0,numChars); strIn += new String(bb); } // start exit conditions // --------------------- if (strIn.indexOf(">\r\n") != -1) { break; } if (strIn.indexOf("OK\r\n") != -1){ break; } if (strIn.indexOf("ERROR") != -1) { // if find 'error' wait for CR+LF if (strIn.indexOf("\r\n",strIn.indexOf("ERROR") + 1) != -1) { break; } } Thread.sleep(100); // delay 1/10 sec } System.out.println("<= " + strIn); if (strIn.length() == 0) { return "ERROR: len 0"; } return strIn; } catch (Exception e) { System.out.println("send e recv Exception " + e); return "ERROR: send e recv Exception"; } } public String sendSms (String numToSend, String whatToSend) { ComputSmsData sms = new ComputSmsData(); sms.setAsciiTxt(whatToSend); sms.setTelNum(numToSend); // sms.setSMSCTelNum("+393359609600"); // SC fixed String s = new String(); s = sendAndRecv("AT+CMGS=" + (sms.getCompletePduData().length() / 2) + "\r", 30); // System.out.println("==> AT+CMGS=" + (sms.getCompletePduData().length() / 2)); // System.out.println("<== " + s); if (s.indexOf(">") != -1) { // s = sendAndRecv(sms.getSMSCPduData() + sms.getCompletePduData() + "\u001A"); // usefull one day? // System.out.println("Inviero questo >>>> " + sms.getCompletePduData()); // if this sintax won't work try remove 00 prefix s = sendAndRecv("00" + sms.getCompletePduData() + "\u001A", 150); // System.out.println("<== " + s); return s; } else { return "ERROR"; } } // used to reset message data private void resetGsmObj() { lastIndexRead = null; senderNum = null; smsMsg = null; } public String checkSms (){ String str = new String(); String strGsm = new String(); strGsm = sendAndRecv("AT+CMGL=0", 30); // list unread msg and sign them as read // if answer contain ERROR then ERROR if (strGsm.indexOf("ERROR") != -1) { resetGsmObj(); return strGsm; // error } strGsm = sendAndRecv("AT+CMGL=1", 30); // list read msg // if answer contain ERROR then ERROR if (strGsm.indexOf("ERROR") != -1) { resetGsmObj(); return strGsm; // error } // evaluate message index if (strGsm.indexOf(':') <= 0) { resetGsmObj(); return ("ERROR unexpected answer"); } str = strGsm.substring(strGsm.indexOf(':') + 1,strGsm.indexOf(',')); str = str.trim(); // remove white spaces // System.out.println("Index: " + str); lastIndexRead = str; // find message string // ------------------- // look for start point (search \r, then skip \n, add and one more for right char int startPoint = strGsm.indexOf("\r",(strGsm.indexOf(":") + 1)) + 2; int endPoint = strGsm.indexOf("\r",startPoint + 1); if (endPoint == -1) { // only one message endPoint = strGsm.length(); } // extract string str = strGsm.substring(startPoint, endPoint); System.out.println("String to be decoded :" + str); ComputSmsData sms = new ComputSmsData(); sms.setRcvdPdu(str); // SMSCNum = new String(sms.getRcvdPduSMSC()); senderNum = new String(sms.getRcvdSenderNumber()); smsMsg = new String(sms.getRcvdPduTxt()); System.out.println("SMSC number: " + sms.getRcvdPduSMSC()); System.out.println("Sender number: " + sms.getRcvdSenderNumber()); System.out.println("Message: " + sms.getRcvdPduTxt()); return "OK"; } public String readSmsSender() { return senderNum; } public String readSms() { return smsMsg; } public String delSms() { if (lastIndexRead != "") { return sendAndRecv("AT+CMGD=" + lastIndexRead, 30); } return ("ERROR"); } } ERROR: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/lang/String;)I while loading driver com.sun.comm.SolarisDriver Exception javax.comm.NoSuchPortException

    Read the article

  • How do I search the MediaStore for a specific directory instead of entire external storage?

    - by Nick Lopez
    In my app I have an option that allows users to browse for audio files on their phone to add to the app. I am having trouble however with creating a faster way of processing the query code. Currently it searches the entire external storage and causes the phone to prompt a force close/wait warning. I would like to take the code I have posted below and make it more efficient by either searching in a specific folder on the phone or by streamlining the process to make the file search quicker. I am not sure how to do this however. Thanks! public class BrowseActivity extends DashboardActivity implements OnClickListener, OnItemClickListener { private List<Sound> soundsInDevice = new ArrayList<Sound>(); private List<Sound> checkedList; private ListView browsedList; private BrowserSoundAdapter adapter; private long categoryId; private Category category; private String currentCategoryName; private String description; // private Category newCategory ; private Button doneButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_browse); checkedList = new ArrayList<Sound>(); browsedList = (ListView) findViewById(android.R.id.list); doneButton = (Button) findViewById(R.id.doneButton); soundsInDevice = getMediaSounds(); if (soundsInDevice.size() > 0) { adapter = new BrowserSoundAdapter(this, R.id.browseSoundName, soundsInDevice); } else { Toast.makeText(getApplicationContext(), getString(R.string.no_sounds_available), Toast.LENGTH_SHORT) .show(); } browsedList.setAdapter(adapter); browsedList.setOnItemClickListener(this); doneButton.setOnClickListener(this); } private List<Sound> getMediaSounds() { List<Sound> mediaSoundList = new ArrayList<Sound>(); ContentResolver cr = getContentResolver(); String[] projection = {MediaStore.Audio.Media._ID, MediaStore.Audio.Media.DISPLAY_NAME, MediaStore.Audio.Media.TITLE, MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.DURATION}; final Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; Log.v("MediaStore.Audio.Media.EXTERNAL_CONTENT_URI", "" + uri); final Cursor cursor = cr.query(uri, projection, null, null, null); int n = cursor.getCount(); Log.v("count", "" + n); if (cursor.moveToFirst()) { do { String soundName = cursor .getString(cursor .getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME)); Log.v("soundName", "" + soundName); String title = cursor .getString(cursor .getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE)); Log.v("title", "" + title); String path = cursor.getString(cursor .getColumnIndexOrThrow(MediaStore.Audio.Media.DATA)); Log.v("path", "" + path); Sound browsedSound = new Sound(title, path, false, false, false, false, 0); Log.v("browsedSound", "" + browsedSound); mediaSoundList.add(browsedSound); Log.v("mediaSoundList", "" + mediaSoundList.toString()); } while (cursor.moveToNext()); } return mediaSoundList; } public class BrowserSoundAdapter extends ArrayAdapter<Sound> { public BrowserSoundAdapter(Context context, int textViewResourceId, List<Sound> objects) { super(context, textViewResourceId, objects); } @Override public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; View view = convertView; LayoutInflater inflater = getLayoutInflater(); if (view == null) { view = inflater.inflate(R.layout.list_item_browse, null); viewHolder = new ViewHolder(); viewHolder.soundNameTextView = (TextView) view .findViewById(R.id.browseSoundName); viewHolder.pathTextView = (TextView) view .findViewById(R.id.browseSoundPath); viewHolder.checkToAddSound = (CheckBox) view .findViewById(R.id.browse_checkbox); view.setTag(viewHolder); } else { viewHolder = (ViewHolder) view.getTag(); } final Sound sound = soundsInDevice.get(position); if (sound.isCheckedState()) { viewHolder.checkToAddSound.setChecked(true); } else { viewHolder.checkToAddSound.setChecked(false); } viewHolder.soundNameTextView.setText(sound.getName()); viewHolder.pathTextView.setText(sound.getUri()); viewHolder.checkToAddSound .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { CheckBox cb = (CheckBox) v .findViewById(R.id.browse_checkbox); boolean checked = cb.isChecked(); boolean newValue = checked; updateView(position, newValue); doneButtonStatus(checkedList.size()); } }); return view; } } // Adapter view holder class private class ViewHolder { private TextView soundNameTextView; private TextView pathTextView; private CheckBox checkToAddSound; } // done button On Click @Override public void onClick(View view) { boolean status = getIntent().getBooleanExtra("FromAddCat", false); Log.v("for add category","enters in if"); if(status){ Log.v("for add category","enters in if1"); currentCategoryName = getIntent().getStringExtra("categoryName"); description = getIntent().getStringExtra("description"); boolean existCategory = SQLiteHelper.getCategoryStatus(currentCategoryName); if (!existCategory) { category = new Category(currentCategoryName, description, false); category.insert(); category.update(); Log.v("for add category","enters in if2"); } }else{ categoryId = getIntent().getLongExtra("categoryId",-1); category = SQLiteHelper.getCategory(categoryId); } for (Sound checkedsound : checkedList) { checkedsound.setCheckedState(false); checkedsound.insert(); category.getSounds().add(checkedsound); final Intent intent = new Intent(this, CategoriesActivity.class); finish(); startActivity(intent); } } @Override public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) { boolean checked = true; boolean newValue = false; CheckBox cb = (CheckBox) view.findViewById(R.id.browse_checkbox); if (cb.isChecked()) { cb.setChecked(!checked); newValue = !checked; } else { cb.setChecked(checked); newValue = checked; } updateView(position, newValue); doneButtonStatus(checkedList.size()); } private void doneButtonStatus(int size) { if (size > 0) { doneButton.setEnabled(true); doneButton.setBackgroundResource(R.drawable.done_button_drawable); } else { doneButton.setEnabled(false); doneButton.setBackgroundResource(R.drawable.done_btn_disabled); } } private void updateView(int index, boolean newValue) { System.out.println(newValue); Sound sound = soundsInDevice.get(index); if (newValue == true) { checkedList.add(sound); sound.setCheckedState(newValue); } else { checkedList.remove(sound); sound.setCheckedState(newValue); } } }

    Read the article

  • Handy SQL Server Functions Series (HSSFS) Part 2.0 - Prelude to Parsing Patterns Properly

    - by Most Valuable Yak (Rob Volk)
    In Part 1 of the series I wrote about 2 lesser-known and somewhat undocumented functions. In this part, I'm going to cover some familiar string functions like Substring(), Parsename(), Patindex(), and Charindex() and delve into their strengths and weaknesses. I'm also splitting this part up into sub-parts to help focus on a particular technique and/or problem with the technique, hence the Part 2.0. Consider this a composite post, or com-post, if you will. (It may just turn out to be a pile of sh_t after all) I'll be using a contrived example, perhaps the most frustratingly useful, or usefully frustrating, function in SQL Server: @@VERSION. Contrived, because there are better ways to get the information (which I'll cover later); frustrating, because of the way Microsoft formatted the value; and useful because it does have 1 or 2 bits of information not found elsewhere. First let's take a look at the output of @@VERSION: Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86) Apr 2 2010 15:53:02 Copyright (c) Microsoft Corporation Developer Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3) There are 4 lines, with lines 2-4 indented with a tab character.  In case your browser (or this blog software) doesn't show it correctly, I gave each line a different color.  While this PRINTs nicely, if you SELECT @@VERSION in grid mode it all runs together because it ignores carriage return/line feed (CR/LF) characters.  Not fatal, but annoying. Note that @@VERSION's output will vary depending on edition and version of SQL Server, and also the OS it's installed on.  Despite the differences, the output is laid out the same way and the relevant pieces are in the same order. I'll be using the following view for Parts 2.1 onward, so we have a nice collection of @@VERSION information: create view version(SQLVersion,VersionString) AS ( select 2000, 'Microsoft SQL Server 2000 - 8.00.2055 (Intel X86) Dec 16 2008 19:46:53 Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3)' union all select 2005, 'Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) May 26 2009 14:24:20 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3)' union all select 2008, 'Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86) Apr 2 2010 15:53:02 Copyright (c) Microsoft Corporation Developer Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)' union all select 2005, 'Microsoft SQL Server 2005 - 9.00.3080.00 (Intel X86) Sep 6 2009 01:43:32 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)' union all select 2008, 'Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor)' union all select 2008, 'Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Express Edition with Advanced Services (64-bit) on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor)' ) Feel free to add your own @@VERSION info if it's not already there. In Part 2.1 I'll focus on extracting the SQL Server version number (10.50.1600.1 in first example) and the Edition (Developer), but will have a solution that works with all versions.  Stay tuned!

    Read the article

  • Crystal Reports Reportviewer - Set Datasource Dynamically Not Working :argh:

    - by Albert
    I'm running CR XI, and accessing .RPT files through a ReportViewer in my ASP.NET pages. I've already got the following code, which is supposed to set the Report Datasource dynamically. rptSP = New ReportDocument Dim rptPath As String = Request.QueryString("report") rptSP.Load(rptPath.ToString, 0) Dim SConn As New System.Data.SqlClient.SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString) rptSP.DataSourceConnections(SConn.DataSource, SConn.InitialCatalog).SetConnection(SConn.DataSource, SConn.InitialCatalog, SConn.UserID, SConn.Password) Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo myConnectionInfo.ServerName = SConn.DataSource myConnectionInfo.DatabaseName = SConn.InitialCatalog myConnectionInfo.UserID = SConn.UserID myConnectionInfo.Password = SConn.Password 'Two new methods to loop through all objects and tables contained in the requested report and set 'login credentials for each object and table. SetDBLogonForReport(myConnectionInfo, rptSP) SetDBLogonForSubreports(myConnectionInfo, rptSP) Me.CrystalReportViewer1.ReportSource = rptSP But when I go into each .RPT file, and open up the Database Expert section, there is obviously still servernames hardcoded in there, and the code listed above doesn't seem to be able to change the servernames that are hardcoded there. I say this because I have training and production environments. When the .RPT file is hardcoded with my production server, and I open it on my training server with the code above (and the web.config has the training server in the connection string), I get the ol: Object reference not set to an instance of an object. And then if I go into the .RPT file, and change over the datasource to the training server, and try to open it again, it works fine. Why doesn't the code above overwrite the .RPT files datasource? How can I avoid having to open up each .RPT and change the datasource when migrating reports from server to server? Is there a setting in the .RPT file I'm missing or something?

    Read the article

  • Websphere 7 EntityManagerFactory creation problem

    - by mihaela
    Hello, I'm working on a maven project which uses seam 2.2.0, hibernate 3.5.0-CR-2 as JPA provider, DB2 as database server and Websphere 7 as application server. Now I'm facing de following problem: In my EJBs that are seen also as SEAM components I want to use the EntityManager from EJB container (@PersistenceContext private EntityManager em) not Seam's EntityManager (@In private EntityManager em). But this is the problem, I cannot obtain an EntityManager using @PersistenceContext. On server logs it sais that it cannot create an EntityManagerFactory and gets a ClassCastException: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence incompatible with javax.persistence.spi.PersistenceProvider After a lot of debugging and searching on forums I'm assuming that the problem is that Websphere doesn't use the Hibernate JPA provider. Has anyone faced this problem and has a solution? I configured already WAS class loader order for my application to load the classes with the application class loader first and I\ve packed all necessary jars in application ear as written in: WAS InfoCenter: Features for EJB 3.0 development . If necessary I'll post my persistence.xml, components.xml files and stack trace. I've found this problem discussed also here: Websphere EntityManagerFactory creation problem Hibernate 3.3 fail to create entity manager factory in Websphere 7.0. Please help Any hint will be useful. Thanks in advance! Mihaela

    Read the article

  • CSharpCodeProvider 'cannot find metadata file' Compiling Plugin Code With Mono

    - by Jason Champion
    I have some code in an XML file that I load and compile at runtime in an application. This works fine on Windows, but under Mono I get assembly reference errors. Here's the examine code in question: public static bool CompileSpell(Spell spell) { CSharpCodeProvider prov = new CSharpCodeProvider(); CompilerParameters cp = new CompilerParameters(); cp.GenerateExecutable = true; cp.GenerateInMemory = true; cp.ReferencedAssemblies.Add("system.dll"); cp.ReferencedAssemblies.Add("system.xml.dll"); cp.ReferencedAssemblies.Add("BasternaeMud.dll"); cp.ReferencedAssemblies.Add("ZoneData.dll"); Log.Trace("Compiling spell '" + spell.Name + "'."); StringBuilder sb = new StringBuilder(); int idx = spell.FileName.IndexOf('.'); string file = spell.FileName; if (idx > 0) { file = spell.FileName.Substring(0, idx); } int lines = GenerateWithMain(sb, spell.Code, "BasternaeMud"); CompilerResults cr = prov.CompileAssemblyFromSource(cp,sb.ToString()); .... The specific errors I get in the compiler results are: cannot find metadata file 'system.dll' at line 0 column 0. cannot find metadata file 'system.xml.dll' at line 0 column 0. Mono obviously doesn't like the way I add referenced assemblies to the code I'm compiling for system.xml and system.xml.dll. The other two assemblies add fine, which is no surprise because they're the code that the compiler is actually executing from and exist in the executable directory. Any clue what I need to do to fix this? Maybe I could just drop those DLLs in the executable directory, but that feels like a dumb idea.

    Read the article

  • Delphi: Alternative to using Assign/ReadLn for text file reading

    - by Ian Boyd
    i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; Problem with that is once the file gets to be a few hundred megabytes, i have to allocate a huge chunk of memory; when really i only need enough memory to hold one line at a time. (Plus, you can't really indicate progress when you the system is locked up loading the file in step 1). The i tried using the native, and recommended, file I/O routines provided by Delphi: var f: TextFile; begin Assign(filename, f); while ReadLn(f, oneLine) do begin //process the line end; Problem withAssign is that there is no option to read the file without locking (i.e. fmShareDenyNone). The former stringlist example doesn't support no-lock either, unless you change it to LoadFromStream: slFile := TStringList.Create; stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); slFile.LoadFromStream(stream); stream.Free; for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; So now even though i've gained no locks being held, i'm back to loading the entire file into memory. Is there some alternative to Assign/ReadLn, where i can read a file line-by-line, without taking a sharing lock? i'd rather not get directly into Win32 CreateFile/ReadFile, and having to deal with allocating buffers and detecting CR, LF, CRLF's. i thought about memory mapped files, but there's the difficulty if the entire file doesn't fit (map) into virtual memory, and having to maps views (pieces) of the file at a time. Starts to get ugly. i just want Assign with fmShareDenyNone!

    Read the article

  • send Image from J2ME to SERVLET

    - by Akash
    Hi, I want to send Image from J2ME to SERVLET. I am able to convert image into Byte Array, and send by Http POST. I have coded as : - From Mobile : conn = (HttpConnection)Connector.open(url,Connector.READ_WRITE,true); conn.setRequestMethod(HttpConnection.POST); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); os.write(bytes, 0, bytes.length);//bytes = byte array of image At servlet : String line; BufferedReader r1 = new BufferedReader(new InputStreamReader(in)); while ((line = r1.readLine()) != null) { System.out.println("line=" + line); buf.append(line); } String s = buf.toString(); byte[] img_byte = s.getBytes(); Now d problem I found is, when I send Bytes from Mob App, some bytes are LOST , whose value is 0A and 0D-Hex ... Exactly, Cr- Carriage Return & Lf- Line Feed... It means, POST method OR readLine() not able to accept 0A & 0D value... And so I come to know that, LOST bytes are 0A and 0D occurrence in image's byte array.... Any one have any idea, how to do this, or how to use any another method..... Thanks -Akash

    Read the article

  • Lotus Notes - Export emails to plain text file

    - by mbeckish
    I am setting up a Lotus Notes account to accept emails from a client, and automatically save each email as a plain text file to be processed by another application. So, I'm trying to create my very first Agent in Lotus to automatically export the emails to text. Is there a standard, best practices way to do this? I've created a LotusScript Agent that pretty much works. However, there is a bug - once the Body of the memo exceeds 32K characters, it starts inserting extra CR/LF pairs. I am using Lotus Notes 7.0.3. Here is my script: Sub Initialize On Error Goto ErrorCleanup Dim session As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim uniqueID As Variant Dim curView As NotesView Dim docCount As Integer Dim notesInputFolder As String Dim notesValidOutputFolder As String Dim notesErrorOutputFolder As String Dim outputFolder As String Dim fileNum As Integer Dim bodyRichText As NotesRichTextItem Dim bodyUnformattedText As String Dim subjectText As NotesItem ''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'INPUT OUTPUT LOCATIONS outputFolder = "\\PASCRIA\CignaDFS\CUser1\Home\mikebec\MyDocuments\" notesInputFolder = "IBEmails" notesValidOutputFolder = "IBEmailsDone" notesErrorOutputFolder="IBEmailsError" ''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set db = session.CurrentDatabase Set curview = db.GetView(notesInputFolder ) docCount = curview.EntryCount Print "NUMBER OF DOCS " & docCount fileNum = 1 While (docCount > 0) 'set current doc to Set doc = curview.GetNthDocument(docCount) Set bodyRichText = doc.GetFirstItem( "Body" ) bodyUnformattedText = bodyRichText.GetUnformattedText() Set subjectText = doc.GetFirstItem("Subject") If subjectText.Text = "LotusAgentTest" Then uniqueID = Evaluate("@Unique") Open "\\PASCRIA\CignaDFS\CUser1\Home\mikebec\MyDocuments\email_" & uniqueID(0) & ".txt" For Output As fileNum Print #fileNum, "Subject:" & subjectText.Text Print #fileNum, "Date:" & Now Print #fileNum, bodyUnformattedText Close fileNum fileNum = fileNum + 1 Call doc.PutInFolder(notesValidOutputFolder) Call doc.RemoveFromFolder(notesInputFolder) End If doccount = doccount-1 Wend Exit Sub ErrorCleanup: Call sendErrorEmail(db,doc.GetItemValue("From")(0)) Call doc.PutInFolder(notesErrorOutputFolder) Call doc.RemoveFromFolder(notesInputFolder) End Sub Update Apparently the 32KB issue isn't consistent - so far, it's just one document that starts getting extra carriage returns after 32K.

    Read the article

  • what data structure should I use for hash lookup as well as binary search?

    - by zebraman
    I am working on a school homework. I have a list of names. I want to be able to perform binary search on these names (find all names between a lower and upper bound) for first name as well as last name, and perform keyword searches as well (this will be accomplished using hashing. For example, if I have the names Garfield Cat Snoopy Dog Captain Crunch Fat Cat then a binary search of first names (C,H) will return Captain Crunch, Fat Cat, and Garfield Cat. A binary search of last names (Cr,D) will return Captain Crunch. A keyword search of 'cat' will return Fat Cat and Garfield Cat. I understand binary search will only work on a sorted list, but since I am planning on searching two different criteria, I will have to sort the list by last name or first name depending on what I'm searching for. I feel like it will be too inefficient to have to resort the list each time I want to perform a new binary search. Would it just be better for me to set up and maintain two sorted lists (one for sorted by first name, one for sorted by last name)? Also, for hashing, will I have to set up a different table of names for that as well? I understand each keyword will hash to some value determined by a hash function, and this value (or key) is a table address where the corresponding names are stored. So I just want to know what would be the best way to solve this problem? Maintaining separate structures, or is there a way to efficiently do everything I want with just one data structure?

    Read the article

  • Help me create a Firefox extension (Javascript XPCOM Component)

    - by Johnny Grass
    I've been looking at different tutorials and I know I'm close but I'm getting lost in implementation details because some of them are a little bit dated and a few things have changed since Firefox 3. I have already written the javascript for the firefox extension, now I need to make it into an XPCOM component. This is the functionality that I need: My Javascript file is simple, I have two functions startServer() and stopServer. I need to run startServer() when the browser starts and stopServer() when firefox quits. Edit: I've updated my code with a working solution (thanks to Neil). The following is in MyExtension/components/myextension.js. Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); const CI = Components.interfaces, CC = Components.classes, CR = Components.results; // class declaration function MyExtension() {} MyExtension.prototype = { classDescription: "My Firefox Extension", classID: Components.ID("{xxxx-xxxx-xxx-xxxxx}"), contractID: "@example.com/MyExtension;1", QueryInterface: XPCOMUtils.generateQI([CI.nsIObserver]), // add to category manager _xpcom_categories: [{ category: "profile-after-change" }], // start socket server startServer: function () { /* socket initialization code */ }, // stop socket server stopServer: function () { /* stop server */ }, observe: function(aSubject, aTopic, aData) { var obs = CC["@mozilla.org/observer-service;1"].getService(CI.nsIObserverService); switch (aTopic) { case "quit-application": this.stopServer(); obs.removeObserver(this, "quit-application"); break; case "profile-after-change": this.startServer(); obs.addObserver(this, "quit-application", false); break; default: throw Components.Exception("Unknown topic: " + aTopic); } } }; var components = [MyExtension]; function NSGetModule(compMgr, fileSpec) { return XPCOMUtils.generateModule(components); }

    Read the article

  • How to modify ASCII table in C ? [closed]

    - by drigoSkalWalker
    Like this: My ASCII Chart 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 SP ! " # $ % & ' ( ) * + , - . / 3 0 1 2 3 4 5 6 7 8 9 : ; ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 ` a b c d e f g h i j k l m n o 7 p q r s t u v w x y z { | } ~ DEL I want to call a function, alter the ASCII sequence in this function and when it returns, the ASCII sequence back to the original. Thanks in advance! EDIT: What I want is it: I want to change the order of chars, for examble, A is 65, if I want to make A equal a 0? without to make a function to do it, for example, I could accomplish it with a function that compare an array of chars, and store it in another way with the correct value (the new table), but do it is too expensive, is there another way? thanks in advance again!

    Read the article

  • Parse and read data frame in C?

    - by user253656
    I am writing a program that reads the data from the serial port on Linux. The data are sent by another device with the following frame format: |start | Command | Data | CRC | End | |0x02 | 0x41 | (0-127 octets) | | 0x03| ---------------------------------------------------- The Data field contains 127 octets as shown and octet 1,2 contains one type of data; octet 3,4 contains another data. I need to get these data I know how to write and read data to and from a serial port in Linux, but it is just to write and read a simple string (like "ABD") My issue is that I do not know how to parse the data frame formatted as above so that I can: get the data in octet 1,2 in the Data field get the data in octet 3,4 in the Data field get the value in CRC field to check the consistency of the data Here the sample snip code that read and write a simple string from and to a serial port in Linux: int writeport(int fd, char *chars) { int len = strlen(chars); chars[len] = 0x0d; // stick a <CR> after the command chars[len+1] = 0x00; // terminate the string properly int n = write(fd, chars, strlen(chars)); if (n < 0) { fputs("write failed!\n", stderr); return 0; } return 1; } int readport(int fd, char *result) { int iIn = read(fd, result, 254); result[iIn-1] = 0x00; if (iIn < 0) { if (errno == EAGAIN) { printf("SERIAL EAGAIN ERROR\n"); return 0; } else { printf("SERIAL read error %d %s\n", errno, strerror(errno)); return 0; } } return 1; } Does anyone please have some ideas? Thanks all.

    Read the article

  • Delphi: Alternative to using Reset/ReadLn for text file reading

    - by Ian Boyd
    i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; Problem with that is once the file gets to be a few hundred megabytes, i have to allocate a huge chunk of memory; when really i only need enough memory to hold one line at a time. (Plus, you can't really indicate progress when you the system is locked up loading the file in step 1). The i tried using the native, and recommended, file I/O routines provided by Delphi: var f: TextFile; begin Reset(f, filename); while ReadLn(f, oneLine) do begin //process the line end; Problem withAssign is that there is no option to read the file without locking (i.e. fmShareDenyNone). The former stringlist example doesn't support no-lock either, unless you change it to LoadFromStream: slFile := TStringList.Create; stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); slFile.LoadFromStream(stream); stream.Free; for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; So now even though i've gained no locks being held, i'm back to loading the entire file into memory. Is there some alternative to Assign/ReadLn, where i can read a file line-by-line, without taking a sharing lock? i'd rather not get directly into Win32 CreateFile/ReadFile, and having to deal with allocating buffers and detecting CR, LF, CRLF's. i thought about memory mapped files, but there's the difficulty if the entire file doesn't fit (map) into virtual memory, and having to maps views (pieces) of the file at a time. Starts to get ugly. i just want Reset with fmShareDenyNone!

    Read the article

  • Can't get syntax on to work in my gvim.

    - by user198553
    (I'm new to Linux and Vim, and I'm trying to learn Vim but I'm having some issues with it that I can't seen do fix) I'm in a Linux installation (Ubuntu 8.04) that I can't update, using Vim 7.1.138. My vim installation is in /usr/share/vim/vim71/. /home/user/ My .vimrc file is in /home/user/.vimrc, as follows: fun! MySys() return "linux" endfun set runtimepath=~/.vim,$VIMRUTNTIME source ~/.vim/.vimrc And then, in my /home/user/.vim/.vimrc: " =============== GENERAL CONFIG ============== set nocompatible syntax on " =============== ENCODING AND FILE TYPES ===== set encoding=utf8 set ffs=unix,dos,mac " =============== INDENTING =================== set ai " Automatically set the indent of a new line (local to buffer) set si " smartindent (local to buffer) " =============== FONT ======================== " Set font according to system if MySys() == "mac" set gfn=Bitstream\ Vera\ Sans\ Mono:h13 set shell=/bin/bash elseif MySys() == "windows" set gfn=Bitstream\ Vera\ Sans\ Mono:h10 elseif MySys() == "linux" set gfn=Inconsolata\ 14 set shell=/bin/bash endif " =============== COLORS ====================== colorscheme molokai " ============== PLUGINS ====================== " -------------- NERDTree --------------------- :noremap ,n :NERDTreeToggle<CR> " =============== DIRECTORIES ================= set backupdir=~/.backup/vim set directory=~/.swap/vim ...fact is the command syntax on is not working, neither in vim or gvim. And the strange thing is: If I try to set the syntax using the gvim toolbat, it works. Then, in normal mode in gvim, after activating using the toolbar, using the code :syntax off, it works, and just after doing this trying to do :syntax on doesn't work!! What's going on? Am I missing something?

    Read the article

  • GPIB connection to external device using MATLAB

    - by hkf
    Is there a way to establish a GPIB connection using MATLAB without the instrument control Tool box? (I don't have it). Also is there a way for MATLAB to know what the external device's RS232 parameter values are ( Baud rate, stop bit etc..). For the RS232 connection I have the following code: % This function is meant to send commands to Potentiostat Model 263A. % A run includes turning the cell on, reading current for time t1, turning % the cell off, waiting for time t2. % t1 is the duration [secs] for which the Potentiostat must run (cell is on) % t2 is the duration [secs] to on after off % n is the number of runs % port is the serial port name such as COM1 function [s] = Potentiostat_control(t1,t2,n) port = input('type port name such as COM1', 's') s = serial(port); set(s,'BaudRate', 9600, 'DataBits', 8, 'Parity', 'even', 'StopBits', 2 ,'Terminator', 'CR/LF'); fopen(s) %fprintf(s,'RS232?') disp(['Total runs requested = ' num2str(n)]) disp('i denotes number of runs executed so far..'); for i=1:n i %data1 = query(s, '*IDN?') fprintf(s,'%s','CELL 1'); % sends the command 'CELL 1' %fprintf(s,'%s','READI'); pause(t1); fprintf(s,'%s','CELL 0'); %fprintf(s,'%s','CLEAR'); pause(t2); end fclose(s)

    Read the article

  • Flash CS4 [AS3]: Playing Card Deck Array

    - by Ben
    I am looking to make a card game in Flash CS4 using AS3 and I am stuck on the very first step. I have created graphics for a standard 52 card deck of playing cards and imported them into the library in Flash and then proceeded to convert them all to Movie Clips. I have also used the linkage to make them available in the code. The movie clips and the linkage are named in sequence, as in the Ace of Clubs would be C1, two of Diamonds is called D2, Jack of Spades is S11. (C = Clubs, D = Diamonds, S = Spades, H = Hearts and numbers 1 through 13 are the card values. 1 being Ace, 11 being Jack, 12 being Queen, 13 being King). As far as I know my next step would be to arrange the cards into an array. This is the part that I am having problems with. Can someone please point me in the right direction, what would be the best way to do this. Could you provide me with a bit of sample code as well? I have had a look at few tutorials online but they are all telling me different things, some are incomplete and the rest...well...they're just cr*ppy. Thanks in advance! Ben

    Read the article

  • Our Flash Streaming Player Occasionally Stutters like a Skipping CD after a Period of Time

    - by Jonathan Fritz
    We offer a streaming player for a number of our clients, who are responsible for their providing us with their own audio streams. We have written a very simple flash player that can play all of the streams that we support (icecast/shoutcast/live365/mp3 over http/etc). Unfortunately, we have found that when listening, our player sometimes begins to stutter (like a skipping cd), sometimes after only 10 minutes, and sometimes after an hour of listening. We have noticed this behaviour in firefox on both linux and windows. Does anybody know anything about this problem? We know that flash isn't ideal for infinite streams of audio, but it's about all that we can find that's on every platform out there. If anybody can suggest a solution to our problem, I'll be your friend forever. Here is a link to the live player: http://cr-jf.jfritz.02.dev.wecreate.com/streaming/player_v5/ Note that you'll need to test in a browser that isn't IE, because we use WMP in IE, and that the JavaScript on the page will cause the player to unload and re-load once an hour because of memory issues. Because I can only put one hyperlink in a post, I'll add a link to the player source code as a comment. Thanks all!

    Read the article

  • Browsers disagree about the text of a body element

    - by Charles Anderson
    My HTML looks like this: <html> <head> <title>Test</title> <script type="text/javascript" src="jQuery.js"></script> <script type="text/javascript"> function init() { var text = jQuery('body').text(); alert('length = ' + text.length); } </script> </head> <body onload="init()">0123456789</body> </html> When I load this in Firefox, the length is reported as 10. However, in Chrome it's 11 because it thinks there's a linefeed after the '9'. In IE it's also 11, but the last character is an escape. Meanwhile, Opera thinks there are 12 characters, with the last two being CR LF. If I change the body element to include a span: <body onload="init()"><span>0123456789</span></body> and the jQuery call to: var text = jQuery('body span').text(); then all the browsers agree that the length is 10. Clearly it's the body element that's causing the issue, but can anyone explain exactly why this is happening? I'm particularly surprised because the excellent jQuery is normally browser-independent.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16  | Next Page >