on-internet

How to tell number of rows changed from JDBC execution

I'm uncertain as to how to get the number of rows affected from a SQL execution. I do like this: boolean isResultSet = statement.execute(arbitrarySQLCommand); and I can get the number of rows affected from the getUpdateCount() method. That is all fine. The problem I have is when update count is zero. This can either mean: It was a DML statement but it didn't affect any rows. Zero rows affected is a valid response. I just means that some condition was not met. It was a non-DML statement (DDL statement most likely) .. which by definition does not change rows so therefore update count is always z

Join the discussion →

Video.js - Autoplay and Loop not working on phone

I use this code to make a video (eg. banner, so no controls) autoplay and loop forever. <video id="video1" class="video-js vjs-default-skin" controls width="900" height="500" poster="myposter.jpg" data-setup='{ "controls": false, "loop": "true", "autoplay": true, "preload": "true"}'> <source src="thisismyvideoyay.webm" type='video/webm' /> </video> It works fine on my computer but on my phone (Android OS 4.2.2 with Chrome) it's not autoplaying or preloading and not looping after it finished. I read this on Video.js page: Auto: Start loading the video immediately (if the browser agrees). Some m

Join the discussion →

How does the combined ticket work in Agra?

I've read that when you buy a ticket to entry to the Taj Majal you get a "INR 500 for a one-time composite toll levied by Agra Development Authority for Taj Mahal, Agra Fort, Itimadi-ud-daula, Akbar’s Tomb, Sikandara and Fatehpur Sikri". How does it work? It means that if I pay 750 INR to get into the Taj Majal I don't have to pay to enter in the other places? And if that's true, I have to go the same day or the entrance is valid for the next day?

Join the discussion →

How to track down "Connection timout during SSL handshake" and "Connection closed during ssl handshake" errors

I have recently switched over to HAProxy from AWS ELB. I am terminating SSL at the load balancer (HAProxy 1.5dev19). Since switching, I keep getting some SSL connection errors in the HAProxy log (5-10% of the total number of requests). There's three types of errors repeating: Connection closed during SSL handshake Timeout during SSL handshake SSL handshake failure (this one happens rarely) I'm using a free StartSSL certificate, so my first thought was that some hosts are having trouble accepting this certificate, and I didn't see these errors in the past because ELB offers no logging. The only

Join the discussion →

Broadcast receiver push notification

I have implemented push notification in my android application: In my main class: // PUSH Parse.initialize(this, applicationId, clientKey); PushService.setDefaultPushCallback(this, SlidingMenuActivity.class); ParseInstallation.getCurrentInstallation().saveInBackground(); ParseAnalytics.trackAppOpened(getIntent()); In my manifest.xml: <!-- PUSH --> <service android:name="com.parse.PushService" /> <receiver android:name="com.parse.ParseBroadcastReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.USER_PRESENT" /> <

Join the discussion →

What is the maximum file path allowed in Android

The question here talks about file name length limit, I'm interested in the overall permitted path length (if it matters). There's this filesystems limits table here, though I'm not sure which applies to Android of which version.

Join the discussion →

Tkinter -- "window is not defined"

I am a newbie in Python GUI's so I am using an online tutorial. When I run the following code, I get an error saying 'window' is not defined. I am using a Windows PC with Windows 7 and Python 3.3 installed. from tkinter import * window.title("Test Window") window.geometry('300x300') window.wm_iconbitmap('Generals.ico') # Generals.ico is a filename for the window icon lbl = tkinter.Label(window, text='Label') lbl.pack() window.mainloop()

Join the discussion →

window.opener undefined in JavaScript popup after redirect

I have a problem with a website that displays a payment dialog using window.open(). The page in the popup redirects to a different domain that redirects back to a result page. On the result page, I try to set a property on window.opener to signal that the payment is ok. This works for some users. Other users, however, get an error saying that window.opener is undefined. The problem can the recreated using these simple pages: index.html (Opens the popup) <!DOCTYPE html> <html lang="en"> <body> <input type="button" value="Popup" onclick="openPaymentWindow();" /> <div id="result" style="backgroun

