on-internet

Session.cookie_domain in php.ini

I have been reading as much as possible about the php.ini file and i have found nothing about whether or not its bad/dangerous to not set the session.cookie_domain in the php.ini. We are in a production environment and this is not set. Are there security issues with not setting this. Cookies appear to be working well, no real issues. The php.ini file looks like this: session.cookie_domain =

Join the discussion →

Using Bootstrap 3.0 How can I make my sidebar column span 100% width on mobile devices?

So I'm trying to setup a grid system for my responsive design so that on a desktop computer I have a main column on the left for content and a right side bar. I'm wanting the sidebar though to span 100% of the screen if it's on a mobile device though. I'm using the example show at the bootstrap site here: http://examples.getbootstrap.com/grid/ at the bottom of the page -- or shown below... <div class="row"> <div class="col-12 col-sm-8 col-lg-8">main content</div> <div class="col-6 col-sm-4 col-lg-4">right side bar</div> </div> The main content column spans 100%, but the right side bar column d

Join the discussion →

Efficient calculation of Fibonacci series

I'm working on Project Euler problem 2: the one about the sum of the even Fibonacci numbers up to four million. My code: def Fibonacci(n): if n == 0: return 0 elif n == 1: return 1 else: return Fibonacci(n-1) + Fibonacci(n-2) list1 = [x for x in range(39)] list2 = [i for i in list1 if Fibonacci(i) % 2 == 0] The problem's solution can be easily found by printing sum(list2). However, it is taking a lot of time to come up with the list2 I'm guessing. Is there any way to make this faster? Or is it okay even this way... (the problem: By considering the terms in the Fibonacci sequence whose values d

Join the discussion →

video.js size to fit div

I have a video in a div with a 40% width. In the html, width="100%" height="auto" makes the video disappear. Setting a specific size in pixels won't fit the div. Leaving the html blank leaves the video the wrong size and with black bars on the sides. I've tried the suggestions in most other posts, but can't seem to get it to work. <div id="box"><video id="trialvid" class="video-js vjs-default-skin" controls preload="auto" width="auto" height="auto" poster="images/reelthumbnail.jpg" data-setup='{"example_option":true}'> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'

Join the discussion →

Data noise with PCA for dimension reduction

I have a question related to data noise and principal component analysis (PCA). Situation I have a data matrix containing X, Y, Z joint data. I have applied PCA, with the stipulation of retaining 98% of the variance. However, even after reduction the data still remains very noisy. Problem I have spent a few hours reading, and I'm unsure of the best approach to take. I need to perform PCA for dimension reduction. However, the noise present in the dataset still presents several issues. I need an intermediate step before applying PCA to reduce the noise contained in the dataset. I have been advis

Join the discussion →

Data noise with PCA

I have a question related to data noise and principal component analysis (PCA). Situation I have a data matrix containing X, Y, Z joint data. I have applied PCA, with the stipulation of retaining 98% of the variance. However, even after reduction the data still remains very noise. Problem I have spent a few hours reading, and I'm unsure of the best approach to take. I need to perform PCA for dimension reduction. However, the noise present in the dataset still presents several issues. I need an intermediate step before applying PCA to reduce the noise contained in the dataset. I have been advis

Join the discussion →

A more accurate data type than float or double?

Does C++ have a more accurate data type than float or double, or do I just have to settle for the fact that my calculations will be off? EDIT: As Mr. Lister has pointed out, my question is regarding the precision. It's a bit frustrating when you add two floats/doubles together and the number is off half the time comparing to the calculation done by hand.

Join the discussion →

Blocking request in Chrome

I'm trying to block some requests in a Chrome app. I created a JavaScript listener that does this validation: chrome.webRequest.onBeforeRequest.addListener( { urls: ["*://site.com/test/*"] }, ["blocking"] ); But the requests are not blocking. Did I miss something in this code? My manifest: "background": { "scripts": ["listener.js"], "persistent": true }, "permissions": ["tabs", "http://*/*"], "manifest_version": 2,

Join the discussion →

Toggle class with animation

I want to have something like this : $('#fo').toggleClass('tra', 'slow'); I know that i can achieve this with jQuery UI but i'm looking for a faster and smaller solution because i don't wanna integrate in my site another 20-90 kb

Join the discussion →

How to parse xml namespaces with DOMDocument and be sure to get objects [duplicate]

