Posts

javascript - Image upload, resizing and encoding to base64 crashes Chrome on mobile -

My users can select an image using the file-upload HTML input element - 1. From there I downscale 2 I convert to base 64 Chrome Mobile & amp; The Android browser displays a crash - and 'out of memory error'. If the browser runs on a more 'modern / enabled' device then it is perfectly fine. Here is the reason for the error - can this be corrected? Here is an action that gives down aspect ratio (keeping aspect ratio) and image base 64 string Resize the function and convert 64 (IMG, MaxWide, MaxHit) {var imgWidth = img.width, imgHeight = img.height; Var ratio = 1, ratio 1 = 1, ratio 2 = 1; Ratio 1 = MaxWide / IMG depth; Ratio 2 = max heitt / imgwr; // Use the smallest proportion that the image is the best fit in the MaxWith X MaxHoight box. If (ratio 1lt; ratio 2) {ratio = ratio 1; } And {ratio = ratio 2; } Var Canvas = document.createElement ("canvas"); Var Canvas Contact = Canvas. GateConttex ("2D"); Var canvas coppie = d...

javascript - Detecting Available Storage with IndexedDB -

I have written an offline application which uses the IDB to store images and text that are usually used offline Is present in a MySQL DB for However, I'm trying to explain one way that I can read the limits on devices memory for indexDB. I am currently using the following method to determine, though it only works in Chrome. I'm using snippets from here, which comes in storageinfo for webkit, although if someone is ff & amp; IE & amp; Amp; More specifically the Safari who will be great. Whatever I have collected, the quota used for everything that is stored by that browser not only for IDBI, however, what I am using is the Remaining Quota I Either request an AJAX request on the server to get the estimated size of all the files that will be stored and will work if there is sufficient storage or I will calculate the amount stored in IDB and if there It is enough to store more. I was wondering if there was any more 'systematic' approach? And check the re...

java - How to combine State design pattern and Depedancy injection -

I'm trying to combine them in this Java 1.7 code (if possible): view class {private state _state; } Intact Class State {View protected _view; } The class extends to the UserState state {} class extends the AdminState state {} I have tried to understand them better by using these articles: and But I'm just more confused. My questions are: Can I inject some of the states in view class and avoid the state instance of? What is there to get in my code? Thanks in advance. The problem is that you depend on injection injection for beginners. You are trying to inject circular dependency. I believe. Read that article, it does a better job than I am doing. However, in a nutshell: you are trying to do so (stolen image from the article): + --------- + - -------- + | A. & Lt; ----- | B | | | | | | ----- & gt; | | + --------- + + --------- + Which class do you inject for the first time? If you are trying to create B , then you need a A but you...

html - Line-height in div not working as expected -

Image
A div to me in which I have put paragraphs of text, images, links, etc., I use the old line Unable to do property I retrieve this content from my database using PHP. There will be a specific scenario, & lt; Div class = "story" & gt; Now there are many complaints we will study this matter ... do we need a separate policy or some kind of explanation, we will clarify this soon. Now there are many complaints we will study the matter ... whether it is a separate policy Need or some kind of explanation is required, we will clarify it soon & lt; / Div & gt; . Story {line-height: 200px; } I type into content in one and it is stored in DB. Now I see that as far as I've finished my line by pressing the physically entered, I get a gap of 200 pixels. Based on the screen resolution and other things, can a line be alright anywhere between the lines? Although it's working something, Edit 1: Yes I have tried word-wrap: break-word does not work. ...

java - How to instrument / advice a Spring Data (JPA) repository? -

I failed in trying to advise Spring Data JPP repository. The goal is to target all non- zero public methods in a particular repository annotated with target custom annotations (ResourceNotFound in this example) and when a return value is either null. City, Long & gt;, JpaSpecificationExecutor & lt; City & gt or an empty archive @Repository @ResourceNotFound @Transactional (read only = true) Public Interface CityRepository JpaRepository & lt Expand { @ResourceNotFound . Public void beanAnnotatedWithResourceNotFound () {} @Pointcut ("execution (public * * (..))" public ("zero" (com.digitalmisfits.spring.aop.annotation.ResourceNotFound * ) "@Pointcut Public Law () {@ @ (" Bean Untotted With Resource Notfoud () & amp; Public Law () ") Public Object PublicMethodInsideAClass Marked Wise Resource Notfound (ProceedingJoinpointPJP) Throwshell { System.out.println ("publicMethodInsideAClassMarkedWithResourceNotFound"...

Excluding particular tests in Boost.Test -

मुझे गैर-मौजूदा विकल्प के एक व्यवहार की आवश्यकता है test_launcher --exclude_test = 'बेंचमार्क *' ? क्या बूस्ट में कोई कामकाजी तंत्र है जो कि एक ही प्राप्त करने के लिए इस्तेमाल किया जा सकता है? आप उपयोग कर सकते हैं इसके बजाय, क्योंकि यह आपके परीक्षणों को तार्किक रूप से समूहित करने का एक आसान तरीका है। Boost.test कमांड लाइन से शक्तिशाली इकाई परीक्षण विकल्प प्रदान करता है, विशेष रूप से आपके मामले में संशोधक

remove item from system.array in PowerShell -

यह मेरा $ array है: नाम GUID - ------ पीसीएएसएएए पीसीआईएफ़एबीबीबी पीसीएक्ससीसीसी पीसीएंडडीएएएए पीसीसीडीसीडीसीडीसी पीसीएडी 3 एएएए पीसीएडी 3 सीसीसीसी ये मेरी स्क्रिप्ट है: $ गइड = " सीसीसीसी "$ कामनाम = $ एरे | | जहां Guid -q $ Guid | नाम $ array.remove ($ workingName) का चयन करें # ब्रोक! मैं क्या हासिल करने की कोशिश कर रहा हूं यह है कि अगर $ Guid = "CCCC" यह नाम के सभी उदाहरणों को निकाल देगा और सरणी से CCCC , जहां CCCC मौजूद है, इसलिए इस उदाहरण में पांच लाइनें (PC001 के लिए तीन पंक्तियां, PC0003 के लिए दो पंक्तियां), अगर यह BBBB यह केवल पीसीएक्स के लिए तीन पंक्तियां निकाल देगा। एफवाईआई: यह बहुत बड़ी स्क्रिप्ट का हिस्सा है $ गइड = "सीसीसीसी" $ कामनाम = $ array | | जहां Guid -q $ Guid | चुनें- एक्सपैंडप्रार्टी नाम $ array = $ array | जहां {$ _। नाम -नोटिन $ कार्यनाम}