on-internet

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 →

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 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 →

Can i override Google SERP with automatic IP location determination programmatically?

I mean, i can specify preferred SERP location search options on google serp page, for sure. I guess there is way to make it hapenns with curl. Here is some history. I've used SEOStats onto my project. It's good. The I've got interesting article about local searches with undocumented google search parameter UULE, and used it for getting local results. And it works fine for some time. Then I've to implement getting results with proxies. And that's it. Something is going wrong today as suggested in this comment at the same article. This year is full of surprises. Results now ignoring parameter UU

Join the discussion →

SRVE8094W: WARNING: Cannot set header. Response already committed - upgrading GWT/Spring application to WAS 8.5

I'm upgrading app server of somewhat old GWT 2.03/Spring 2 application from WAS 7.00 to WAS 8.5.5 and I'm getting the following error when I try to load that very first Login JSP: [5/11/15 15:55:18:969 EDT] 0000010e ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [RxHD_Ear] [/RxHD] [/rxhd_login.jsp]: Initialization successful. [5/11/15 15:55:20:000 EDT] 0000010f SRTServletRes W com.ibm.ws.webcontainer.srt.SRTServletResponse setHeader SRVE8094W: WARNING: Cannot set header. Response already committed. [5/11/15 15:55:20:005 EDT] 0000010e SRTServletRes W com.ibm.ws.w

Join the discussion →

How to set camera focus value manually in Android

I intend to create an application that can take photos in the following way: When the user touches the screen, it starts to take photos It takes several photos within a few microseconds, each with different focus In pseudocode: Camera camera = getAndroidCamera(); for(i<10) { camera.setFocus(i*0.1); camera.takePhoto(path, pictureName+i); } So basically I intend to take photos of the same object with different values of focus. According to this, it is not possible, only assisted autofocus is viable. Can you confirm it? If possible, how should I do it? Should I set autofocus to different areas?

Join the discussion →

Casting string into ArrayList

Scanner scan = new Scanner(System.in); System.out.println("Enter a sequence of numbers ending with 0."); ArrayList<Integer> list = new ArrayList<Integer>(); String num = scan.nextLine(); for(int x=0; x < num.length(); x++){ System.out.println(num.charAt(x)); int y = num.charAt(x); System.out.println(y); list.add(y); System.out.println(list); } Im trying to cast a string of numbers into a array. Its not adding the correct vaule. I keep getting 49 and 50. I want to store the numbers the user enters into the ArrayList. Can someone help?

Join the discussion →

Can't see my device of chrome://inspect/#devices

I've followed the instructions at google: https://developer.chrome.com/devtools/docs/remote-debugging. I've also went over the troubleshooting section - but nothing seems to work. I have samsung galaxy 3 (android 4.1.2, chrome 42.0.2311.111). USB debugging enabled. I've tried restarting the device after ticking the USB debugging a few times. On windows 8 I run chrome (44.0.2388.0 canary). I've installed Samsung USB Driver, and my computer can see my device. I do not get any notification when plugging the device nor when opening canary with the inspect page. Did I miss anything?

Join the discussion →

Generate er diagram from Hibernate entity

I would like to generate ER diagram from Hibernate entities or Hibernate mapping. I have selected visual paradigm tool which provides this feature. I would like to know your feedback about visual paradigm or some other tools if you know which supports the above feature.

Join the discussion →

Oracle's OUTER JOIN (+) on string - Migration PostgreSQL

I'm migrating a client's software database from Oracle to PostgreSQL, and I have some trouble understanding a query, what it does, and consequently how to migrate it. The query is: SELECT * FROM TBL1, TBL2, TBL3, TBL4 WHERE TBL3.Project_ID = TBL1.Project_ID AND TBL2.Type_ID = TBL1.Type_ID AND TBL4.PROPERTY_NAME(+)='Id' AND TBL4.Entity_ID(+)=TBL1.Entity_ID And the part I don't get, is the outer join (+) on 'Id'. A join on a table, OK, but on a string? I've no idea of what it does. Do someone has an idea? Thanks.

Join the discussion →

CASE STRUCTURE IN A DB2 SQL UPDATE

I need to update a value (FIELD_E) in one table based on the value in a field of a second table as long as certain conditions are met. Here is what I am working with thus far. TABLE_1.FIELD_C is a primary key TABLE_2.FIELD_D is a foreign key There is a ONE TO MANY relationship between TABLE_1.FIELD_C AND TABLE_2.FIELD_D UPDATE TABLE_1 SET TABLE_1.FIELD_E = ( CASE WHEN ( SELECT MAX(FIELD_A) FROM TABLE_1, TABLE_2 WHERE TABLE_1.FIELD_C = TABLE_2.FIELD_D AND TABLE_1.FIELD_A IS NOT NULL AND TABLE_2.FIELD_B IS NULL) = 'Y' THEN '1' WHEN ( SELECT MAX(FIELD_A) FROM TABLE_1, TABLE_2 WHERE TABLE_1.FIELD_

Join the discussion →

Getopt::Long GetOptions error in option spec

I'm getting an error with the following script: my $h=""; my $r=""; my $i=""; my $n=""; my $forks=""; my $global=""; my $v=""; GetOptions ("h" => \$h, #print help "r" => \$r, #keep all temp folder "i" => \$i, #include additional config file "n" => \$n, #do not merge temp files "forks=f" => \$forks, #number of forks you want to use "global=g" => \$global, #special config line option "v" => \$v #verbose option ); The error is: "Error in option spec: global=g". Does anyone know a solution?

Join the discussion →

Will SSLContext.getInstance("TLS") supports TLS v1.1 and TLS v1.2 also?

In my code I am creating one instance of SSLContext using this command: SSLContext ctx = SSLContext.getInstance("TLS"); But in my Tomcat server I am setting TLSv1.2 and i am getting handshake error. How we can support all the TLS protocols using this method? Like in CPP we have SSLV23 client method which will support all protocols.

Join the discussion →

Getopts perl order

I am having some problems with getopts in Perl. I use: getopts("abc:ds:", \%options); and I'm checking the options with if (defined $options{a}) where $options is the hash the options are written into. After the options, the user has to enter a file name, that I locate with $ARGV[0]. The problem is that the user can not put the options after the file name, but only before. So this is working: skript.pl -a file.txt And this is not working: skript.pl file.txt -a How can I fix this problem?

Join the discussion →
Older stories