I'm trying to parse a xml response from other server. I can get my needed objects from that xml. but some times and some how, I cant get some objects. and this error appears. Fatal error: Call to a member function getElementsByTagName() on a non-object in line 91 I checked every thing and I think there is nothing wrong. here is an example xml response: <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="http://epp.nic.ir/ns/domain-1.0"> <response xmlns:domain="http://epp.nic.ir/ns/domain-1.0"> <result code="1000"> <msg>Command completed successfully</msg> </result> <resData xmlns:domain=

Join the discussion →

SMTP 535 5.7.0 Error: authentication failed

I used SMTP protocol for sending email in my system.The system is developed with Codeigniter.in the system two types of email sending functionality, one is from codeigniter Email libraries and other is from swift mailer.In codeigniter it is working but in swift mailer an authentication failure message is shown. Both functions use same login details.The port used is 25.

Join the discussion →

Computing a correctly rounded / an almost correctly rounded floating-point cubic root

Suppose that correctly rounded standard library functions such as found in CRlibm are available. Then how would one compute the correctly rounded cubic root of a double-precision input? This question is not an “actual problem that [I] face”, to quote the FAQ. It is a little bit like homework this way. But the cubic root is a frequently found operation and one could imagine this question being an actual problem that someone faces. Since “best Stack Overflow questions have a bit of source code in them”, here is a bit of source code: y = pow(x, 1. / 3.); The above does not compute a correctly rou

Join the discussion →

Android record and playback

