Posts

Camera not opening in redmi 3s prime (Android)

Image
Clash Royale CLAN TAG #URR8PPP Camera not opening in redmi 3s prime (Android) I've made an android application that uses the camera to capture the image, i've tested it on a few devices and it works fine, but recently i came across a phone (Redmi 3s prime ). In this phone, when i open the app it shows a blank screen. i want to know if something is wrong with the phone or my code. // permission for the camera @Override public void onRequestPermissionsResult(int requestCode, @NonNull String permissions, @NonNull int grantResults) { switch (requestCode){ case RequestCameraPermissionID: { if(grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED){ return; } try { cameraSource.start(cameraView.getHolder()); } catch (IOException...

Getting error while running spark programs in Apache Zeppelin in Windows 10 or 7

Image
Clash Royale CLAN TAG #URR8PPP Getting error while running spark programs in Apache Zeppelin in Windows 10 or 7 I am new to Apache Zeppelin. Installed 0.8.0 and using 7000 port to access Zeppelin. Configured few paths as mentioned below. JAVA_HOME: C:Program FilesJavajdk1.8.0_144 HADOOP_HOME: C:winutils ZEPPELIN_HOME: C:zeppelinzeppelin-0.8.0-bin-allzeppelin-0.8.0-bin-all all these variables are included in path variable and respective bin folders Tried to run spark program and getting the below error. Tried with multiple options to fix it, but unable. Please help. Spark Program: %spark println(sc.appName) Error: DEBUG [2018-07-29 00:06:05,371] ({pool-2-thread-2} RemoteInterpreterManagedProcess.java[start]:153) - callbackServer is serving now INFO [2018-07-29 00:06:05,380] ({pool-2-thread-2} RemoteInterpreterManagedProcess.java[start]:190) - Run interpreter process [C:zeppelinzeppelin-0.8.0-bin-allzeppelin-0.8.0-bin-allbininterpreter.cmd, -d, C:zeppelinzeppelin-0.8.0-bin-allzeppelin-0...

Configuration with name 'default' not found gradle sync failed

Image
Clash Royale CLAN TAG #URR8PPP Configuration with name 'default' not found gradle sync failed I downloaded OSMonitor app source code from https://github.com/eolwral/OSMonitor But while syncing gradle it failed with this log 2018-07-29 00:01:40,538 [ thread 19] WARN - ect.sync.idea.ProjectSetUpTask - Configuration with name 'default' not found. 2018-07-29 00:01:40,539 [ thread 19] INFO - e.project.sync.GradleSyncState - Gradle sync failed: Configuration with name 'default' not found. Consult IDE log for more details (Help | Show Log) (586ms) 2018-07-29 00:01:40,545 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED 2018-07-29 00:01:40,545 [e-1024-b02] INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'C:UsersUserStudioProjectsOSMonitor-master' OSMonitor-master 2018-07-29 00:01:40,647 [ thread 19] INFO - #com.jetbrains.cidr.lang - Clearing sym...

what does overwrite existing source file mean while converting webapp to war file

Image
Clash Royale CLAN TAG #URR8PPP what does overwrite existing source file mean while converting webapp to war file what does export source file mean. will it make it more stable and should i choose optimize for a specific run time I've had Tomcat 9 working fine with Java 10 before. Are you requiring the correct modules? – Jacob G. Jul 13 at 12:42 You mention tomcat 9, but your screenshot shows tomcat 6.0.29. – sjahan Jul 13 at 12:47 upgrade to tomcat 8 or 9 – benjamin c Jul 13 at 13:06 ...

How to wait particular up to particular time limit until get response from rest service

Image
Clash Royale CLAN TAG #URR8PPP How to wait particular up to particular time limit until get response from rest service In my code i am calling one external web service to get response by using HTTP Client Get request. Here the service may delay up to 5 mins to give the response. So i have to do below things. 1. want to set request timeout(No idea how to do it) 2. call the service and set the time limit up to what time it can wait for response(In my case i want to set time limit for 5 mins) can any one suggest me how can i achieve this 2 things. Thanks, Sudheer I am able to find how to set request time out i am using PoolingHttpClientConnectionManager ConnManager = new PoolingHttpClientConnectionManager(timeToLive,TimeUnit.MINUTES); . Stil no clue how to wait until get the response. – user3853393 Jul 25 at 16:12 ...

