on-internet

Which CSS rules are ignored when flexbox is active?

How can I configure flexbox to have a nice fallback? Say I have this: .parent{ display: flex; flex-flow: row wrap; width: 320px; border: 1px solid black; } .children{ text-align: center; flex: 1; background: #DDD; } <div class="parent"> <div class="children">1</div> <div class="children">2</div> <div class="children">3</div> </div> What rules am I allowed to add to have a nice fallback for older browsers and that they get completely ignored and don't disturb flexbox. Notice I don't ask for a polyfill or anything, I just want something that fallbacks to something similar. It would be nice to kn

Join the discussion →

Can you give helpers a variable and change the function it uses in CodeIgniter

I am creating a form and I want to make a custom error log, for example when the user leaves e-mail empty, I want to give my error_helper the variable email, sending to the user that they did not fill in this variable and log that they left this empty. I am a starter with codeIgniter and I've read the manual but I did not find anything helpful. Here is my code: public function submitCheck() { $this->load->model("User"); if(empty($post['email'] || 'email'=="")) { echo "Email is empty."; //This will be changed to a view for user $this->load->helper('error'); //Loading the helper errorLog('Firstn

Join the discussion →

How to upgrade apache 2.2.15 to apache 2.4.12 on CentOS 6.6?

I tried ,but didn't work for me. Apache 2.4 on CentOS 6.6: Step 1: cd /etc/yum.repos.d/ wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo Step 2: yum install httpd24.x86_64 Step 3: $ /opt/rh/httpd24/root/usr/sbin/httpd -version Server version: Apache/2.4.6 (Red Hat) Server built: Sep 25 2013 05:25:46 NOTE: config files are in: /opt/rh/httpd24/root/etc/httpd $ ls conf conf.d conf.modules.d logs modules run EDIT: in case you want to switch off Apache 2.2 $ chkconfig httpd off $ chkconfig --list | grep httpd httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off httpd24-httpd 0:

Join the discussion →

Why GoogleAuthUtil.getToken() method generate two types of tokens?

I am integrating Google sign in my Android app. I am using newly mentioned Google+ signin API and am able to get user name, email, profile photo for my app. But when I call the GoogleAuthUtil.getToken() with different parameters I get two kinds of tokens. One is base64 encoded idToken (I think it is JWT or JSON Web Token) but another one generate a token looks different and shorter. Why this this happening? If I use String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient); Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); String scopes = "audience:ser

Join the discussion →

Implicit conversion of TEXT to varchar/nvarchar

I have a rather large historical table that is now slowing down my users. One of the big things I did that will alleviate the issue is converting the text fields to nvarchar(max) or varchar(max) fields. I am going with nvarchar because of Unicode/conversion issues that may arise. My question is, will the front end, if declaring an explicit TEXT value, be implicitly converted when inserting into the table? I am wondering as the fields are implicitly converted using an ALTER TABLE statement that I used for the initial conversion. This table is used in rather a great many places and putting a CON

Join the discussion →

Parse markdown indented code block gets stuck in recursion

I am trying to parse Markdown using a grammar written with Parslet. However, I cannot get past indented code blocks because everything I tried so far got stuck in recursion. They look like this: This is a indented code block. Second line. Code block continues after blank line. There can be any number of chunks, separated by not more than one blank line. In order to solve this I wrote a minimal example which replaces the lines (including \n) with a and blank lines (\n\n) with spaces, eg: a aaa aa. # recurring_group_parser.rb require 'parslet' require 'rspec' require 'parslet/rig/rspec' class Re

Join the discussion →

How to write summarySE function in R

I'm a new R user and want to make a line chart with std using ggplot. For this I am using the summarySE function. vrn1_summary<-summarySE(data,measurevar = "vrn1",groupvars = c("genotype","treatment","time")) Since I cannot make my own function, I copied from the R Cookbook as follows: summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE, conf.interval=.95, .drop=TRUE) { library(plyr) # New version of length which can handle NA's: if na.rm==T, don't count them length2 <- function (x, na.rm=FALSE) { if (na.rm) sum(!is.na(x)) else length(x) } # This does the summary. For each