I am currently trying to build an amplifier for the Android. The goal is to record and playback what is being recorded simultaneously. I created a thread that would take care of this. However, the sound comes out choppy. Here is what I tried. private class RecordAndPlay extends Thread{ int bufferSize; AudioRecord aRecord; short[] buffer; public RecordAndPlay() { bufferSize = AudioRecord.getMinBufferSize(22050, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT); buffer = new short[bufferSize]; } @Override public void run() { aRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, 220

Join the discussion →

How to convert blob image into binarybase64 in java?

I have image in blob format from DB , i am holding that blob image in byte array and converting it to Binary Base64 format. For encoding the blob to binary base 64 I am using below code, byte[] imageByte = getblob();//from DB byte[] encodedImage = Base64.encodeBase64(imageByte); is there any other way to do it or am doing it in right way please help me?

Join the discussion →

Uploadify not showing progress on Firefox Mac

While reviewing my website code, I've noticed that my uploadify is working fine on all browsers except for Firefox, and this is only happening on Firefox which is on a MAC machine. It is very odd, but the files are actually uploading fine, its just that the loading progress bar % does not increase and stays at 0 until the script is actually completed. Code is the same for all browsers and it is even working in IE 8. Ive tried on all browsers, PC and mac. I have used the onUploadProgress callback function 'onUploadProgress' : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBy

Join the discussion →

bad argument to internal function error in python

I have a python script that uses ReportLab to create a report, the script has been tested and works as expected however on occasions I get the following error message TraceBack info: File "C:\tools\LegionellaTool.py", line 605, in <module> createReport(selectedCoolingTowers, Report_outputs_folder, dbo_COLGIS, openPDF) Error Info: ..\Objects\moduleobject.c:50: bad argument to internal function Line 605 is createReport(selectedCoolingTowers, Report_outputs_folder, dbo_COLGIS, openPDF) createReport is the function that ...creates the report. I have debugged through the code and I havent got any e

Join the discussion →

Web service call through JS, DataType Json

I am trying to call web service through a JS but anyhow it doesnt get call. I am trying to make sum of 2 number. Page contains of 3 textbox and it has it text set hard codded as : <form id="form1" runat="server"> <div> <asp:TextBox ID="Text1" Text="5" runat="server"> </asp:TextBox> <asp:TextBox ID="Text2" Text="2" runat="server"> </asp:TextBox> <asp:TextBox ID="Text3" runat="server"> </asp:TextBox> </div> </form> My code are as follows: <script type="text/javascript"> $(document).ready(function () { debugger; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "C:/Users

Join the discussion →

How to find whether the ip address is proxy/vpn/vps

I have a hosted web application, I would like to prevent signup from proxy/VPN/VPS ip address. How do i check whether the users ip address is proxy/vpn/vps syste. For example clixsense.com site, users can't create account, it shows cannot access from proxy/vpn/vps ip address. Thanks in advance.

Join the discussion →

Some std::unique_ptr uses and "gotchas"

What are some of C++11 std::unique_ptr uses and gotchas? Can I use std::unique_ptr also to store dynamically allocated arrays? Can I use std::unique_ptr also with resources using a custom deletion mechanism?

Join the discussion →

How to send a request (and receive it) in XML format from some web-service?

I'm working in a E-Commerce website, with JSF 2. In order to communicate with the company that makes all the operation with the banks, I need to send this XML to them (it's just a sample provided from them): <?xml version="1.0" encoding="ISO-8859-1"?> <requisicao-transacao versao="1.2.0" id="6560a94c-663b-4aec-9a45-e45f278e00b4" xmlns="http://ecommerce.cbmp.com.br"> <dados-ec> <numero>1001734898</numero> <chave>e84827130b9837473681c2787007da5914d6359947015a5cdb2b8843db0fa832</chave> </dados-ec> <dados-pedido> <numero>1603662828</numero> <valor>100</valor> <moeda>986</moeda> <data-hora>2010-07-

Join the discussion →

ViewDidLoad not called when adding to Container View

I have a container view set up in my storyboard file but I want to embed the view controller programmatically after setting some properties. This is my code in the parent VC's viewDidLoad: _workoutVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"entryTableVC"]; _workoutView = _workoutVC.tableView; [self addChildViewController:_workoutVC]; [_workoutVC.tableView setFrame:_container.bounds]; [_container addSubview:_workoutView]; However, viewDidLoad in the child is not called at any time. When I run the simulator my container view is blank. I've

Join the discussion →

jquery how to clear out modal input fields for reuse

I have a modal form using jquery and twitter bootstraps. I have set up the modal so when the person cancels the form, / closes the modal i clear out the input fields. however if the person activates the modal again and enters values in to the fields, the dom still sees the field value as null. here is my form html <div class="modal fade in" id="forgotPassModal" data-b-view="ForgotPass" data-brite-cid="bview_1" tabindex="-1" aria-hidden="false" style="margin-top: -152.66666662693024px;"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</bu

Join the discussion →

Spring Scheduler stops unexpectedly

We have a Spring 3 web application on Tomcat 6 that uses several scheduled services via @Scheduled (mainly for jobs that run every night). Now it appears that sometimes (rarely, perhaps once in two months or so) the scheduler thread stops working, so none of the jobs will be executed in the following night. There is no exception or logging entry in our log files. Has anybody a clue why this is happening? Or how to get more information about this problem? Is there a way to detect this situation within the application and to restart the scheduler? Currently we are solving this by having also a l

Join the discussion →

audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) returns 0

I am making an Speaking caller name application which pause the ringtone before speaking the caller name using TextToSpeech. I am detecting the current Volume using int musicVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); Mostly this returns 0 but sometimes 15 the correct value. The phone is in normal mode and the volume of phone is full. I need this value to correctly speak the caller name but this unpredictable behaviour is making me crazy. What wrong am i doing? Isn't this the correct way to detect ringtone volume?

Join the discussion →

Connection Information for Oracle SQL Developer database

I'm new to Oracle, and I have installed Oracle Database 11g. When I open some connection on Oracle SQL Developer, I get a dialog where I've to enter the username and the password as the following : The problem is that I don't knwo what is the username and the password, in the installation I choosed orcl as the Username and orcl as the password but when I enter them I get the error message : How can I solve this problem ? I've another question : what is this page https://localhost:1158/em and why I get Page Web Inaccessible when I acces to it. EDIT 1 : This is the content of the listener.ora fi

Join the discussion →

How to update DataGridView real time execution?

My DataGridView displays information that is entered on another system. As the user insert, update or delete any information, the DataGridView should be updated right now. I thought about using a recursive method or thread background, but it did not help. My code is: private void Andon_Load(object sender, EventArgs e) { LoadGrid(); } private void LoadGrid() { DataTableWorkCall cdtwc = new DataTableWorkCall(); DataTable dtPBList = new DataTable(); dtPBList = cdtwc.CreatePendingWorkCall(); DataTableWorkCall.GetDataTableNew = dtPBList; if (DataTableWorkCall.GetDataTableNew != DataTableWorkCall.Ge

Join the discussion →
Older stories