input
stringlengths
51
42.3k
output
stringlengths
18
55k
Binary converter alogrithim <p>Create a function called binary_converter. Inside the function, implement an algorithm to convert decimal numbers between 0 and 255 to their binary equivalents.</p> <p>For any invalid input, return string Invalid input</p> <p>Example: For number 5 return string 101</p> <p>my code</p> ...
<p>Try this code... </p> <pre><code>def binary_converter(n): if(n==0): return "0" elif(n&gt;255): print("out of range") return "" else: ans="" while(n&gt;0): temp=n%2 ans=str(temp)+ans n=n/2 return ans </code></pre>
Total hours of overtime <p>I keep a google spreadsheet where I enter hours worked per day. I'm supposed to work 8 hours per day and anything more than that is overtime.</p> <p>So I need to check if a value in the column with hours is greater than 8. If so I want the difference between 8 and the value entered, added to...
<p>Let's say your hours are entered in column <code>B</code>, and start on row 2. In a column further along, put the following formula:</p> <pre><code>=if(B2&gt;8,B2-8,0) </code></pre> <p>This first checks whether that day have any overtime <code>=if(B2&gt;8</code> - if it does, it calculates how much <code>B2-8</cod...
Travis CI for classroom/homework automatic testing and grading <p>I know I can include tests in the starter code and do automatic testing using Travis CI on Github Push(s).</p> <p>That said, I would prefer to keep the tests on the Travis CI side - hidden from the students. I am know to Travis CI, is this possible?</p>...
<p>Since Travis CI does not give you any disk space, I added a custom script to pull in tests. On completion, I post the results to Amazon S3, see <a href="https://docs.travis-ci.com/user/uploading-artifacts/" rel="nofollow">Uploading Artifacts on Travis CI</a></p>
Information on what .captain.picard * #riker means for CSS <p>I'm wondering what .captain.picard * #riker means. I'm pretty sure it means that any HTML element with class "captain picard" (a div for example) has everything inside it selected, and then in that everything selected all html elements with id "riker" are se...
<p>Just remove *, that means 'all elements'. Look how it works</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.captain.picard #riker { color: red; } .captain.picar...
Angular 2 upload multiple files <p>I am learning Angular 2. Trying to upload multiple files (PDF(s) or Images (PNG/JPG/DICOM/DCM)). Right now uploading one file is working, but multiple is not working. This is the code i tried</p> <pre><code>&lt;div&gt; &lt;label&gt; Upload PDF(s) or Images (PNG/JPG/DICOM/DCM):&lt...
<p>Add the <code>multiple</code> attribute to you input:</p> <pre class="lang-html prettyprint-override"><code>&lt;input type="file" (change)="onChange($event)" multiple /&gt; </code></pre> <p>And to show all file names in your input, do it like in this plunker: <a href="https://plnkr.co/edit/WvkNbwXpAkD14r417cYM?p=p...
issue on Ambiguous reference to member 'subscript' swift3 <p>I have upgrade swift 2.3 to swift 3, and i got this error </p> <blockquote> <p>Ambiguous reference to member 'subscript' swift3</p> </blockquote> <p>here code</p> <pre><code>var cellDescriptors: [[String:Any]]! func loadCellDescriptors() { if le...
<p>You cannot use a chain of subscriptions in Swift 3 without telling the compiler the intermediate types</p> <pre><code>let section = cellDescriptors[indexPath.section] as! [Any] let rowItem = section[indexOfTappedRow] as! [String:Any] if rowItem["isExpanded"] as! Bool == false { shouldExpandAndShowSubRows = ...
The method connection() is undefined for the type Session <blockquote> <p>The method connection() is undefined for the type Session</p> </blockquote> <p>I got this error when i am using prepared statement in Hibernate 5.2.2.</p> <p><strong>Issue:</strong> </p> <pre><code>Session session = HibernateUtil.getSession...
<p>The method actually does not exist. It was removed. The Hibernate 3.5 Javadoc says:</p> <blockquote> <p>Deprecated. (scheduled for removal in 4.x). Replacement depends on need; for doing direct JDBC stuff use doWork(org.hibernate.jdbc.Work); for opening a 'temporary Session' use (TBD).</p> </blockquote> <p>The i...
sort elements in NSArray based on timestamp of element in my case <p>I have an array of <code>NSString</code>, each <code>NSString</code> element contains a timestamp (epoch time) and other characters, e.g.: <code>"time:1474437948687, &lt;other characters&gt;"</code>.</p> <pre><code>NSArrary *myData = [self loadData];...
<p>Use following <strong>sortedArrayUsingComparator</strong> it will work for me : I use static data e.g time:1474437948687, ..</p> <pre><code>**time:1474437948687, &lt;other characters&gt; Consider String Format..** NSArrary *myData = [self loadData]; NSArrary *sortedmyData = [[myData sortedArrayUsingCompar...
Refer dependent JARs of Junit project on GitHub triggered by Jenkins <p>I have a Junit test suite which depends on around 30 JARs. The Junit source code is on GitHub and I want to trigger the test suite from Jenkins. I can do this by using GitHub plugin. I.e. using Fressstyle project and then selecting source code mana...
<p>Use a tool for building your software that handles the dependency management. E.g. Ant with Ivy, Maven or Gradle. Otherwise you have to reinvent the wheel.</p>
How to prevent splashscreen to auto hide on android using Cordova splashscreen plugin (ionic) <p>I'm looking for a way to control the time my splashscreen shows. Since I have to download data before the user can interact with the UI, this time is not fixed. My problem is that I am not able to prevent the splash screen ...
<p>Try to add the next parameter:</p> <pre class="lang-xml prettyprint-override"><code>&lt;preference name="SplashShowOnlyFirstTime" value="false" /&gt; </code></pre>
Android Wear: Work around for "com.google.android.gms.wearable.BIND_LISTENER" <p>I used to use <code>com.google.android.gms.wearable.BIND_LISTENER</code> and <code>WearableListenerService</code> to communicate between my Mobile and Wear device.</p> <p>After the intent <code>com.google.android.gms.wearable.BIND_LISTENE...
<p>Like you said the <code>BIND_LISTENER</code> is deprecated now, so according to this <a href="http://android-developers.blogspot.com/2016/04/deprecation-of-bindlistener.html" rel="nofollow">thread</a>, the alternative for this is by using a fine-grained intent filter mechanism that allows developers to specify exact...
MySQL database error using scrapy <p>I am trying to save scrapped data in MySQL database. My script.py is</p> <pre><code> # -*- coding: utf-8 -*- import scrapy import unidecode from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from lxml import html class ElementSpider(scrap...
<p>Your method signature is wrong, it should take item and spider parameters:</p> <pre><code>process_item(self, item, spider) </code></pre> <p>Also you need to have the pipeline setup in your <em>settings.py</em> file:</p> <pre><code> ITEM_PIPELINES = {"project_name.path.SQLStore"} </code></pre> <p>Your syntax is ...
Fixed footer in android layout <p>Here is my layout for fixed footer. A <code>Fragment</code> containing <code>RecyclerView</code> is attached to <code>FrameLayout</code>. But the content of <code>RecyclerView</code> is being overlapped by the footer layout.</p> <pre><code>&lt;RelativeLayout android:layout_height="ma...
<p>Try this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;FrameLayout android:id="@+id/home_parent_framelayout" andr...
DataTable Goes out of Memory after just 2.5M records <p>I'm trying to bring data from database into a dataTable and records are about 6 million. As we know DataTable Limit is <strong>16,777,216</strong></p> <p>Reference : <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" rel="nofollow">http...
<p>Is it an executable? If so make sure that </p> <pre><code> Project Settings -&gt; Build -&gt; Prefer 32-bit </code></pre> <p>is unchecked</p>
Smart pointer for holding forward references to objects <p>Assume I have this header:</p> <pre><code>#include &lt;vector&gt; class B; class A { ... private: std::vector&lt;what_pointer B&gt; holder; }; </code></pre> <p>I don't want to include B in the header so I made the "class B" forward reference to it. Howe...
<ul> <li><p>In c++17, you may simply do</p> <pre><code>class B; class A { public: ... ~A(); // define in cpp, as B definition should be known for destruction private: std::vector&lt;B&gt; holder; }; </code></pre> <p>as incomplete types would be allowed for <code>vector</code>.</p></li> <li><p>Currently, you ...
After submit redirect to another page <p>I have search form in php with submit button. (that made like shortcode) I need redirect on another page with data. For example <a href="http://localhost/wordpress/?data_min=21.09.2016&amp;data_max=22.09.2016" rel="nofollow">http://localhost/wordpress/?data_min=21.09.2016&amp;da...
<p>Try this </p> <pre><code>$sHeader = ' &lt;div class="panel list_header"&gt; &lt;form class="filter_form" method="get" action=" http://localhost/search_form/"&gt; &lt;fieldset&gt; &lt;ul&gt;' . $sFilters . '&lt;/ul&gt; &lt...
Login to Odoo from external php system <p>I have a requirement where I need to have a redirect from the external php system to Odoo, and the user should be logged in as well. I thought of the following two ways to get this done:</p> <ol> <li><p>A url redirection from the php side which calls a particular controller,an...
<p>In your php code you could make a jsonrpc call to <code>/web/session/authenticate</code> and receive the session_id in the response. You could pass the session_id as the hash of your url in your redirect. Create a page in odoo that uses javascript to read the hash and write the cookie <code>"session_id=733a54f466362...
UINavigation titleView bug <p>if I set a search bar to the navigation titleView, like </p> <pre><code>navigationController?.navigationBar.topItem?.titleView = self.searchBar </code></pre> <p>, but I set it's frame by using autolayout like:</p> <pre><code>self.searchBar.snp_makeConstraints { make in make.left...
<p>TitleView's layout is managed by navigation controller. The constraints you've added to your view will be ignored when added to titleView. If you want to fully customized the navigation bar, I suggest to create your own view.</p>
How do I get the maximum and minimum dates in a group of repeating cells in Excel <p>I am trying to get the maximum and minimum date and time from a group of cells which have similar names. My table structure would be as follows:</p> <pre><code>+------+----------+------------------+------------------+-----------------...
<p>You can achieve this using <code>MINIFS</code> in excel.</p> <p>In <code>D2</code> enter <code>=MINIFS($C$2:$C$18,$A$2:$A$18,A2,$B$2:$B$18,B2)</code> and drag down. Similarly. use <code>MAXIFS</code> in <code>E2</code> (assuming your data range is <code>A1</code> to <code>E18</code></p> <p>This formula is similar ...
Case insensitive filter in neo4j <p>I am using Spring-data-neo4j to handle neo4j operations. I need to do a case insensitive search based on emailAddress property. I am using followinng code to do the filtering</p> <pre><code>session.loadAll(UserN.class, new Filter("emailAddress", "xyz@gmail.com"), 1); </code></pre> ...
<p>Try <a href="https://github.com/neo4j/neo4j-ogm/blob/8e269cb5264bd3f5e35e255d9151defd26400a83/core/src/main/java/org/neo4j/ogm/cypher/ComparisonOperator.java#L25" rel="nofollow"><code>LIKE</code></a> operator:</p> <pre><code>Filter filter = new Filter("emailAddress", "xyz@gmail.com"); filter.setComparisonOperator(C...
Organizing files in a SBT-based scala project <p>Newcomer to the Intellij IDE here, with no Java background. I've looked at <a href="http://www.scala-sbt.org/0.12.3/docs/Getting-Started/Full-Def.html" rel="nofollow">Build Definition</a> to get a brief idea on how should I organize my scala files, but their example does...
<p>It is described pretty well here: <a href="http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Directories.html" rel="nofollow">http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Directories.html</a></p> <p>But to sum up.</p> <p><strong>.idea:</strong> This contains the project files for your idea project, and ...
Remove message from rabbit MQ after limited attempts of requeing <p>I put records from a file into rabbit mq,read records from queue and call a service.For rejected records,I am sending a negative acknowledgemnt and requeuing with channel.basicNack method.But requirement is that we need to make only some 3 attempts of ...
<p>On the last attempt, set the <code>requeue</code> argument in <code>basicNack</code> to false.</p>
Query performance issue <p>am working with mySql, and with below query am getting performance issue:</p> <pre><code>SELECT COUNT(*) FROM (SELECT company.ID FROM `company` INNER JOIN `featured_company` ON (company.ID=featured_company.COMPANY_ID) INNER JOIN `company_portal` ON (company.ID=company_portal.COMPA...
<p>Be sure you have proper index on :</p> <pre><code> featured_company.DATE_START featured_company.PORTAL_ID job.IS_ACTIVE job.IS_DELETED job.EXPIRATION_DATE job.ACTIVATION_DATE </code></pre> <p>and eventually company.IMAGE</p> <p>Assuming that the id are already indexed </p> <pre><code> company...
Custom Adapter with image and text <p>PLEASE help me how to build autocomplete textview with custom adapter having images and 2 textviews. Not displaying list on type but when i comment the part of images list diaplaying fine but no images displayed.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-co...
<p>Refer <a href="https://akshaymukadam.wordpress.com/2015/02/01/how-to-create-autocompletetextview-using-custom-filter-implementation/" rel="nofollow">Android AutocompleteTextView with Custom Adapter</a></p> <p>in that replace <strong>row_people.xml</strong> code with below code</p> <pre><code>&lt;?xml version="1.0"...
Node.js Express.js: Getting the body of a sent response <p>A sample of my code will be:</p> <pre><code>middlewareA(req,res,next){ res.send('some msg to client'); next() } middlewareB(req,res,next){ var sent_msg_body = res.&lt;some method\property to get body&gt; logger.info(sent_msg_body); } </code></pre>...
<p>You can use <code>request</code> object to get it </p> <p>Do like this:</p> <pre><code>middlewareA(req,res,next){ res.send('some msg to client'); req.message='some msg to client'; next(); } middlewareB(req,res,next){ var sent_msg_body = req.message logger.info(sent_msg_body); } </code></pre>
Application tried to present a nil modal view controller on target in iOS 10? <p>I am implementing MFMailComposeViewController in my application when I click on my mail button I am get the below error.</p> <p><strong>Application tried to present a nil modal view controller on target strong text</strong></p> <p>Here'...
<p>If device has not configured mail or using simulator can lead to crash or exception.</p> <pre><code>mailComposer = [[MFMailComposeViewController alloc] init]; </code></pre> <p>above line of code can cause problem. in simulator initializer method may return <code>NULL</code> or <code>nil</code>.</p> <p>so, just ch...
Node x-ray crawling data from collection of url <p>I'm trying to scrape a list in a site that leads to other pages that has the same formatting.</p> <p>I was able to create a collection of all the a tags, but when I try to visit a collection of pages, the key I try to create with it doesn't get added in my returned ob...
<p>I ran into that problem before and my solution goes like this:</p> <pre><code>var Xray = require('x-ray'); var x = Xray(); x('http://stackoverflow.com/', { title: x('a', [{links:'@href'}]) }) (function(err, obj) { obj.forEach(function(links.link) { x(links.link, "title")(function(err, data){ ...
From fragment to fragment with back button <p>I am still a new App developer and trying out my first app.</p> <p>I have an app that has a main activity with three menu buttons and one button leads to a fragment and within that fragment, there is another button that creates and shows another fragment. So it is like th...
<p>When you are adding fragment, add them to backStack as well. This will allow you to play around already added fragments as you can then deal with them in <code>onBackPressed</code>. </p> <pre><code>@Override public void onBackPressed() { FragmentManager fragmentManager = getSupportFragmentManager(); if (fragme...
AWS javascript API example to list all user pools associated with an account <p>Hi I need AWS cognito javascript API examples which will 1. return me the list of user-pools associated with the account. 2. create a new user pool. I have searched through most of the documentation, but unable to find any relevant answe...
<p>For list User Pools (you basically require the aws sdk, configure credentials, instantiate the client and call the specific operation):</p> <pre><code> var aws = require('aws-sdk'); aws.config.update({accessKeyId: 'akid', secretAccessKey: 'secret'}); var CognitoIdentityServiceProvider = aws.CognitoIdent...
Detection element by letters title <pre><code>private String emailTitle = "Gmail " + System.currentTimeMillis(); WebElement emailLink = driver.findElement(By.xpath("//span[text()='+emailTitle+')]")); emailLink.click(); </code></pre> <p>Problem with finding the letter with specific title. Please help to know how to ma...
<p>can you try below one. am using "containstext" method to find the element</p> <pre><code>emailLink=driver.findElement(By.xpath("//*[contains(text(), '"+emailTitle+"')]")); </code></pre>
An empty snapshotView on iPhone 7/7plus <p>My first question here:) Recently I update my Xcode to 8, and the <code>resizableSnapshotView</code> method doesn't work properly on some simulators. The snapshotView works well on all testing devices with iOS9/10 and simulators under iPhone6s, but it is empty on iPhone7/7p s...
<p>Use the following UIView extension to create a snapshot using CoreGraphics.</p> <p>I can confirm this works on iPhone 7 simulator.</p> <pre><code>public extension UIView { public func snapshotImage() -&gt; UIImage? { UIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque, 0) drawHierarch...
How to create list of instances deriving from a base class that implements interface? <p>Consider the following interface and class declarations.</p> <pre><code>public interface IMessage { string Body { get; set; } } public abstract class MessageBase : IMessage { public string Body { get; set; } } public class...
<p>You need to introduce <code>IMessageProcessor</code> and inherit all your Processors from it. In list you would have to use this interface.</p> <pre><code>public interface IMessage { string Body { get; set; } } public abstract class MessageBase : IMessage { public string Body { get; set; } } public class ...
How to show more then 10 tiles in Cortana list <p>How to show more then 10 tiles in VoiceCommandContentTile? I'm thinking if I can create a tile and LaunchArgument can open second page of list like 11-20 if I have total of 20 tiles. Any idea how to do it?</p>
<pre><code> if (selectedRes.SelectedItem.AppLaunchArgument == "more") { await CortanaList(); } </code></pre> <p>Found out is not that hard. 1. load only 4 or 9 tiles 2. List item be more tiles button 3. catch the AppLaunchArgument and return m...
Fatal Exception: android.view.InflateException: Binary XML file line #20 <p>I'm very new to android development. I know there are many questions like this in stack overflow. I referred those questions but I didn't get solution yet. Whenever I long press the <code>EditText</code> which is inside of <code>TextInputLayout...
<p>I found the issue after spending some hours. The issue is I have missed to add <code>textColorHighlight</code> in my <code>style</code> for <code>TextInputLayout</code>. So, I changed my <code>theme</code> from</p> <pre><code>&lt;style name="TextLabel" parent="TextAppearance.AppCompat"&gt; &lt;item name="an...
R Shiny ggplot brush <p>How to make the brush work and highlight the selected points as red.</p> <p>It seems the <code>brushedPoints</code> function is not working properly.</p> <pre><code>library(shiny) library(ggplot2) server &lt;- function(input, session, output) { D = reactive({ brushedPoints(mtcars,inpu...
<p>The problem exist because you use different data in <code>brushedPoints</code> and <code>ggplot</code> : convert column to character</p> <p>You can try edit data before <code>brushedPoints</code></p> <pre><code>library(shiny) library(ggplot2) server &lt;- function(input, session, output) { mt=mtcars mt[,"cyl...
recursion- return the value twice | python <p>we were given an assignment to write a method that gets a list, and return true if all the elements are positive, false otherwise. We were told to implement recursion in our solution, so I wrote the following thing:</p> <pre><code>def positive_list(li): if len(li) == 1...
<p>Since there is no <code>print</code> statement in the code you have shared, it is never gonna print any value.</p> <p>Your code seems to be alright for the non-empty list, but it will fail if your input list is empty. It will fail with message <code>IndexError: list index out of range</code>.</p> <p>To prevent thi...
Defer all js file but slider revolution not run <p>I have this code to defer all all js in my website using wordpress</p> <pre><code>if (!(is_admin() )) { function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; return "$url' defer='defer"; } add_filter( 'clean_url', 'd...
<p>Its not a good thing to defer all js of your WordPress, it will sure create issues, with your theme and plugins, as far as Revolution Slider is considered, try to follow these steps:</p> <p><strong>Step 1:</strong> </p> <p>Go to <code>Revolution Slider</code> Global Settings</p> <p><strong>Step 2:</strong> </p> ...
I have to create a seperate folder for separate user using php <p>I am using php for first time, i have task to create a seperate directory for seperate users using php. Can anyone please help. Thanks in advance.</p> <pre><code> &lt;?php mkdir("/".$username."/", 0700); $target_path = "/".$username."/"; $target_path = ...
<p>Try this,</p> <pre><code>if (!file_exists($usersname)) { // Makes directory if not exist //mkdir('directory_Name', 0777, true); mkdir($usersname,0777, true); } </code></pre> <p>Read this, <strong><a href="http://php.net/manual/en/function.mkdir.php" rel="nofollow">mkdir</a></strong></p>
Geode Redis Adaptor <p><p>Hi all, hoping someone can assist me with some queries/configuration for the use of the <a href="http://geode.docs.pivotal.io/docs/tools_modules/redis_adapter.html" rel="nofollow">Geode Redis Adapter</a>. I'm having some difficulty ascertaining how/whether I can configure a number of Redis ser...
<p>This may not be an answer, but it is probably too long for a comment. </p> <p>I am not familiar with the specific Geode Redis Adapter you are talking about here. But from my experience with Gemfire/Geode, there are things you may want to check:</p> <ol> <li><p>You started the first host without locators param, I a...
Android Studio 2.2's incremental compiler can't see generated protobufs <p>I upgraded my stable version of Android Studio to 2.2 and now the IDE's "incremental compiler" can't find any of the symbols for generated protobuf classes. I open the project and it can build and deploy the app to a device just fine. But when...
<p>We had the same issue and found out the following:</p> <p>1) In order for idea (studio) to see your source, you need to help it by adding the idea plugin to your module:</p> <pre><code>apply plugin: 'idea' idea { module { // Use "${protobuf.generatedFilesBaseDir}/main/javalite" for LITE_RUNTIME protos ...
How to access an element of list within a list in scala <p>I want to access elements of a list within one list and check whether the elements are greater than a minimum value. Example: List[([1,2],0.3), ([1.5,6],0.35), ([4,10],0.25), ([7,15],0.1)]<br> Let the minimum value: 1<br> The result should be: List[([1,6],0.65)...
<p>OK, what you've written really isn't Scala code, and I had to make a few modifications just to get a compilable example, but see if this works for you.</p> <pre><code>type Interval = (Double,Double) type Rational = Double def reduce (lir:List[(Interval, Rational)]): List[(Interval, Rational)] = { val minVal = 1.0...
VSCode - php not installed? <p>I have VSCode installed, but don't seem to have php - i.e. there is no "php.exe" anywhere on my computer. No guides that I can find on the web about setting VSCode up for PHP suggests that I need to download and install php itself seperately (only debuggers and linters)... my question is:...
<p>Yes you need to install PHP from the php website and then tell VSCode where PHP.exe is located.</p> <p>VSCode is an editor not an interpreter. I think if you install PHP at the default location VSCode will automaticly pick it up but if not you need to specify its path in options.</p> <p>If you install XAMPP you wi...
After Encodeing json i have and extra whitespace, how can i remove that? <p>i have the following array whitch i want to encode to jSon:</p> <pre><code>$output = array("success" =&gt;0,"msg" =&gt; "The e-mail address is already in use"); </code></pre> <p>I am useing the following method to encode:</p> <pre><code>echo...
<p>Likely you have some content after an ending PHP tag. As an example:</p> <pre><code>&lt;?php $output = array("success" =&gt;0,"msg" =&gt; "The e-mail address is already in use"); echo json_encode($output); ?&gt; \n </code></pre> <p>Now I cant represent a new line in the code block but assume the <code>...
Recover an interrupted command in zsh <p>In zsh, if one accidentally interrupted a command (^C), is there a quick way to recover the full interrupted command line?</p> <p>For example,</p> <pre><code>PROMPT $ this is a long command ^C PROMPT $ [cursor here] </code></pre> <p>I would like to recover "this is a long com...
<p>One solution is to</p> <pre><code>zle-line-init () { if [[ -n $ZLE_LINE_ABORTED ]]; then local savebuf="$BUFFER" savecur="$CURSOR" BUFFER="$ZLE_LINE_ABORTED" CURSOR="$#BUFFER" zle split-undo BUFFER="$savebuf" CURSOR="$savecur" fi } zle -N zle-line-init </code></pre> <p>Then, in the new i...
Symfony/Twig: internal ID for form widgets? <p>I've to modify the <code>radio_widget</code> and would like to give the <code>&lt;label&gt;</code> and <code>&lt;input&gt;</code> the same <strong>ID</strong>, which should be <strong>unique</strong> for each pair.</p> <p>Currently I'm using <a href="http://twig.sensiolab...
<p><kbd>ProjectTwigExtension.php</kbd></p> <pre><code>class ProjectTwigExtension extends Twig_Extension { public function getFunctions() { return array( new Twig_SimpleFunction('get_unique_key', array($this, 'getUniqueKey')), ); } private $keys = array(); /** ...
Change something in the clone <p>The first 2 div's comes from database the 3rd is a clone. The problem is that I whant to change the clone but if i do that all div's will change.</p> <p>What I whant:</p> <p>1- the red line (is if the value is false) must not be applied to the clone</p> <p>2- the clone must replace t...
<p>Try this to make changes into the clone, Hope this helps.</p> <pre><code>$(this) .clone() .removeClass() .addClass('ui-icon.ui-icon-close') .appendTo('body'); </code></pre> <p>As per your question, I understand that you would like to create a clone of an element with few new changes. I just show you an idea how to...
How to create a C# class diagram in visual studio 2015/ <p>I need to create a class diagram from my existing code. Suppose I have the following classes - </p> <pre><code>public class Person { public string Name { get; set;} public int Age { get; set;} public Address Address { get; set; } public Educatio...
<p>Right click on .cs file having your classes and click on View Class Diagram: <a href="http://i.stack.imgur.com/8IpL1.png" rel="nofollow"><img src="http://i.stack.imgur.com/8IpL1.png" alt="enter image description here"></a></p> <p>After that go to the class property you want and right click then choose Show As Assoc...
Is guaranteed in a tab "SelectedIndexChanged" always triggers before "Click"? <p>In my tests I see <code>SelectedIndexChanged</code> is always triggered before <code>Click</code> for the tab control.</p> <p><strong>My question:</strong></p> <p>Is this behavior <strong>guaranteed</strong> by the .NET Framework, or are...
<p>You can check the <a href="http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/TabControl.cs,cf84486a6d2fb06c" rel="nofollow">source code</a> of the control TabControl.</p> <p>Basically <code>SelectedIndexChanged</code> is triggered in the <code>WndProc</code> of the <code>Ta...
How to add dynamically C function in embedded Python <p>I declare a C function as Python prototype</p> <pre><code>static PyObject* MyFunction(PyObject* self, PyObject* args) { return Py_None ; } </code></pre> <p>Now I want to add it into a dynamically loaded module</p> <pre><code>PyObject *pymod = PyImport_Impor...
<p>You need to construct a new <code>PyCFunctionObject</code> object from the <code>MyFunction</code>. Usually this is done under the hood using the module initialization code, but as you're now doing it the opposite way, you need to construct the <code>PyCFunctionObject</code> yourself, using the undocumented <code>Py...
Direct3D Full Screen( CreateDevice return D3DERR_INVALIDCALL ) <p>I want to Direct3D full screen using MFC.</p> <p>I made a Custom Static Class. this class initialize direct3d.</p> <p>I success to window mode. but Full screen mode is failed.</p> <p>CreateDevice function return D3DERR_INVALIDCALL(-2005530516).</p> <...
<p>Try to pass m_hWnd to CreateDevice instead of AfxGetMainWindow. Or d3dpp.hDeviceWindow = AfxGetMainWindow. Maybe your m_hWnd is invalid.</p>
how to sum after iff condition in ssrs? <p>I want to sum all the values of the column, using if condition same as the column expression:-</p> <p>The Expression of the normal column:-</p> <pre><code>iif(Fields!mcount.Value &lt;&gt; 0 And Fields!TaxCode.Value = 1 ,Fields!InputAmnt.Value,0) </code></pre> <p>The Express...
<p>Try adding VAL from the InputAmnt field. See below expression.</p> <pre><code>=SUM(iif(Fields!mcount.Value &lt;&gt; 0 And Fields!TaxCode.Value = 1 ,VAL(Fields!InputAmnt.Value),0)) </code></pre>
Add OkHttp to my project <p>I am trying to add <code>OkHttp</code> to my project, i download both <code>OkHttp</code> and <code>Okio</code> library and add it to the <code>libs</code> directory.</p> <p>than i add the compile methods:</p> <pre><code>buildscript { repositories { jcenter() } dependen...
<p>Delete this line of your root gradle :</p> <pre><code>compile 'com.squareup.okhttp3:okhttp:3.4.1' </code></pre> <p>And Add this to your dependencies's app's module build.gradle</p>
Display product value in a button <p>I have three buttons where I select a value and put in the button. Upon selecting all the values in three buttons I want the product of the values to be displayed in another button(fourth button). </p> <p>My html code,</p> <pre><code>&lt;label&gt;S *&lt;/label&gt; ...
<p>Use ng-init="cp.se = 0" or initalize the values in your controller </p>
What is the relationship between the EMV ODA, CA and issuer certificate during the transaction? <p>What is the relationship between the <strong>EMV</strong> <strong>ODA</strong>, <strong>CA</strong> and issuer certificate during the transaction?</p>
<p>Offline data authentication is the process to verify the cards authenticity. Terminals are loaded with CA Public key.</p> <ul> <li>SDA(Static Data Authentication) can assure you the card data has not been altered after the issuance. SDA card contains Signed Static Application Data and Issuer Public Key certificate...
ORIGINAL EXCEPTION: Cannot read property 'Value' of undefined <p>I get this error <code>cannot read property 'Value' of undefined</code> , what am i doing wrong?</p> <pre><code>years: any[] = []; ngOnInit() { for (let i = 1970; i &lt;= new Date().getFullYear(); i++) { this.years.push({'Value': i}); ...
<blockquote> <p>cannot read property 'Value' of undefined</p> </blockquote> <p>clearly you are trying to use <code>.Value</code> on something that does have it. e.g. </p> <pre><code>this.years.push({'Value': i}); let year = undefined; year.Value; // BANG </code></pre> <p>Probably you want something like: </p> <pr...
How to disable youtube background playing in phonegap android <p>My app gets rejected by playstore "modify your app to make sure it doesn't enable background play of YouTube videos", I am using phonegap for android and it seems that the youtube videos are still playing even if my app is in background mode.</p> <p>I ha...
<p>Update the plugin to latest version (1.5.0) and use <code>shouldPauseOnSuspend</code> option set to yes</p> <pre><code>cordova.InAppBrowser.open('http://youtube.com', '_blank', 'shouldPauseOnSuspend=yes'); </code></pre>
How to give permission to access phone Addressbook in ios 10.0? <blockquote> <p>This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this ...
<p>You have to add information list in your plist,</p> <p><a href="http://i.stack.imgur.com/5wxux.png" rel="nofollow"><img src="http://i.stack.imgur.com/5wxux.png" alt="information plist"></a></p> <p>Here is information plist for various privacy.</p> <p>Add Privacy that you want in you plist and check again.</p> <p...
Custom Date format in Sql Server <p>How to customize <strong>Date</strong> result like <strong><em>Wednesday, September 21, 2016</em></strong> in SQL Server 2008</p>
<p><a href="https://msdn.microsoft.com/en-us/library/ms174420.aspx" rel="nofollow">DATEPART</a>+<a href="https://msdn.microsoft.com/en-us/library/ms174395.aspx" rel="nofollow">DATENAME</a>, you can put this into function and use in your query's:</p> <pre><code>DECLARE @date datetime = GETDATE() SELECT DATENAME(WEEK...
Turning my array into a function and making 2nd function to print it <p>Im trying to create a program that has 2 options, view and compute. Right now im trying to figure how to turn my array where i will input my values into a function, so i can go in and out several times to store the values. I also want to view to be...
<p>To help you get started (you should really <a href="http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list">read a beginners book on the subject</a>) I will show you the <code>printArray</code> function.</p> <p>First of all the <code>printArray</code> function needs to know the actual array ...
how to sort id records of data in a table of SQL server from high to low <p>I have a problem to sort data by ID , I tried order by ASC and DESC but non of them did not meet my requirement. normally records registered into table from low to high , for example :</p> <pre><code>ID column1 Coulumn2 1 test1 ...
<p>I guess you want the ID's in reversed order but the rest of the columns in the normal order:</p> <pre><code>SELECT ROW_NUMBER() OVER (ORDER BY ID DESC) AS ID, column1, Coulumn2 FROM dbo.Table1 ORDER BY ID DESC </code></pre> <p><kbd><a href="http://sqlfiddle.com/#!6/8d396/3/0" rel="nofollow"><strong>...
Passing object of multiple types as parameter to a method <p>Since Java 7, we can catch multiple exceptions in the same catch clause like the following.</p> <pre><code>try { ... } catch( IOException | SQLException ex ) { ... } </code></pre> <p>Similarly, Is there any way to implement like the following without ...
<p>Since classes are generated as part of some code gen plugin.</p> <p>You can use composition along with inheritance to solve this issue. </p> <p>Write wrapper class for Type1 and Type2 extending to common interface.</p> <p>This will provide code reusability as well as act as a layer between apllicaton code and 3rd...
Watch app starts with error clientIdentifier for interfaceControllerID not found <p>I'm having a smartwatch app on watchos2. The app always worked but now when it starts I immediately get this error:</p> <pre><code>Lop_WatchKit_Extension[17535:7854201] *********** ERROR -[SPRemoteInterface _interfaceControllerClientID...
<p>Have you changed the name of your module? If this is the case then you have to go through your storyboard and update it manually for all the Interfaces you have.</p> <p>Edit with steps to fix:</p> <p>Go to the storyboard and for each interface open the Identity inspector, then delete what's in Module and press ent...
How to collect a stream into a CopyOnWriteArrayList <p>I'm getting "Incompatible types, required: CopyOnWriteArrayList, found: Object" with the following. I'm using IntelliJ 2016.1.1. </p> <pre><code>CopyOnWriteArrayList&lt;Foo&gt; l = fields.stream() .distinct() ...
<p>It seams like your fields object is not of type Foo , otherwise it should work find below working code.</p> <pre><code>import java.util.ArrayList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; public class Foo { private String name; Foo(Stri...
Spring with Quartz, using SchedulerFactoryBean in custom service <p>I have job with a bean injected to it. I've acheaved using this <a href="http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030#15211030">solution</a>.</p> <p>In this solution the job trigger is setted du...
<p>I found the solution <a href="http://stackoverflow.com/a/21558683/5284890">here</a></p> <p>I could not use <code>SchedulerFactoryBean</code> as a normal bean. When I try to inject it, spring inject <code>Scheduler</code> bean. Therefore my service should look like this:</p> <pre><code>@Service public class Schedul...
XPath - verify contents of @title <p>Background info of my question:<br> I am working in FitNesse, and usually I can use CSS selectors to find and verify the elements I want. However, in this case I need to check a <code>@title</code> attribute through XPath, and I'm having trouble doing so.</p> <p>My FitNesse scenari...
<p>You are using Xebium? I believe they have (actually the Selenium 1 API they use has) a command <code>verifyAttribute</code> that you can use to check attributes instead of the text of the element. (A quick google gave me <a href="http://www.software-testing-tutorials-automation.com/2013/07/selenium-ide-verifyattribu...
How to install newest version of gems not mentioned in Gemfile.lock with bundler <p>When running <code>bundle install</code>, how can I tell it, for gems that aren't mentioned in <code>Gemfile.lock</code>, to download the newest compatible version of the gem, rather than use an older version which happens to be availab...
<p>If you want to have newest version gem, remove version in <code>Gemfile</code> and run <code>bundle install</code> again.</p>
Interdependent Properties with INotifyPropertyChanged <p>I have a WPF-UI with two datepickers. The first datepicker sets the current Date, the second datepicker sets a reference Date. Based on these two dates selected in the datepickers data is loaded into a grid and their change over time is displayed. </p> <p>The pr...
<p>Its better to choose DP over INPC. DP allows <a href="https://msdn.microsoft.com/en-us/library/ms745795%28v=vs.110%29.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow">Coercion, and Validation</a>. But still if you want to use INPC, you can change RefDate in the setter of CurDate, and raise <code>OnPropertyChang...
Iterating string with strchr in C <p>If I have a string like <code>char str [] = "hello;people;how;are;you"</code> and use <code>strchr(str,";")</code> how can I take the N-th token of the string?</p>
<p>look also into strtok() it might me better suited for what you are trying to do.</p>
Unknown column in where clause when using AS <p>I have simple SQL : </p> <pre><code>SELECT TIMESTAMPDIFF(YEAR, bdate, CURDATE()) as age, id, bdate from my_table where age between 20 and 30 </code></pre> <p>I got this error :</p> <blockquote> <p>Unknown column 'age' in 'where clause'</p> </blockquote>
<p>You cant use alias in the <code>where clause</code> you need to reuse the formula for the alias in where clause or use <code>having clause</code> or use outer query </p> <pre><code>SELECT TIMESTAMPDIFF(YEAR, bdate, CURDATE()) as age, id, bdate from my_table having age between 20 and 30 </code></pre> <p>OR</p> <...
How to pass a thunk or callback function into a redux action. Serializing functions in a redux store for modals and toast confirm notifications <p>When using a generic modal or toast with a confirm button, it becomes useful to be able to pass an action into this component so it can be dispatched when you click confirm....
<p>Funny, putting an action object in the store and passing it as a prop to a generic dialog is <em>exactly</em> the approach I came up with myself. I've actually got a blog post waiting to be published describing that idea.</p> <p>The answer to your question is "Yes, <em>but</em>....". Per the Redux FAQ at <a href=...
How to return the actual data from within a timeout instead of the timeout promise <p>I'm trying to return data from a function but I need a timeout in order to wait for some data to be set before doing some actions. However I can't figure out the most vital piece.</p> <p>How can I return <code>'A string'</code> from ...
<p>if you want to wait for some data to be set before doing some actions then try to use a callback function </p> <pre><code>function myfunc1(){ myfunc2(function(data){ console.log(data) // will print 'A string' }) } function myfunc2(callback){ callback('A string') } </code></pre>
Casting in Swift 3.0 <p>I can't find anything about changes in the type-casting in the Swift 3.0 migration guide. However, I've stumbled upon some issued.</p> <p>Consider this playground: (which btw doesnt compile in Xcode 7.3.1 version of Swift)</p> <pre><code>var data1: AnyObject? var data2: AnyObject? var data3: A...
<p><strong>Casting</strong>:</p> <pre><code>switch data1 { case 0 as Int: // use 'as' operator if you want to to discover the specific type of a constant or variable that is known only to be of type Any or AnyObject. } </code></pre> <p>In <em>Swift 1.2 and later</em>, <code>as</code> can only be used for <st...
Reconfiguration of wordpress <p>I recently mess up with my wordpress site. I try to redirect my site to another domain. I do the redirect via Plesk panel. It successfully redirect to another domain.</p> <p>However, the problem is that when I try to reverse the action, the page cannot be browsed. I found out that the o...
<p>First of all, Make sure all files and directory are present in your httpdocs directory which are require for the wordpress also upload your theme if you are using any custom theme for your site. </p> <p>And rename your <strong>wp.config.example.php</strong> TO <strong>wp-config.php</strong> and update your correct ...
Uri for accesing to a specific document in OneDrive <p>In the code below from an Universal App( windows 10), Skype can be opened and the <em>usertocall</em> will be called. If this uri is changed for <strong><em>new Uri(@"ms-Onedrive:");</em></strong> OneDrive App will be opened. Which is the right Uri for getting acce...
<p>You can't use the local protocol handler to access files. It is used for communicating between apps and asking the OneDrive app to display various UI, but won't let you access files.</p> <p>You need to use the OneDrive API (<a href="https://dev.onedrive.com" rel="nofollow">https://dev.onedrive.com</a>) to have acce...
Axon ReplayingCluster with JTA transaction <p>For my Java EE (7) project I want to use the Axon framework. One of the parameters of the Axon <code>ReplayingCluster</code> is a <code>TransactionManager</code>, but Axon only supports <code>NoTransactionManager</code> and <code>SpringTransactionManager</code>. </p> <p>B...
<p>Event replays may involve thousands if not millions of events. Therefore it is often not feasible to manage a single replay in a single transaction (assuming your event listeners make changes that require transactions at all).</p> <p>Axon uses a <code>TransactionManager</code> during replays to commit changes each ...
Locale time on IONIC2 Datetime picker <p>I'm working with IONIC2, Angular2 and Typescript. I have an Datetime working as follows:</p> <blockquote> <p>page.html</p> </blockquote> <pre><code>&lt;ion-datetime displayFormat="DD MMMM YYYY" pickerFormat="DD MMMM YYYY" [(ngModel)]="date"&gt;&lt;/ion-datetime&gt; </code></...
<p>Reading <a href="http://stackoverflow.com/questions/39581875/ionic-2-beta-11-initializing-datetime-component-to-account-for-local-timezone/39600378#39600378">this answer</a> I solve my problem. Finally I use:</p> <pre><code>moment(new Date().toISOString()).locale('es').format(); </code></pre> <p>Thanks to <a href=...
Maven run docker image with java ee application <p>I have a running java ee application which is using wildfly and mysql. Now i heard that docker is using everyone and it is very productive so i decided to dockerize my development environment. Sounds easier than it is.</p> <p>What i have so far:</p> <ul> <li>Maven fo...
<p>there is no straight forward way of doing this - since some of the docker tasks cannot easily be mapped to a maven phase. So you need to choose what a preferred way of working for you is.</p> <p>So some thoughts that hopefully will lead to a solution:</p> <p>The spotify-docker-maven plugin has no mojo's (<a href="...
I want to improve my select statement, can any one help me <p>I have this two SQL select statement, can any one help me to make them in one select statement plez</p> <pre><code>SELECT Misstion.Mis_Link, Misstion.Mis_Disc, Misstion.Mis_Title, Misstion_User.MU_UserID, Misstion.Mis_StartDate, Misstion.Mis_EndDate, Misst...
<p>A very crud description but from my intuition I think you want something like below..</p> <pre><code>SELECT User_Group.UserID, Misstion.Mis_Title, Misstion.Mis_Disc, Misstion.Mis_Link, Misstion.Mis_StartDate, Misstion.Mis_EndDate, Misstion_User.MU_ID, Misstion.Mis_ID, Misstion_User.MU_Date, Misstion...
C# Find best matching element / Simplify query to List <p>I ask myself how I can simplify something like this</p> <pre><code>var myList = new List&lt;MyObject&gt; pulic MyObject FindBestMatching(int Prop1Value, int Prop2Value, int Prop3Value) { MyObject item = null; item = myList.Find(x =&gt; x.Prop1 == Prop1V...
<p>Technically, you can simplify the current code into</p> <pre><code> pulic MyObject FindBestMatching(int Prop1Value, int Prop2Value, int Prop3Value) { return myList.Find(x =&gt; x.Prop1 == Prop1Value &amp;&amp; x.Prop2 == Prop2Value &amp;&amp; x.Prop3 == Prop3Value) ?? myList.Find(x =&gt; x.Prop...
Kivy Scrollview in kv language - id not defined <p>Trying to figure out how to implement a straight-forward ScrollView in KV language based on the examples given in the documentation. I cannot believe I cannot find a single example of this (only parts of solution), so I thought it would be easy. Turns out it's not.</p>...
<p>Kivy is very picky about calling <code>Widget.__init__()</code> first. So if you overwrite <code>__init__</code> of a widget be sure to first call <code>super().__init__</code>, otherwise you can get errors like you encountered or "random" crashes.</p> <p>To fix change</p> <pre><code>class MainScreen(FloatLayout):...
Eclipse Neon 1.RC3 Package crashing on 64-bit Ubuntu 14.04 LTS <p>I recently downloaded <code>Eclipse IDE for Java EE Developers</code>(<a href="http://www.eclipse.org/downloads/packages/release/Neon/1.RC3" rel="nofollow">Eclipse Neon 1.RC3 Package</a>) for Linux 64 bit as I am using Ubuntu 14.04LTS 64-bit. Every time ...
<p>First, use the Neon release from <a href="http://eclipse.org/downloads" rel="nofollow">http://eclipse.org/downloads</a> . Then if it still fails, it may brme because Ubuntu uses a modified version of GTK3 on 14.04 that has issues with Eclipse IDE. If problem persist with the Neon release, try <code>SWT_GTK3=0 ./ecli...
UIImagePickerController crashes on iOS10 <p>On presenting <code>UIImagePickerController</code> with photo library source on <em>iOS10</em>, my app crashes.</p> <p>On <em>iOS10 with</em> camera source and on <em>iOS9</em> with photo library and camera sources, the app does not crash.</p> <p>The app is written in <em>S...
<p>You may need to put the NSCameraUsageDescription (if your app uses the Camera) and NSPhotoLibraryUsageDescription (if your app uses the Photo Library) in your plist. Like below,</p> <pre><code>&lt;key&gt;NSCameraUsageDescription&lt;/key&gt; &lt;string&gt;$(PRODUCT_NAME) needs access to use your camera&lt;/string&gt...
Does trivial copying and moving operations differ? <p>Let's look at some trivially move-constructible and (not trivially) copy-constructible (but still copy-constructible) user-defined (class) type <code>A</code>:</p> <pre><code>struct A { A() = default; A(A const &amp;) {} A(A &amp;&amp;) = default; }; </...
<p>Is there a use case where a type could have a trivial copy constructor without having a trivial move constructor? Sure.</p> <p>For example, it could be useful to have a pointer wrapper type that will always be empty when moved from. There's no reason for the copy constructor to be non-trivial, but the move construc...
__init__ vs __enter__ in context managers <p>As far as I understand, <code>__init__()</code> and <code>__enter__()</code> methods of the context manager are called exactly once each, one after another, leaving no chance for any other code to be executed in between. What is the purpose of separating them into two method...
<blockquote> <p>As far as I understand, <code>__init__()</code> and <code>__enter__()</code> methods of the context manager are called exactly once each, one after another, leaving no chance for any other code to be executed in between.</p> </blockquote> <p>And your understanding is incorrect. <code>__init__</code>...
Can IntelliJ IDEA Replace in Path Preview the CHANGED text <p>When using IntelliJ IDEA's Replace in Path the preview panel shows the text occurrences that <strong>will</strong> be changed as they are now. Is there any way to preview what the text will be <strong>after</strong> the change?</p> <p>eg In the following I ...
<p>As of IntelliJ IDEA 2016.2, only single-file replace actions support showing replacement preview. Multi-file find &amp; replace, as well as refactorings, only support showing the list of locations that are going to be changed, but not the state after the operation.</p>
Why is the return type reference to output stream? <p>I am new to C++ and learning operator overloading. Now in the followng code, I get everything except little bit confused as to <strong>why the return type is reference to output stream?</strong></p> <p>We have the following enum.</p> <pre><code>enum days{ SON, SAT...
<blockquote> <p>why the return type is reference to output stream?</p> </blockquote> <p>Returning <code>ostream&amp;</code> making it possible to chain it, like</p> <pre><code>std::cout &lt;&lt; SON &lt;&lt; SAT &lt;&lt; MON &lt;&lt; TUE &lt;&lt; WED &lt;&lt; THRUS &lt;&lt; FRI; </code></pre> <p>BTW: <a href="http...
cAdvisor custom metrics with heapster format <p>I currently have a Kubernetes cluster configured with Heapster/InfluxDB/Grafana.</p> <p>I know that the Kubelet now has an embedded cAdvisor instance that I have configured to look at an application endpoint to gather custom metrics. </p> <p>I followed this guide: <a hr...
<p>Kubernetes currently only supports gathering custom metrics in the Prometheus format. Your configuration is for a generic collector, so the prometheus collector isn't able to parse it.</p> <p>As an experiment, you could manually change the docker label on the container running on the host from <code>io.cadvisor.met...
How to redirect a URL to Application URL in WildFly <p>I have deployed spring mvc application on WildFly 9. Application Name is MyApp.war.Now I am getting my application by putting the complete URL(<a href="https://MyappDomainName.com/MyApp" rel="nofollow">https://MyappDomainName.com/MyApp</a>) like this on the browser...
<p>Modified the standalone.xml by adding the following.</p> <pre><code>&lt;server name="default-server"&gt; &lt;http-listener name="default" socket-binding="http" redirect-socket="https"/&gt; &lt;https-listener name="httpsServer" socket-binding="https" security-realm="ApplicationRealm"/...
Nil is not compatible with expected argument type Optional<UnsafeMutableRawPointer> <p>I'm just updating my iOS app's code to Swift 3 and this line is foxing me:</p> <pre class="lang-swift prettyprint-override"><code>let dataProvider:CGDataProvider? = CGDataProviderCreateWithData(nil, maskImagePixelData!, maskImagePix...
<p>Got it:</p> <pre class="lang-swift prettyprint-override"><code> let releaseMaskImagePixelData: CGDataProviderReleaseDataCallback = { (info: UnsafeMutableRawPointer?, data: UnsafeRawPointer, size: Int) -&gt; () in // https://developer.apple.com/reference/coregraphics/cgdataproviderreleasedatacallback ...
SystemC Verification building error 'undefined reference to..' <p>I am having a problem with not being able to build any code that contains any usage of SCV functions. I am using Eclipse and Cygwin. This is a simple code that I am trying to build and run:</p> <pre><code>#include &lt;scv.h&gt; int sc_main (int argc, c...
<p>I found out the answer! <a href="http://forums.accellera.org/topic/5617-building-error-undefined-reference-to/" rel="nofollow">Here</a> is the link to it, if anyone ever needed it! Just needed to change the order of adding scv and systemc libraries.</p>
Uploadcare save URL in database PHP <p>I have encountered something that might be useful to anyone using uploadcare.com (or similar) to save pictures for user profiles. Sorry in advance if the question was answered and I haven't found it.</p> <p><strong>The question:</strong> I'm currently working on a script with Upl...
<p>Michael, first - I have edited your question to remove the secret key - one that you passed as the second argument to Uploadcare\Api() - it is not supposed to be seen by anyone in public.</p> <p>Not sure why you embedded formphoto.php in registration.php, but I placed input tag directly in registration form and did...
Firebird strip procedures, trggers views and udf <p>I am preparing a new Version of my software making the transition from Firebird 1.5 to 3. My Installation program backs up the 1.5 database and restores it through the 3 server or embedded server depending on the installation type (local/multiuser). This all works we...
<p>Thanks to Mark, I tried once more and eventually somehow got altering all views to "select 1 as test from rdb$database" working and then could delete them.</p> <p>As I have many different versions of my schema in the field I am not exactly sure which dependencies excactly I will come across. So I wrote this PSQL Bl...
VB6 - How to detect a file is finished copying from an external source <p>My software (written in VB6) needs to import csv files that can be large. Users are using copy/paste to place the files in the input folder.<br> <strong>How can I be sure the files I want to read are fully copied before processing them?</strong><...
<p>I've used this method which uses the API to test for exclusive access. I've never tried it on a platform other than Windows so, I guess result may vary. I use this in a module of frequently used methods, but I believe I have included the API calls, types, and constants used.</p> <pre><code>Private Const ERROR_SHARI...
Drawing an UML abstract class on the paper without italic? <p>How should I represent an abstract class (in Java) in an UML diagram drawn by hand on the paper without using italic font? </p>
<p>The annotation <code>{abstract}</code> below the classname can be used.</p> <p>Should look like this:</p> <pre><code>+---------------+ | Classname | | {abstract} | +---------------+ </code></pre> <p>UML specs p. 99:</p> <blockquote> <p>The name of an abstract Classifier is shown in italics, where permit...
search for pattern and remove all lines <p>I have system logs where alarms are written. in my case i have lots of repeated alarms which i want to ignore and focus only on new alarms that might be exist.</p> <p>sample alarm :</p> <pre><code> kbl1infn8:CCC_USER_2049.0002:2016/09/20-17:00:03.560451-00540-03276-CCC_USER_...
<p>Assuming your alarms are multi line and two alarms are separated with each other by <code>--</code>. </p> <pre><code>awk -v RS="--" '{$1=$1} !/RC USSDString/' alarmfile </code></pre> <p>If you want to add , multiple string to be excluded from output then:</p> <pre><code>awk -v RS="--" '{$1=$1} !/string-1/ || !/...
How to pass the object back to Main thread from another threads in Android? <p>I have a fragment in which I start the thread. In this thread I get a object and after that I want to pass the object to the main thread. What shall I do for this?</p> <pre><code>public class IFragment extends Fragment { private v...
<p>you can try using the Join method in Thread. Other way you can do this also in a multi-threading program is to Synchronized the Object with you want to share between Threads. by synchronizing the object , you must then first allow other thread that will finished manupulating the Object to have access first, and you ...
Parsing NBA reference with python beautiful soup <p>So I'm trying to scrape out the miscellaneous stats table from this site <a href="http://www.basketball-reference.com/leagues/NBA_2016.html" rel="nofollow">http://www.basketball-reference.com/leagues/NBA_2016.html</a> using python and beautiful soup. This is the basi...
<p><code>&lt;!--</code> is the start of a comment and <code>--&gt;</code> is the end in html so just remove the comments before you parse it:</p> <pre><code>from bs4 import BeautifulSoup import requests comm = re.compile("&lt;!--|--&gt;") html = requests.get("http://www.basketball-reference.com/leagues/NBA_2016.html"...
How to access Build Setting Constants like $(PROJECT_DIR) in swift? <p>I am working on Server side swift (Perfect 2.0). Is there a way to get access to Xcode's build setting variable "$(PROJECT_DIR)" or "$(SRCROOT)" with out using any CocoaTouch frameworks. i.e CoreFoundation. ?</p> <p>what actually I want is to acces...
<p>I would suggest using Perfect's file and directory handling. <a href="https://www.perfect.org/docs/file.html" rel="nofollow">https://www.perfect.org/docs/file.html</a></p>
SQL temporal table: It is possible to change logging time from UTC to current time? <p>I like temporal tables in SQL Server 2016 and I want to use this in a new project. Unfortunately, it seems that sql is logging UTC time in history table, not the current time. It is possible to change this ?</p> <p>To see what I mea...
<p>It is not. From <a href="https://msdn.microsoft.com/en-gb/library/mt631669.aspx" rel="nofollow">Temporal Table Usage Scenarios</a>:</p> <blockquote> <p>System-versioned temporal tables store values for period columns in UTC time zone, while it is always more convenient to work with local time zone both for filter...
Writing pandas DataFrame to JSON in unicode <p>I'm trying to write a pandas DataFrame containing unicode to json, but the built in <code>.to_json</code> function escapes the characters. How do I fix this?</p> <p>Some sample code:</p> <pre><code>import pandas as pd df=pd.DataFrame([['τ','a',1],['π','b',2]]) df.to_js...
<p>Opening a file with the encoding set to utf-8, and then passing that file to the <code>.to_json</code> function fixes the problem:</p> <pre><code>with open('df.json', 'w', encoding='utf-8') as file: df.to_json(file, force_ascii=False) </code></pre> <p>gives the correct:</p> <pre><code>{"0":{"0":"τ","1":"π"}...