on-internet

UserManager.FindByEmail() returning Null

I'm trying to implement email address based usernames in AspNet.Identity for MVC5. My application works find as long as there is a registered email/username on the system. I just discovered that if the user does not exist and tries to login an exception gets thrown on Line 72. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 71: //Add this to check if the email was confirmed. Line 72: var userid = UserManager.FindByEmail(model.Email).Id; Here is my code. public async Task<ActionResult> Login(LoginViewModel model, string

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 →

Get unlimited row count and paginated results from the database using CodeIgniter

When I search for a pages in my categories it displays the result of what pages are in that category. For testing I have set the limit per page to 1 on my search_for function. Question/Problem: If there a only 2 pages that show up in result for some reason the pagination links display 5 links where it should only display 2 pagination links. functions for model are on controller for testing. I think the problem lies where the db->like and db->or_like in model. Why does it display 5 pagination links when should only display 2 if only 2 results found. Controller <?php class Category_search extend

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 →

How to remove permissions offline_access and publish_stream in scope variable

I have error when I want login drupal 7 with facebook account and I use module hybridauth. like this: Invalid Scopes: offline_access, publish_stream. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions From same question I found the answer and it is to remove permissions offline_access and publish_stream in scope variable but I don't understand how to do that? anyone can help me?

Join the discussion →

Should I use belongsTo or hasOne?

Consider two models A and B A -> relatedTo B is a one-to-one relationship. What is the difference in using (A ->hasOne – B) and (A ->belongsTo – B)? Can I use them interchangeably?

Join the discussion →

Shortest path algorithm using dictionaries

I have a project for my algorithm subject to design a GUI for Dijkstra's shortest path algorithm. I chose to use Python because it is a language that I would like to master. I have been trying for more than a week actually and am facing troubles all the way. I chose to represent my directed graph as a dictionary in this way: g= {'A': {"B": 20, 'D': 80, 'G' :90}, # A can direct to B, D and G 'B': {'F' : 10}, 'F':{'C':10,'D':40}, 'C':{'D':10,'H':20,'F':50}, 'D':{'G':20}, 'G':{'A':20}, 'E':{'G':30,'B':50}, 'H':None} # H is not directed to anything, but can accessed through C The key is the vertic

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 →

Dynamic odata service in C# from runtime data layer

I'm trying to create a dynamic odata service from tables in my tables which are not known till runtime. So at the start of my web application, a user selects a database and in C# I find all the tables in that database. Now the hard part is I want to create odata service endpoints for each table in the database and use them accordingly in my web application. The problem is I don't know how to do it dynamically. There are lots of examples with compile time known database tables, but in this case, I won't have them till the first time my user uses my application.

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 →

I want form builder with bootstrap & Jquery

I am trying to build a form builder with bootstrap & Jquery with components drag & drop function. My goals: Drag and Drop the Grid layout like (12 col, 8+8 col, 2+6+4 col ) modify the HTML form components property values modify the form component events modify the form component validation. please let me know how to proceed for this project. any open source project to reuse in this project.

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 →

CORS error in AngularJS

When I am using Fiddler or any browser side HTTP client extension like Advanced Rest Client, I can get data from a API easily. But when I try to use the same API from Angular JS, CORS issue appear immediately. I have tried with following lines to solve the problem in AngularJS, But unfortunately it did not work. appd.config(function ($httpProvider) { // $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; // $httpProvider.defaults.headers.post['Accept'] = '*/*' $httpProvider.defaults.useXDomain = true; $httpProvider.defaults.withCredentials = true; delete

Join the discussion →

Win32 API SetTimer in a loop

is it possible to have a SetTimer() function inside a loop? Inside WM_TIMER I have a KillTimer() function and it prematurelly ends the loop for SetTimer(). Here's a bit of code, which should draw vertical lines every second with a 10 point incrementation in their X coordinate. Once I reach the end of the dialog box, SetTimer() should be called again but this time all new lines need to be 1 point to the right of the previous ones. This loop happens 10 times and it should make the whole width of the dialog box in random colors. int x5 = 0 ; int y5 = 10; int y6 = 100; //DrawTimer points global va

Join the discussion →

MDX Query for Filtering Non Empty Values

I need to create a filter in Performance point Dashboard to get only non empty values. I am trying to write a MDX Query for selecting the values SELECT NONEMPTY{[H School ].[Dist Name], [H School ].[School Name]} FROM [Early Cube ] but it is not filtering the data

Join the discussion →

psftp randomly fails with local: unable to open

psftp put fails about one percent of the time with example being local: unable to open d:\\WorkPath\\F_56MTV56201504201707224380.csv Calling application has needed rights to directory path where file exists and to upload file itself Directory path where upload file resides is not locked down. See item (1) csv file to be uploaded is created in C++ with fclose() function not returning EOF upon closing the file Directory upload path has been excluded from antivirus 99 out of 100 uploads work as expected Reuploading failed upload file by calling same batch works fine Solution is multithreaded The

Join the discussion →

sslcontextbuilder and SSLContexts deprecated

I am using JDK1.8 with JDK Compilance JavaSE-1.7, Eclipse Luna, and Apache httpclient 4.4.1. I am getting warning in Eclipse that sslcontextbuilder and SSLContexts are deprecated. What are alternatives for these classes?

Join the discussion →

Cannot find image name and extension from encode url

I have a question would like to ask you, it was about php. My problem when I tried to use php function to extend image extension from an url which has form below : http://lh3.googleusercontent.com/i_qpu5lXHddZgNaEbzEEz1CaArLCHEmVNuhwVOuDUl0aIyZHuez3s4Uf878y1n9CqB5rld2a7GSAoWzoMgrC so , for above url is made by Google which is not show use the file name and extesion name. of course I have try to use this below function but still not work : $image_name = basename($url); could anyone help me.

Join the discussion →

Convert string to JAXBElement using Java

I'm having some issue while converting String object to JAXBElement string object where I need to set this one This is the target method where I need to set the value public void setData(JAXBElement<String> value) { this.data = ((JAXBElement<String> ) value); } For this one, I have written code something like this ObjectFactory factory = new ObjectFactory(); JAXBElement<ApplicationIngestionRequest> jaxbElement = new JAXBElement( new QName(ApplicationIngestionRequest.class.getSimpleName()), ApplicationIngestionRequest.class, request); StringWriter writer = new StringWriter(); JAXBContext contex

Join the discussion →

Search/replace in block selection in Notepad++

Is there a way to limit search/replace only to a columnar block selection in Notepad++? Here is what I am trying to do: I am bulk-editing metadata extracted from large numbers of photos. The metadata comes to me as a csv file with no quotes around fields in header line and no quotes around first field in each succeeding line. I edit this file in Open Office calc which exports with quotes around all fields. I can easily edit header row but the problem comes in stripping quotes from only first field in successive lines. I can use notepad in columnar mode but, after selecting the first column, th

Join the discussion →

How to extract cells of a particular colour in pivot table?

I have applied a conditional formatting to a column of a pivot table in Excel, which automatically colours the cells greater than a particular value in red. I also want to extract those red cells separately to a specific area in the same Sheet. Can it be done by using macros or an 'if' condition would help here?

Join the discussion →
Older stories