on-internet

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 →

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 →

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 →

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 →

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 →

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 →

Problems in avro schema .. String, null

In this avro schema {"type": "record", "name": "Member", "fields": [ {"name": "name", "type": ["string", "null"] }, {"name": "skill", "type": "string"} ]} When I try to assign multiple values to name like multiple records ... ByteArrayOutputStream bos=new ByteArrayOutputStream(); Encoder e= EncoderFactory.get().binaryEncoder(bos, null); GenericRecord rec=new GenericData.Record(schema); GenericDatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(schema); for(int i=0;i<memlist.size();i++) { rec.put("name", memlist.get(i).name); rec.put("skill", memlist.get(i).skill); da

Join the discussion →

Multiple layers of drop down menus for EXCEL

I want cell A1 to be a drop down menu (which I know how to do), and then cell B1 to be a drop down menu based off that initial selection. Example: If I select in A1 "Entertainment," in B1 I want a drop down menu that lets me select "Movies, Music, Sport". But if I select in A1 "Food," in B1 I want a drop down menu with "Dairy, Veggies, Fruit, Meat" etc. I know basic coding, but I'm mostly looking to use Excel's capabilities. Thanks! - Laura

Join the discussion →

Instruction Level Profiling: The Meaning of the Instruction Pointer?

When profiling code at the the assembly instruction level, what does the position of the instruction pointer really mean given that modern CPUs don't execute instructions serially or in-order? For example, assume the following x64 assembly code: mov RAX, [RBX]; // Assume a cache miss here. mov RSI, [RBX + RCX]; // Another cache miss. xor R8, R8; add RDX, RAX; // Dependent on the load into RAX. add RDI, RSI; // Dependent on the load into RSI. Which instruction will the instruction pointer spend most of its time on? I can think of good arguments for all of them: mov RAX, [RBX] is taking probably

Join the discussion →

Youtube Content Partner API Documentation

Trying to find the documentation for the YouTube Content partner API. I am a content partner and I'm working with a developer to create a system, we're able to make content owner report calls on the analytics API, so I know my authentication works and I'm allowed to view and turn on the Content Partner API in the API console. I really need to do the following: "The YouTube Content Partner API allows the management of YouTube assets along with their associated content, references, ownership, rights and policies." but when I click through to Learn more the URL https://developers.google.com/youtu

Join the discussion →

get selected values of MultiSelect Picklist in VisualForce

I have multiselect picklist and I want to get selected values for insert and update operation. <apex:page standardController="Change_Request__c" sidebar="false" extensions="Change_RequestController"> <apex:selectList label="Select Pasenger(s)" value="{!Change_Request__c.Passenger_Name__c}" multiselect="true" onfocus="getSelectedID('{!$Component.empid}');" > <apex:selectOptions value="{!pax}" /> </apex:selectList> And this is my extension: public class Change_RequestController { private final Change_Request__c changer; public List<selectOption> pax; public Change_RequestController(ApexPages.Sta

Join the discussion →

How to Print a .rdlc in ASP.net when button click

I have an web application that when an user clicks on a button it prints an .rdlc directly to the printer without the Print Dialog box. This works fine when I run it local, but when I uploaded it to the intranet is not working at all. Can someone explain how to make this work in the intranet? UPDATE private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek) { Stream stream = new MemoryStream(); m_streams.Add(stream); return stream; } private void Export(LocalReport report) { string deviceInfo = "<DeviceInfo>" + " <OutputFormat>EMF</Out

Join the discussion →

Why is there no tuple comprehension in Python?

As we all know, there's list comprehension, like [i for i in [1, 2, 3, 4]] and there is dictionary comprehension, like {i:j for i, j in {1: 'a', 2: 'b'}.items()} but (i for i in (1, 2, 3)) will end up in a generator, not a tuple comprehension. Why is that? My guess is that a tuple is immutable, but this does not seem to be the answer.

Join the discussion →

add command INSIDE batch file to generate text log (launched by double click)

Advanced thanks to anyone who is stopping by to read this. Here's my scenario: SCENARIO OS is w7px64. I have not worked with .bat files before, but have some familiarity with cmd. I've created a successful .bat file with several dozen commands, modifying processes, services, scheduled tasks, and power schemes (using commands such as SC, net stop, schtasks, powercfg, etc.). I will always launch the .bat by double-clicking in Windows Explorer (will never initiate launch from within CMD itself). The file ends with a pause command, to keep cmd window open after completion of all tasks, enabling me

Join the discussion →

Response time for urllib in python

I want to get response time when I use urllib. I made below code, but it is more than response time. Can I get the time using urllib or have any other method? import urllib import datetime def main(): urllist = [ "http://google.com", ] for url in urllist: opener = urllib.FancyURLopener({}) try: start = datetime.datetime.now() f = opener.open(url) end = datetime.datetime.now() diff = end - start print int(round(diff.microseconds / 1000)) except IOError, e: print 'error', url else: print f.getcode(), f.geturl() if __name__ == "__main__": main()

Join the discussion →

Is there any way to configure .htaccess to write to access.log file which is already handled by apache2.config?

We have hosted our website with external agency, in the Linux environment. Now we have added cookies in our website code and want to track cookie in access.log. when we requested with our domain host provider they turn down the request to modify apache2.config file, instead they suggested to use .htaccess file to enable cookie in access.log. Right now we do not want to use any other method to log cookie other than .htaccess file. We did not find any solutions to enable cookie in access.log using .htaccess file. We need following questions to be answered. Is it possible to use .htaccess file to

Join the discussion →

Server sent unexpected return value (500 Internal Server Error) on SVN commit

I can update SVN well, but when I try to commit, I'm getting the following error: Error while performing action: Commit failed (details follow): Server sent unexpected return value (500 Internal Server Error) in response to PUT request for '/svn/!svn/wrk/89ff070d-5fb0-4a77-9609-0fd87964d712/project/trunk/templates/operator/default/settings.tpl' Any idea why I can't commit? Other team members can commit without trouble.

Join the discussion →

How do I change Ctrl to Spacebar for these three commands?

I want to change the use of Ctrl to Spacebar for three commands in a game but not for everything because then I can't use Spacebar to communicate. The normal commands are Ctrl+Q, Ctrl+W, Ctrl+E, Ctrl+R and Ctrl+RMB. I'm using Space::Ctrl with no result. The code below sent the keys how I wanted, but each shortcut triggered all shortcuts that followed. For example Spacebar+E triggers Spacebar+E, Spacebar+R and Spacebar. Also Spacebar still didn't work. I added Space::Space and can get a text space only by using the Spacebar+Q, W, E or R. SendMode Input SetKeyDelay ,0,30 #IfWinActive ahk_class R

Join the discussion →
Older stories