Join the discussion →

getting ld to ignore undefined references when making a DLL

I'm trying to get gcc's ld to ignore unresolved references when putting together a shared library from a bunch of object files compiled with -fpic flag. I tried a bunch of options so far such as (replaced the long file names of the many object files with a few small ones for brevity): ld --allow-shlib-undefined --unresolved-symbols=ignore-all -shared 1.o 2.o -o lib0.so ld -G 1.o 2.o -o lib0.so (I've red somewhere that -G will allow unresolved references, but had no luck with it.) Running it though gcc (with -Wl,--unresolved-symbols=ignore-all) results in fewer unresolved references as it links

Join the discussion →

What open-source renderers are available for 3D photo-realistic rendering with features like diffusion and ray-tracing?

I want to create a photo-realistic, static rendering of a room's interior. I want to know what options I have for open-source renderers. It does not have to render quickly. Initially I experimented with sketchup and photo renderer plugins, but they are costly and in my opinion clunky compared to what could be done with programming, plus features and quality seem to be hit-and-miss. I need the following capabilities: Diffusion e.g. translucent frosted glass Material tint e.g. tinted car windows Reflections Mirror-like: e.g. Coloured materials with a semi-reflective, smooth surface Diffuse refle

Join the discussion →

3D photo-realistic rendering: Diffusion, ray-tracing

I want to create a photo-realistic, static rendering of a room's interior. I want to know what options I have for open-source renderers. It does not have to render quickly. Initially I experimented with sketchup and photo renderer plugins, but they are costly and in my opinion clunky compared to what could be done with programming, plus features and quality seem to be hit-and-miss. I need the following capabilities: Diffusion e.g. translucent frosted glass Material tint e.g. tinted car windows Reflections Mirror-like: e.g. Coloured materials with a semi-reflective, smooth surface Diffuse refle

Join the discussion →

php codeigniter MySQL search query

I want to create a search query on MySQL database that will consist of 5 different strings typed in from user. I want to query 5 different table columns with these strings. When I for example have input fields like: first name, last name, address, post number, city. How should I query the database that I dont always get all the rows. My query is something like this: SELECT user_id, username from users where a like %?% AND b like %?% AND c like %?% AND d like %?% AND e like %?%; When I exchange the AND for OR I always get all the results which makes sense, and when I use AND I get only the exac

Join the discussion →

Multiple catch statements with the same exception types

I've been looking all over for an answer to this and have yet to find one. Basically I am trying to connect to a database server through a GUI. My boss wants to be able to enter all fields and then check to see if they are valid entries, then if there are any invalid entries, he wants me to turn the text red, indicating that the field is invalid. I have the try statement catch ClassNotFoundException and SQLException. Because there are multiple fields that need to be checked, I have tried to have a set of if statements to check the connection info. Here is the code below, I hope this makes sens

Join the discussion →

Python inspect.stack is slow

I was just profiling my Python program to see why it seemed to be rather slow. I discovered that the majority of its running time was spent in the inspect.stack() method (for outputting debug messages with modules and line numbers), at 0.005 seconds per call. This seems rather high; is inspect.stack really this slow, or could something be wrong with my program?

Join the discussion →

How to open new tab instead of new window in Chrome in java scripts

Using this below code I am able to open new tab along with the URL..in Firefox..but same code when I am trying to open in Chrome its opening new window which I don't want new window ..I want new tab in case of chrome Here is my code: > window.open(this.getJavaURL + ((this.returnPage != null) ? ('&returnPage=' + this.returnPage) : '') + ((this.locale != null) ? ('&locale=' + this.locale) : '') + ((this.brand != null) ? ('&brand=' + this.brand) : ''),'_new'); Can you please help me..

Join the discussion →

Asterisk to asterisk call: 403 Forbidden

I have 2 servers with Asterisks on them: 192.168.241.98 and 192.168.243.112. There is a valid registration on the first: register => wagateway:[email protected]:5060 CLI output: CLI> sip show registry Host dnsmgr Username Refresh State Reg.Time 192.168.243.112:5060 N wagateway 105 Registered Wed, 26 Jun 2013 16:42:42 And peers on 243.112 are just fine: CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status Description wacaller/wacaller 192.168.242.235 D a 5062 OK (13 ms) wagateway/s 192.168.241.98 D a 5060 OK (1 ms) extensions.conf on 243.112: [watest] exten => 123123123,1,

Join the discussion →

Is there a way to auto-adjust Excel column widths with pandas.ExcelWriter?

I am being asked to generate some Excel reports. I am currently using pandas quite heavily for my data, so naturally I would like to use the pandas.ExcelWriter method to generate these reports. However the fixed column widths are a problem. The code I have so far is simple enough. Say I have a dataframe called df: writer = pd.ExcelWriter(excel_file_path, engine='openpyxl') df.to_excel(writer, sheet_name="Summary") I was looking over the pandas docs, and I don't really see any options to set column widths. Is there a trick to make it such that the columns auto-adjust to the data? Or is there so

Join the discussion →

Scrolling not working in the mobile version

I'm working on a Javascript project. I created a div with an overflow and I would scroll that div using the mouse only (without the bar). I followed this working example both on the browser and both on the mobile versions. Here is my HTML code: <div id="wrapper"> <div id="scroller"> ... divs, boxes generated by jQuery ... </div> </div> And here's the CSS: #wrapper { margin-left: 45px; position: absolute; width: 900px; overflow: hidden; } #scroller { width: 100%; height: 100px; margin: 0px auto; overflow: auto; } Now the problem is that this works on the browser but does not in the mobile (no s

Join the discussion →

Woocommerce show shipping methods in checkout page?

I am using woocommerce plugin for wordpress. Everything in woocommerce is fine. Only in one thing where I am totally strucked. In checkout page I want to show all the shipping methods in list format. Here with I have attached the screenshot for the shipping method that I want. I have gone through many settings but I am not getting the result. So any help and suggestions will be really appreciable. Thanks

Join the discussion →

Unable to resolve the request yii

I am new in Yii and sorry to say that anyone help me please that why the controller employeController.php not called , I check and set many files permission etc , Here is my url http://dxb.softmatics.com:81/erp/index.php/employe/index Controller : /.........for on board controller..../ class employeController extends Controller{ /** * Declares class-based actions. */ public function actions() { return array( 'page'=>array( 'class'=>'CViewAction', ), ); } /** * for index page */ public function actionIndex() { echo 'in index'; exit; } }//...end of class If any thing else I will show you my code

Join the discussion →

Convert geoTIF to ascii/text using R?

I'm trying to get time-series global estimates of net primary productivity from here, download them to a remote, US-based machine, machine (I am in Kenya with slow, cell phone internet), convert them from their current format to ascii, coarsen them using a function like this: coarsen = function(input,size_out){ if (dim(input)[1] != dim(input)[2]) {print("Matrix not square.")} else { dimsize = dim(input)[1] fac = dimsize/size_out x = suppressWarnings(matrix(c(rep(1, fac), rep(0, dimsize)), dimsize, dimsize/fac)) t(x) %*% input %*% x} } and then download them so that I can work with them. Is thi

Join the discussion →

GIT refs/heads/master does not point to a valid object

Here's my problem: I create a new git repository named 'project'. It has some files in it. I clone that repository with: git clone --bare project project.git Git tells me: Cloning into bare repository 'project.git'... done. error: refs/head/master does not point to a valid object! I do get a directory named project.git but if I go on with: git init --bare --shared project.git git clone project.git project2 Git tells me: Cloning into 'project2'... warning: You appear to have cloned an empty repository. done. So I now have no files in the cloned repository: 'project2'. I first encountered this p

Join the discussion →

Joomla $app->redirect() in template index.php causing a redirect loop

I am attempting to redirect in a template index.php i am building and getting a redirect loop. Am I missing something? What I am attempting to do is redirect the default page depending on the entry URL as well as certain template styles. My template code looks something like this... config.php <?php //joomla configuration JLoader::import('joomla.filesystem.file'); JHtml::_('behavior.framework', true); JHtml::_('jquery.framework'); $app = JFactory::getApplication(); $config = JFactory::getConfig(); $doc = JFactory::getDocument(); //load template style sheets and scripts $doc->addStyleSheet($thi

Join the discussion →

"Error retrieving information from server RPC S-7 AEC-0" while testing Google in-app billing

I am trying to implement Google in app billing to my Application. I created SKU product id and implemented the billing process in code. While I am trying to test the in-app billind after I enter all the test account details, location, phone no etc and clicking save button it gives the error "Error retrieving information from server RPC S-7 AEC-0". I too published the app created the test account and signed in to the device with test account. Can any one please help me to fix this. I am totally messed up....

Join the discussion →

Find a specific string in an Excel file using Apache POI API

I'm new to Apache POI API for reading MS Office documents, but good at Java. I want to search a specific string from an Excel File. I'm doing in this way: private void processExcelFile(File f_path) throws Exception{ File path=f_path; try{ FileInputStream is=new FileInputStream(path); HSSFWorkbook wb = new HSSFWorkbook(is); HSSFSheet sheet = wb.getSheetAt(0); int rowcount_post=0; int rowcount_304=0; for(Row row: sheet){ for(Cell cell : row){ if (cell.getCellType() == Cell.CELL_TYPE_STRING){ if (cell.getRichStringCellValue().getString().trim().equals("GET")){ rowcount_post=row.getRowNum(); HSSFR

Join the discussion →

How to get lyrics from Musixmatch

I have a webradio and and the player gives me the song name and song artist I read those two in a jQuery var like this: <script> $('#GetLyrics').on('click', function(ev) { songArtistTitle.value = jQuery('#artist').text() + ' - '+ jQuery('#title').text() + jQuery('#year').text(); . . "#artist" and "#title" are 2 divs that are auto updated by the player the Musixmatch API its going like this: http://api.musixmatch.com/ws/1.1/track.search?apikey=***&q_track=Dire%20straits%20Sultans%20of%20Swing&page_size=10 and returns the list of songs with "track_id":3867545, and then you must get the lyrics wi

Join the discussion →

Video.js enter fullscreen on play

I've been searching around for a long time but still haven't found a valid solution for my problem. I just cant seem to get the video player to enter fullscreen. The API does have many examples but none of them seem to work. The jQuery version included on the page I am currently working on is 1.8.2. Also, I am using parallax-1.1.js and libraries required for it to work properly so that may also be an issue. The client I am working for wants the site to have responsive design, with the ability of the player to directly go to fullscreen when the "Play" button is clicked. This functionality shoul

Join the discussion →

startPreview failed but not all devices

I'm getting an error startPreview failed but not all devices. In Motorola RAZR and Samsung Galaxy S3, it's working very well. Some people told me they got the same problem in other devices (Galaxy SII Lite, Galaxy Ace Duos, Samsung Galaxy Y, etc) I'm trying to test in a Samsung Galaxy Y and here's what I got in Logcat java.lang.RuntimeException: startPreview failed at android.hardware.Camera.startPreview(Native Method) at br.com.timo.tubagram.CameraSurfaceView.surfaceCreated(CameraSurfaceView.java:47) at android.view.SurfaceView.updateWindow(SurfaceView.java:601) at android.view.SurfaceView.up

Join the discussion →

Downloading Files from SFTP using jsch

I am using JSCH to download files from SFTP server. I am using single session, with multiple channels to download files from different folders located in SFTP. For this downloading process I have a set of scheduled jobs. Each job will: open a new channel (ChannelSftp) everytime. channel name : sftp uses method ChannelSftp.ls() to get the size of total number of files to download If size(Vector) is greater than zero then uses ChannelSftp.get(remotedir/'*.*', localdir) to download all the files finally closes the opened channel. During the above process most of the times I am getting File Not Fo

Join the discussion →
Older stories