Auto convert keywords into links

Image
Clash Royale CLAN TAG #URR8PPP Auto convert keywords into links Is there a simple way to auto-convert keywords on article pages into internal hyperlinks? Maybe using a text file with a list of all keywords i want to auto convert, so that any occurance of those keywords in an article page are automatically converted into links? First occurance of any keyword only. This is for a simple static html site. Thanks for any help. <script type="text/javascript"> var searchFor = 'revolution'; // replace with search phrase var linkTo = 'revolution.html'; // replace with URL var caseSensitive = false; // set to true or false (without quotes) // do not change script below this line var content = document.getElementsByTagName('body')[0]; var flag = caseSensitive ? '' : 'i'; var pattern = new RegExp("\s(?!</a>)(" + searchFor + "\b)", "g" + flag); content.innerHTML = content.in...

I would like to send multiple value using javascript and form

Image
Clash Royale CLAN TAG #URR8PPP I would like to send multiple value using javascript and form My problem is similar to the link below: similar problem I would like to send multiple values using form and javascript. Instead fixed value like code below: <input type="hidden" name="Id" value="83" /> <input type="hidden" name="Id" value="85" /> I would like the value is based on user input. How can I achieve this? I have other code to input user input Link name: <input type='text' id='linkid'> <button onclick="saveLink();return false">Save link</button> And javascript code var idarray=; function saveLink() { var id = document.getElementById("linkid").value; idarray.push(id); } How to send this idarray using html form? How can the user input if the input s are hidden and how would you like to send the data and what would you like to s...

Python creating a function that pulls a picture from a url then resizing to thumbnail

Image
Clash Royale CLAN TAG #URR8PPP Python creating a function that pulls a picture from a url then resizing to thumbnail So I have been having problems trying to write the function to change the size of an image if to big and saving it as a thumbnail. I have how to retrieve the image just lost after that. I know about pillow but cant use for the class any help would be appreciated. Update: So far I have gotten the code to resize the image and make it a thumbnail. The next part that I am on is having it save if resized to thumbnail2, but if it stays the same save as thumbnail1. Here is my code so far without the next step. import urllib url ="https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstra ion_1.png" src = "C:UserslaramiePicturesPNG_transparency_demonstration_1.png" connect = urllib.urlretrieve(url, src) def scalePicture(src): newWidth = getWidth(src)/2 newHeight = getHeight(src)/2 canvas = makeEmptyPicture(newWidth, newHeight) fo...

Json object, convert json array into a json object in java

Image
Clash Royale CLAN TAG #URR8PPP Json object, convert json array into a json object in java I have one json array like this "values":[ { "locale":"en_US", "source_key":"book_format", "value":"Hardback", "display_attr_name":"Book Format", "source_value":"Hardback", "isPrimary":"true" }, { "isFacetValue":"true", "facet_version":"1.1", "locale":"en_US", "value":"Hardcover" } ] I need to get the only the distinct keys from above json array { "locale":"en_US", "source_key":"book_format", "value":"Hardback", "display_attr_name":"Book Format", "source_value":"Hardback", "isPrimary":"true", "isFacetValue...

Escaping New Line character within SQL query

Image
Clash Royale CLAN TAG #URR8PPP Escaping New Line character within SQL query I am reading a table using my java code and creating a csv file out of it. So the 4 rows that I have get converted similar to below - sam , 18 , banker , He likes to play football jam , 28 , hacker , he likes nothing However in certain cases when the last varchar2 column contains n it becomes like this sam , 18 , banker , He likes to play football jam , 28 , hacker , he likes nothing When I try to read the file , each line is read one at a time and I'm not able parse the data due to few words being pushed to subsequent lines. Is there a way to escape the new line character within the column in my query to make it into a single line? My sql query select name , age , job , hobbies from person_details I am using csvwriter to generate the csv file - CSVWriter csvWriter = new CSVWriter(new FileWriter(results), DELIMITER, Character.M...

How to get the size of available TCP data?