Join the discussion →

how to set focus to specific textbox in current gridview row after postback from textchange event

Got a series of textboxes in a GridView that have postback enabled. When I type some text in one of the txtQuantity and move to a txtUnit textbox, it triggers an OnTextChanged event and does a postback to calculate some totals. But the focus is lost on the txtUnit control and I have to re-select it with the mouse. It's a bit annoying having to do this, is there a way to retain focus on these controls during a postback ASPX Page: <asp:gridview ID="grdOrder" CssClass="table table-hover" GridLines="None" runat="server" ShowFooter="true" AutoGenerateColumns="false" ClientIDMode="Static" onrowdatab

Join the discussion →

Primefaces Datatable Date column filtering

How can I filter the Date column in Datatable in dd/mm/yyyy pattern? I'm using Primefaces 5.2 Community edition. <p:column sortBy="#{user.date}" styleClass="date" filterBy="#{user.date}" id="date"> <h:outputText value="#{user.date}"> <f:convertDateTime type="date" pattern="dd/MM/yyyy" /> </h:outputText> <p:watermark for="@(.date)" value="#{msg['dateOfBirth']}" /> </p:column> Filtering without a converter works, but with the converter, it does not work anymore.

Join the discussion →

transfer CurrentDirectory from un-elevated script to elevated one

I need to copy my file "manufacturer.bmp", which is located in the same directory as the script (in my flash drive), to the system32 directory. I succeed, in getting the variables sourcefile, destinationdirectory, and to elevate my script, but when I elevate it, my sourcefile variable is lost, because of the use of CurrentDirectory, which differs in this mode. Set shell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") CurrentDirectory = fso.GetAbsolutePathName(".") sourcefile = fso.buildpath(CurrentDirectory, "manufacturer.bmp") MsgBox(sourcefile) 'C

Join the discussion →

C# Keylogger Mail function

