on-internet

How to write or append string in loop in a file in java?

I'm having memory problem as working with very large dataset and getting memory leaks with char[] and Strings, don't know why! So I am thinking of writing some processed data in a file and not store in memory. So, I want to write texts from an arrayList in a file using a loop. First the program will check if the specific file already exist in the current working directory and if not then create a file with the specific name and start writing texts from the arrayList line by line using a loop; and if the file is already exist then open the file and append the 1st array value after the last line

Join the discussion →

Debugging android device over the Internet

I am looking for a way to debug a device remotely over the Internet. I am getting a lot of bug reports from my users which I can't even reproduce. It would be easy to solve them if I could debug the device over the Internet as if it were connected to my PC. Is this possible? I heard about debugging over wifi in local network, maybe there is similar way to achieve it over the Internet?

Join the discussion →

Emacs: Combine iseach-forward and recenter-top-bottom

In Emacs, I like to use iseach-forward (C-s) but I'd like it ever more if the highlighted fount words would be centered in the middle of the screen instead of at the very bottom. I find myself doing this continuously: C-s foo C-s C-s C-s... oh! that's the 'foo' I was looking for! C-l Is there a way to center the search results in the middle of the screen?

Join the discussion →

Set the focus on input element after submit

I have a form with some input fields. I am using the tabStrip KendoUI widget to group the input fields. I am using the Kendo validator and when the form is submitted some error messages are triggered. The problem is that if the input field with the error message is on a different tab then the currently selected the user cannot see it. What I want to accomplish is when the form is validated the tab containing the first input field with error message to be selected and the focus to be on that input field. Here is some sample code: <script type="text/javascript"> $("#tabStrip").kendoTabStrip(); <

Join the discussion →

How to handle self signed certificate error in IE8 using Selenium Webdriver + Java