Image
Clash Royale CLAN TAG #URR8PPP How to get the size of available TCP data? Problem I have a use case where I need to Peek at exactly the first TCP packet, whatever length it may be. Peek Snippet I would have expected this to work: conn, err := sock.Accept() if nil != err { panic(err) } // plenty of time for the first packet to arrive time.Sleep(2500 * 1000000) bufConn := bufio.NewReader(conn) n := bufConn.Buffered() fmt.Fprintf(os.Stdout, "Size of Buffered Data %dn", n) However, even though I am positive that the data has arrived it still shows that 0 bytes are buffered. Full Test Application Here's a full test program: package main import ( "bufio" "fmt" "net" "os" "strconv" "time" ) func main () { addr := ":" + strconv.Itoa(4080) sock, err := net.Listen("tcp", addr) if nil != err { panic(err) } conn, err := sock.Accept() if nil != e...

MongoDB : A Service Specific error occurred :100

Image
Clash Royale CLAN TAG #URR8PPP MongoDB : A Service Specific error occurred :100 I have just installed "mongodb" on Windows, while starting it, the following error appears A Service Specific error occurred :100 Any Suggestions? What command you are running? Also which OS are you using? – bro-grammer Jun 24 '16 at 10:42 OS: Windows 7 Command: net start MongoDB – Muzammil Naseer Jun 24 '16 at 10:44 net start MongoDB Have you created the required directories? – bro-grammer Jun 24 '16 at 10:45 Do you mean ...

How to respond to a boolean type in sanic?

Image
Clash Royale CLAN TAG #URR8PPP How to respond to a boolean type in sanic? I need to respond directly to True or False. How can I do this? Json, text, raw.... can't code if param == signature: return True else: return False Error File "/usr/local/lib/python3.5/dist-packages/sanic/server.py", line 337, in write_response response.output( AttributeError: 'bool' object has no attribute 'output' 1 Answer 1 I think what you are looking for is something like this: from sanic import responses @app.get('/myroute') async def myroute(request): output = True if param == signature else False return response.json(output) You just need to wrap your response in response.json . response.json By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cooki...

ngx-bootstrap Modal Component not found even after adding to entry component

Image
Clash Royale CLAN TAG #URR8PPP ngx-bootstrap Modal Component not found even after adding to entry component Recently I have converted an ASPNETCORE 2.0 angular app to ASPNETCORE 2.1 angular app (later one uses angular/cli app). In the previous version I had some Modal Components built with ngx-bootstrap which were working correctly. But after conversion those components stopped working and started throwing this error - ASPNETCORE 2.0 ASPNETCORE 2.1 angular/cli No component factory found for {component}. Did you add it to @NgModule.entryComponents? I have added following to my app.module.ts file - @NgModule({ imports: [ ModalModule.forRoot(), MySubModule ], entryComponents: [ MyModalComponent ] }) In my MySubModule - MySubModule @NgModule({ declarations: [ MyModalComponent ], imports: [ ModalModule.forRoot() ] exports: [ MyModalComponent ] }) Even though I have defined my entry component it's...

when converting text/string to date in postgres, random date is generated

Image
Clash Royale CLAN TAG #URR8PPP when converting text/string to date in postgres, random date is generated I have a text column indicating date i.e. 20170101 UPDATE table_name SET work_date = to_date(workdate, 'YYYYMMDD'); I used this command to convert it as date. However, I got a odd result. I read though other existing posts but not sure what's wrong here. +----------+---------------+ | workdate | work_date | +----------+---------------+ | 20170211 | 2207-05-09 | | 20170930 | 2209-04-27 | | 20170507 | 2208-02-29 | | 20170318 | 2207-08-24 | +----------+---------------+ Is that table is your expected result? – Prashant Pimpale 1 hour ago Works for me: imgur.com/a/uEkIaeh – a_horse_with_no_name 54 mins ago ...

Show element by checking session in asp.net

Image
Clash Royale CLAN TAG #URR8PPP Show element by checking session in asp.net I want to show element (div element) by checking Session of user It means if User didn't login when Click on the TextArea show Login page with Here is my code... <script> $(document).ready(function () { $('.form-control').click(function () { $('.form').show(); return false; }); }); </script> ///code of textarea <div class="form-group"> <textarea class="form-control" name="Text" id="Text" rows="5" data-rule="required" placeholder="message" onclick="loginfunction"></textarea> <input type="hidden" name="Date" id="Date" class="form-control" value="@DateTime.Now" /> <div class="validation"></d...