I've made myself a keylogger in c# using a console application. (I didn't made this fully myself, just a big part). So the problem in my keylogger is that I'm trying to add a mail function into it but when I spam random keys, they will be written to a specific textfile but it won't be mailed, which kind of is annoying... I was wondering if anyone could help me out. class Program { [DllImport("user32.dll")] public static extern int GetAsyncKeyState(int i); [DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, in

Join the discussion →

How to get the id of the current model in Laravel when saving

I am working in a Laravel 5 application. I try to save a comment for a project and I don't know how to get the $comment->project_id value. Here is my simplified controller public function store( CommentsFormRequest $request ) { $comment = new Note; $comment->message = Input::get('message'); $comment->project_id = $note->project->id; $comment->user_id = Auth::id(); $comment->save(); return Redirect::back(); } and here is my simplified form {!! Form::open(array('route' => 'notes.store')) !!} {!! Form::textarea('message', '', array('placeholder'=>'Message')) !!} {!! Form::submit('Ajouter la note'

Join the discussion →

JavaFX, leaving and entering Tab control

I have a JavaFX application. Main window consists of a TabPane (P1). P1 contains 4 different Tab controls (T11,T12,T13,T14). T11 contains a TabPane (P2) which contains two Tab controls (T21, T22). I am searching for a easy way to detect when any of the Tab controls gets or loses visibility. Using SelectionModel Events is not enough.

Join the discussion →

MVC 4 connection string can't login

I'm making a website using MVC 4 and Entity Framework 5.0.And I'm supposed to have a page where the user can be capable to see his data(name, email, age, etc.). Problem is when trying to access that database, the program breaks and it returns: " An exception of type 'System.Data.EntityException' occurred in System.Data.Entity.dll but was not handled in user code " And in the inner exception it gives this error: `{"Cannot open database \"BookMania.Models.PerfilContext\" requested by the login. The login failed.\r\nLogin failed for user 'TAG000002717\\teste'."}` I think It may happen because I'm

Join the discussion →

Consuming generic xml soap webservice in Java without wsimport

I'm searching for a way to consume soap webservices without using wsimport and tools like that. So far, everything I found requires the WSDL artifacts generation and I want to avoid it because I don't know which webservices will be used. The idea is to give the user the possibility to add several WSDL's URLs / methods and the program consume them and send it's response to another URL. I'm not looking for out of the box solutions/code or something like that. What I need is to know if it is possible or not and how to approach this problem, ideas and things like that. Thanks!

Join the discussion →

Selection box insert multiple times in database

This is what the page looks like: And this is what the database looks like: Now, I had this all working with textfields. (When you press save, the text fields get inserted in the bogie_nr. Now, I don't want to have text fields but checkboxes. So, if I select the first 2 checkboxes, and press save. I want the database to insert the number 1 by the axle_nr 1 and 2. Now, I want the first 2 boxes to be disabled (So you can't check them again). Now when you select the 3rd and 4th box, and press save. I want the database to insert the number 2 by the 3rd and 4th axle_nr. When everything is filled in

Join the discussion →

Instagram can`t find location created on Facebook or Foursquare

I have a Facebook and Foursquare place named as 'Aenea Tattoo Studio' If I use its Facebook ID in the Instagram API /locations/search as a facebook_places_id=1594009447547294 use its Foursquare ID in the Instagram API /locations/search as a foursquare_v2_id=54fe044a498eb8d13d38b6bf I receive this response: { "data" : [], "meta" : { "code" : 200 } } meaning that I have no location on Instagram linked to this Facebook/Foursquare place. How can I create an Instagram location so that my Facebook/Foursquare place is connected to the new Instagram location?

Join the discussion →

Postgresql: Edit pg_hba.conf to allow trust authorization temporarily

I Forgot my postgres password so I can't connect to the DB, I found those steps : edit pg_hba.conf to allow trust authorization temporarily Reload the config file (pg_ctl reload) Connect and issue ALTER ROLE / PASSWORD to set the new password edit pg_hba.conf again and restore the previous settings Reload the config file again I'm trying to follow but I'm stuck at step one. What should I change in pg_hba.conf to allow trust authorization temporarily.

Join the discussion →

can I access Module class method from controller just by calling the method?

I have the following module inside lib/api_client: request.rb module APIClient class Request require 'digest/sha1' require "net/http" require "uri" def self.venues_response ... end end end which I include in my controller class like this: class VenuesController < ApplicationController include APIClient I'd like to access its methods from inside venues_controller like this: venues_response But I get the following error: undefined method `venues_response' for #VenuesController:0x007f9ee058ad00 And if I try this: Request.venues_response I get: uninitialized constant VenuesController::Request The

Join the discussion →

How to set a field's value on the view mode of a NetSuite custom record, using client script?

I have a doubt about the nlapiSetFieldValue and nlapiGetFieldValue methods on NetSuite API. Do these methods work somehow on client script, when the record is in view mode? I'm having a hard time getting and setting any fields values without accessing the DOM elements directly. Here's what I'm trying to achieve: I have a process running in background, and on a custom record's view mode I have a button to check its status. When the status changes, I only need to refresh one field with its current value, which I'm getting via a restlet call. I'm trying to avoid reloading the whole page, to impro

Join the discussion →

Best practice to reduce the complexity of the UNIX Shell script

I have a script which has too many modules. The script is working perfectly, but the only issue is it is taking too much time and I need to reduce the complexity of the script. What the script is doing: I have a source file ( It can have multiple rows of data, each column separated by a '|' ). My script should check all the rows for all the columns and find the columns which have incorrect data. (E.g., Null in a not null column, space in a not space column, alphabet's in a number only column, and any value which is not a valid value for that column ). Now I have a Master file, it has those col

Join the discussion →

Change ReadOnly property on bound DataGridView

I have a DataGridView bound to a dataset which gets its data from a stored procedure. Column [1] is a fixed value – the last day of current moth: SELECT EOMONTH(GETDATE()) AS periodo. This data grid should provide a template for entries to be saved later after changes and new insertions. Problem is: this column – only this - is read only, because the fixed value returned by the SP I think. I Tried to change in the designer, and programmatically, but nope. Is there a way to change the property to ReadOnly = false, after data in grid is filled?

Join the discussion →

Event triggers by itself

I have no idea why function which should run only when button is pressed runs by herself. Here is my button declaration: var oButton = new sap.m.Button({ id: "buttonId", text: "Yes", press: this.fnB() }); My controller looks like follows: sap.ui.controller("<controller-name>", { fnA: function(){<button_declaration_here>}, fnB: function(){console.log("Hello from fnB!");} }); When I run the app I get: Hello from fnB! Uncaught TypeError: Cannot read property '0' of undefined No buttons pressed yet, so why do I get the hello message? I use SAP WEB IDE if it matters...

Join the discussion →

HTML not rendering inside Jade

I'm building a website with node.js, express, angular.js and jade. I'm currently testing html tags on blog posts, which don't seem to be working. I'm focusing on the heading for now. Why doesn't the browser render it as HTML? I have by the way tested this in Chrome but I had the same result. This is the jade code: div(ng-repeat='post in posts') h3 |{{post.title}} And this is the mongodb record (what is relevant): "title": "<strong>This text is strong</strong>", What can I do to fix this?

Join the discussion →

How to check if logstash receiving/parsing data from suricata to elasticsearch?

Trying to configure suricata v2.0.8 with ElasticSearch(v1.5.2)-Logstash(v1.4.2)-Kibana(v4.0.2) on Mac OS X 10.10.3 Yosemite. suricata.yaml: # Extensible Event Format (nicknamed EVE) event log in JSON format - eve-log: enabled: yes type: file #file|syslog|unix_dgram|unix_stream filename: eve.json # the following are valid when type: syslog above #identity: "suricata" #facility: local5 #level: Info ## possible levels: Emergency, Alert, Critical, ## Error, Warning, Notice, Info, Debug types: - alert - http: extended: yes # enable this for extended logging information # custom allows additional ht

Join the discussion →

How to use UTF-8 in C code?

My setup: gcc-4.9.2, UTF-8 environment. The following C-program works in ASCII, but does not in UTF-8. Create input file: echo -n 'привет мир' > /tmp/вход This is test.c: #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 10 int main(void) { char buf[SIZE+1]; char *pat = "привет мир"; char str[SIZE+2]; FILE *f1; FILE *f2; f1 = fopen("/tmp/вход","r"); f2 = fopen("/tmp/выход","w"); if (fread(buf, 1, SIZE, f1) > 0) { buf[SIZE] = 0; if (strncmp(buf, pat, SIZE) == 0) { sprintf(str, "% 11s\n", buf); fwrite(str, 1, SIZE+2, f2); } } fclose(f1); fclose(f2); exit(0); } Check the res

Join the discussion →

Handling date format in Pentaho using javascripting

My input excel sheet has field "date" with two different types of values as shown below 2015-03-02 11:06:35 3/2/2015 4:03:53 AM I am reading them as "string" and performing below logic var temp = date.getString(); temp = str2date(temp,"dd.MM.yyyy HH:mm:ss"); I get the below error *Could not apply the given format dd.MM.yyyy HH:mm:ss on the string for 2015-03-02 11:06:35 : Format.parseObject(String) failed* I tried reading them as "date" , but I got the below error Unparseable date: " 2015-03-02 11:06:35 " How can we handle this error?

Join the discussion →

WSO2 Identity Server error starting, cannot find admin

Starting WSO2 Identity Server for the first time gives me this error: "Caused by: org.wso2.carbon.user.core.UserStoreException: Admin user can not be created in primary user store. User store is read only. Please pick a user name which is exist in the primary user store as Admin user" <UserManager> <Realm> <Configuration> <AddAdmin>false</AddAdmin> <AdminRole>admins</AdminRole> <AdminUser> <UserName>cn=Directory Manager</UserName> <Password>xxxxxxxx</Password> </AdminUser> <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in this role sees the registry root --> <Property name

Join the discussion →

server certificate does NOT include an ID which matches the server name

Apache crashes with the following error [ssl:warn] [pid 6056:tid 408] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name when executing php script that send emails using Swiftmailer on localhost. How to solve this issue ? details: XAMPP v3.2.1 with PHP 5.6 , windows 8.1

Join the discussion →
Older stories