I am literally stuck to this problem for two days now. Scenario: The website that needs to be tested has a self signed certificate. So Internet Explorer (8 in windows XP_ shows "The security certificate presented by this website was not issued by a trusted certificate authority. The security certificate presented by this website was issued for a different website's address." Now this is perfectly natural in case of IE8 and self-signing certificates so I took the following measures to no use Manually added/installed the certificate as a Trusted Root Certificate in IE. But it doesn't get shown i

Join the discussion →

How do I write a TDBCtrlGrid VCL Style custom class?

There are lots of questions here about XE2 VCL Styles and custom colors for Buttons, Panels, edits, etc, and VCL Styles. As much as I wish the existing questions covered it, they don't... So DB Control Grids appear to be Yet Another Special Case. In the DB Control Grid VCL sources, it registers a style hook thusly: TCustomStyleEngine.RegisterStyleHook( TDBCtrlGrid, TScrollingStyleHook); However, that's not what you would descend from if you want to write your own DB Control Grid VCL style hook. If you do, you get the whole control painted like a very large scrollbar. So how do you custom-theme

Join the discussion →

COUNT the related rows from a JOINed table in CodeIgniter [duplicate]

I have a query which grabs all users from the wait table based on $oneid. This works just fine but I would like to count how many messages a user leaves. These are in another table one_msg. function waiting_users($oneid) { $query_str = "SELECT a.user_id, b.email, b.username, b.fbook, c.user_id as saved_user, d.type as user_type, FROM wait a LEFT JOIN users b ON a.user_id=b.id JOIN user_profiles d ON a.user_id=d.user_id LEFT JOIN save_one c ON a.user_id=c.user_id AND c.one_id=? WHERE a.post_id = ? ORDER BY a.date ASC"; } $query = $this->db->query($query_str, array($oneid, $oneid)); one_msg tabl

Join the discussion →

Securing Uploaded Files (php and html)

I have a simple site which allows users to upload files (among other things obviously). I am teaching myself php/html as I go along. Currently the site has the following traits: When users register a folder is created in their name. All files the user uploads are placed in that folder (with a time stamp added to the name to avoid any issues with duplicates). When a file is uploaded information about it is stored in an SQL database. simple stuff. So, now my question is what steps do I need to take to: Prevent google from archiving the uploaded files. Prevent users from accessing the uploaded fi

Join the discussion →

Free tool to convert HTML to PDF file using .NET

I'd need to create a pdf version of my HTML pages using .NET 4.0. Is there any good free tool I can use? I've seen some commercial tools but not any good free ones; ITextSharp doesn't seem to be performing well or able to handle table formats, etc.

Join the discussion →

Fulltext search, no results?

I'm trying to implement a database search, by using match, against and fulltext indexing. So, when I did the search, it did not work as expect, no errors and no results was given. I'm querying by using Codeigniter. Here is my PHP query code: $clean_keyword = trim($keywords); //$keyword is passed to the function` $this->db->select('question, answer') ->from('QA') ->where('MATCH(question) AGAINST("'.$clean_keyword.'")', null, FALSE); $query = $this->db->get(); //execute the previous statement and save the result in a variable. No errors from codeigniter/MySQL was given. I tried to debug the $que

Join the discussion →

How do I ensure a select statement returns null values for specific columns?

I have a query that joins two tables. I'm using an IF statement that dictates what to return. One path runs the query/join as is, the other needs to return all of the data from the first column, but only return column names with null values. Here's the query I have now for that: declare @Date DATE = '06/07/2012' IF @DATE >= GETDATE() BEGIN SELECT DisplayName, '' [RegularHours], ''[OvertimeHours] FROM Sites ORDER BY DisplayName END ELSE SELECT sites.DisplayName, hrs.SiteDate, hrs.RegularHrs, hrs.OverTimeHrs FROM Sites sites left join SiteHours hrs on sites.SiteID = hrs.SiteID ORDER BY DisplayNa

Join the discussion →

Why can't I specify an environment variable and echo it in the same command line?

Consider this snippet: $ SOMEVAR=AAA $ echo zzz $SOMEVAR zzz zzz AAA zzz Here I've set $SOMEVAR to AAA on the first line - and when I echo it on the second line, I get the AAA contents as expected. But then, if I try to specify the variable on the same command line as the echo: $ SOMEVAR=BBB echo zzz $SOMEVAR zzz zzz AAA zzz ... I do not get BBB as I expected - I get the old value (AAA). Is this how things are supposed to be? If so, how come then you can specify variables like LD_PRELOAD=/... program args ... and have it work? What am I missing?

Join the discussion →

Using multiple libraries in Codeigniter

I'm trying to load multiple libraries in CI but I'm getting an error. Here is my controller function index() { $this->load->library('materials_library/File_Manager'); $this->load->library('materials_library/Layout'); $data = array(); // Send content to template $this->layout->view('materials_library/file_manager', $data, 'ml_cms'); } The error says view is an undefined property. If I comment out the first load->library, I don't get an error. How do I load multiple libraries in CI? EDIT: class File_manager { private $CI; public function __construct() { $this->CI =& get_instance(); } }

Join the discussion →

How do I declare and use variables in PL/SQL like I do in T-SQL?

In Sql Server, often times when I'm testing the body of a stored procedure, I copy the body into SSMS, DECLARE the variables at the top of the page, set them to some sample values, and execute the body as-is. For Example, if my proc is CREATE PROC MySampleProc @Name VARCHAR(20) AS SELECT @Name Then my test sql would be DECLARE @Name VARCHAR(20) SET @Name = 'Tom' SELECT @Name What is the Oracle PL/SQL equivalent to this? This is the closest that I've come up with, but I'm getting "PLS-00428: an INTO clause is expected in this SELECT statement" DECLARE myname varchar2(20); BEGIN myname := 'Tom';

Join the discussion →

Run C++ Code Online? [closed]

Is there a website I can go to to run C++ code online? I have seen a few compilers, but is there one that can also receive input from cin? I want one that can basically host a C++ .exe online, and even more preferable is if it is like the VC++ platform.

Join the discussion →

The member with identity ' ' does not exist in the metadata collection.\r\nParameter name: identity

I simplified the code a little while trying to debug: [HttpPost] public ActionResult Register(User model) { DateTime bla = new DateTime(2012, 12, 12); try { User user = new User { gid = 1, cid = 1, firstName = model.firstName, lastName = model.lastName, email = model.email, username = model.username, password = model.password, creationDate = bla, active = 1 }; myContext.Users.AddObject(user); myContext.SaveChanges(); } catch (Exception ex) { throw ex; } return View(); } The values are transmited accordingly. Users table: [id] [int] IDENTITY(1,1) NOT NULL, [cid] [int] NULL, [gid] [int] NULL, [f

Join the discussion →

Ant: How to set Environment Variables Using Ant

I have environment variables in a file called release.com as follows, echo "<<< OpenSplice HDE Release V5.5.1OSS For x86.linux2.6, Date 2012-05-23 >>>" if [ "$SPLICE_ORB" = "" ] then SPLICE_ORB=DDS_OpenFusion_1_6_1 export SPLICE_ORB fi if [ "$SPLICE_JDK" = "" ] then SPLICE_JDK=jdk export SPLICE_JDK fi OSPL_HOME="/usr/local/covidien/HDE/x86.linux2.6" OSPL_TARGET=x86.linux2.6 PATH=$OSPL_HOME/bin:$PATH LD_LIBRARY_PATH=$OSPL_HOME/lib:$LD_LIBRARY_PATH CPATH=$OSPL_HOME/include:$OSPL_HOME/include/sys:$CPATH OSPL_TMPL_PATH=$OSPL_HOME/etc/idlpp OSPL_URI=file://$OSPL_HOME/etc/config/ospl.xml . $OSPL_HOM

Join the discussion →

gnuplot to group multiple bars

I am using gnuplot to generate graphs for multiple benchmarks. For each benchmark I have many configurations to plot. I want to plot a graph hit-rate(my y-axis) vs benchmark(x-axis). There will be multiple columns for each benchmark differentiated by their color. I generated the same type of graphs some time back using some python script, but I don't know how to do this in gnuplot.

Join the discussion →

How are low-level libraries made?

When I go and make a C++ application I generally use libraries like SDL or WxWidgets and so on. But if I were to make a library would I need to use a library to make a library? Or can I make the entire library out of core C++ code, is this even possible? My point is that there must be a point were a library has nothing to base itself on and so the only things it can use are core C++. Am I right with this theory? If not, how are low-level libraries really made?

Join the discussion →

Importing data using SQLBulkCopy

We have a legacy application that is dumping large volumes of data to tab delimited files. Each file contains a single record type and all fields are fixed length. These files can readily be imported into corresponding tables in our SQL server database using the BCP utility from the command line. We have a VB.Net program written in VS 2003 that imports these files using the SQLDMO.BulkCopy routine. We are updating the system to use VS 2010 with SQL Server 2008 and according to the Microsoft documentation SQLDMO is no longer available. I have searched on the internet and have rewritten the impo

Join the discussion →

Implement PowerShell PSProvider *in* PowerShell

I'm looking to implement a PowerShell Provider in PowerShell. I keep thinking that if I just define the types, then import them into my session (import-module), I should be able to have them available. For example, this does not work but its along the path of what I'd like to implement. I'm obviously missing quite a bit...anyone know if this is possible? # EnvironmentProvider.ps1 $reference_assemblies = ( "System.Management.Automation, Version=1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" # "System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3

Join the discussion →

What do querySelectorAll() and getElementsBy*() methods return?

Do getElementsByClassName (and similar functions like getElementsByTagName and querySelectorAll) work the same as getElementById or do they return an array of elements? The reason I ask is because I am trying to change the style of all elements using getElementsByClassName. See below. //doesn't work document.getElementsByClassName('myElement').style.size = '100px'; //works document.getElementById('myIdElement').style.size = '100px';

Join the discussion →

Error in readRDS(file) : unknown input format

I am trying to install custom packages in my Rprofile.site file. I want to install packages in the site file because I have to install these packages on several users' computers. However, I am getting the following the error whenever I launch R. Error in readRDS(file) : unknown input format I have the following code added to the end of my Rprofile.site file. if(length(grep("customPackage", installed.packages()))==0) { install.packages("customPackage", repos=NULL, type="source") } The error keeps repeating itself as well until I stop the R session. If I remove that code from the site file and j

Join the discussion →

sgslufread: Hard error on read, OS error = 104 Linux

I'm getting an issue in LINUX when I do ldapsearch -p 6567 "iispsid=BBEU68843256" iispoffername Its giving error sgslufread: Hard error on read, OS error = 104 ldap_bind: Can't contact LDAP server The same works well in UNIX. What does this hard error mean?

Join the discussion →

Java ZIP - how to unzip folder?

Is there any sample code, how to practically unzip folder from ZIP into my desired directory? I have read all files from folder "FOLDER" into byte array, how do I recreate from its file structure?

Join the discussion →

How to find textbox in GridView using javascript function fired on “Onclientsideselectedindexchanged” of a radcombobox in same GridView RSS

I have two controls a TextBox and a radcombobox in ItemTemplate of a GridView. What I want to do is when the event onclientsideselectedindexchanges of radcombobox is fired. I want to show/Hide the TextBox on client side with JavaScript. Basic purpose of this is to avoid post back to show the TextBox which will be DataBound to database. If it is not possible to do on the client-side, then please suggest some alternative on server side.

Join the discussion →

How I can check my website work in Safari mobile?

I have made a website that's work fine on my computer (through all modern browser). Someone reported it's not worked from Safari mobile. I have tried to see from Safari on windows that's make me look same as I want. I have seen their screenshot and feel something wrong with my UI. Can someone have idea how I can check the look from my computer (windows). How I can test my website for safari mobile from my computer.

Join the discussion →

Connect active directory with the support of ssl (ldaps)

am trying to connect with active directory with the support of ssl. i tried the steps from following web site. http://confluence.atlassian.com/display/CROWD/Configuring+an+SSL+Certificate+for+Microsoft+Active+Directory when i try to connect active directory from the java code it gives following error. Exception in thread "main" javax.naming.CommunicationException: simple bind fail ed: 172.16.12.4:636 [Root exception is java.net.SocketException: Connection rese t] at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source) at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source) at com.sun.jndi.ld

Join the discussion →
Older stories