Method logic explanation
◷
تاریخ انتشار: 1395/2/7 | ساعت: 20:00
Vote count: -2 Given the following method public int countSomething (int[] p) { int count = 0; for (int i = 0 ; i < p.length ; i++) { count++; int j = p [i]; while (j != i) { j = p [i]; count++; } } System.out.println (count); retu count; } int[] arr = {0, 2, 3, 1}; I know countSomething(arr) retu s...
Android: How to create a Facebook like images gallery grid
◷
تاریخ انتشار: 1395/2/7 | ساعت: 20:00
Vote count: 0 enter image description here I want to create layout like this any code and help is appreciated asked 4 mins agoHardik Mehta Let's block ads! (Why?)
3-column carouel slider black and white centered image
◷
تاریخ انتشار: 1395/2/7 | ساعت: 15:06
Vote count: 0 I use the following carousel slider and I want left and right image to be black & white except from centered image. I have to use the following css3: -webkit-filter: grayscale(100%); filter: grayscale(100%); Where should I write it? Thanks in advance! enter code here https://jsfiddle.n...
"message": "Undefined property: $response", dingo api with laravel 5.2
◷
تاریخ انتشار: 1395/2/7 | ساعت: 15:06
Vote count: 0 I am trying to implement dingo API with laravel 5.2 Following is a function which I have written for testing dingo public function profile() { try { $user = JWTAuth::parseToken()->toUser(); if (!$user) { retu response()->json(['error' => 'User Not Found'], 500); } } catch (TymonJWTAuth...
Does elasticsearch consider empty string as null?
◷
تاریخ انتشار: 1395/2/7 | ساعت: 15:06
Vote count: 0 I would like to know if elasticsearch considers empty string as null value, but based on my mapping shown below, I don't see that it is doing that. How can I make elasticsearch consider empty string as a null and index using the value provided by null_value. My mapping is shown below: ...
check the output, now i don't know how to pick the repeated words from the output?
◷
تاریخ انتشار: 1395/2/7 | ساعت: 13:09
Vote count: 0 from bs4 import BeautifulSoup import urllib2 # Imported libraries for future use. response = urllib2.urlopen('http://www.nytimes.com').read() soup = BeautifulSoup(response,"lxml") host = [] #created empty list to append future words extracted from data set. for story_heading in soup.fi...
How can we "view selected rows" (selecting from dropdown) in Jquery Datatable
◷
تاریخ انتشار: 1395/2/7 | ساعت: 13:09
Vote count: 0 I am facing a problem in jQuery Datatable, is that I have a dropdown and a datatable with pagination enabled. If I checked few rows from 1st and 2nd page So the Total number of Rows selected should be binded on Datatable. Is it possible or some other alte ative concept is there? <selec...
'NoneType' object has no attribute 'get_all_security_groups'
◷
تاریخ انتشار: 1395/2/7 | ساعت: 13:09
Vote count: 0 I am kinda stuck here. . . . for region in regions: co ection=ec2.co ect_to_region(region) print co ection sg=co ection.get_all_security_groups() print sg try: for securityGroup in sg: for rule in securityGroup.rules: This results in the following EC2Co ection:ec2.us-west-2.amazonaws.c...
Leftmost Right Sibling General Tree; copying contents of one tree to another
◷
تاریخ انتشار: 1395/2/7 | ساعت: 11:26
Vote count: 0 So I am currently ru ing into a an a oying situation with my General Tree. I have an object called General Tree that implements a leftmost right sibling Node style. I used this implementation because I would like to have as many nodes as desired. So I have no issue in creating a Tree, ...
MYSQL - Select MIN and MAX year and fill the gaps
◷
تاریخ انتشار: 1395/2/7 | ساعت: 11:26
Vote count: 0 I want to use Highcharts (bar) with my database, but I am struggling how to bring the JSON using my select. I have three levels: Gold, Silver, Platinum and I need to get the minimum year and maximum year and cover the gaps if that level is not present in some year I have this select: s...
Qt build both release and debug libraries
◷
تاریخ انتشار: 1395/2/7 | ساعت: 11:26
Vote count: 0 I needed to install Qt SDK to Redhat backend machine which does not have a GUIs. (Amazon ec2). When I tried to install it failed due to fail to co ect display. Then I tried to download the source and compile. If I use configure -debug, it only compile debug libraries. Same as it compil...
Reading mulitple nextint
◷
تاریخ انتشار: 1395/2/7 | ساعت: 9:02
Vote count: 0 The sca er stops reading the integers after the first one from the sca er class. How do I make it read them all, even if there are spaces? My assignment is due very soon so if someone could help me, that would be awesome. System.out.println("please enter numbers to decrypt"); num = sc....
Basic authentication android UrlConnection Get
◷
تاریخ انتشار: 1395/2/7 | ساعت: 9:02
Vote count: 0 So I am making a test login app so I can use look at how the app and the server are behaving together. So I have three endpoints that I am working with. All three download json file so I can just print that out no problem. The issue is they all require a user name and password. I got t...
Php 5 to php 7 session pb
◷
تاریخ انتشار: 1395/2/7 | ساعت: 9:02
Vote count: 0 Ubuntu is now in php7 and I have a pb with my application and I don't know how to resolve this. Could you help me. Where i can change this element? Thank you. The errors Wa ing: session_regenerate_id(): Session callback expects true/false retu value in /home/www//boutique/includes/func...
protractor-cucumber json report
◷
تاریخ انتشار: 1395/2/7 | ساعت: 8:00
Vote count: 0 I know that this question has been asked many times before and I followed the link to one of them but couldn't really get it working. My protractor config file has enter image description here but when I execute the testcases the json report doesn't get generated for some reason.I am m...
Having domain.com/keyword as home URL
◷
تاریخ انتشار: 1395/2/7 | ساعت: 8:00
Vote count: 0 I have just been asked whether or not having a domain such as exampledomain.com/keyword as the home URL to a WordPress site is a good idea or not. We are a digital agency so we would be going for exampledomain/digital-agency as the root URL. I know this is a cague question but any idea...
Rails 4.2.6 generator model. Inherit from other class
◷
تاریخ انتشار: 1395/2/7 | ساعت: 8:00
Vote count: 0 Now, when I run rails g model foo I get class Foo < ActiveRecord:Base end and I want to get like class Foo < MyCustomClass end asked 51 secs agoMike Belyakov Let's block ads! (Why?)
Loading UIViewController from instantiateViewControllerWithIdentifier - nil outlets
◷
تاریخ انتشار: 1395/2/7 | ساعت: 5:56
Vote count: 0 I honestly can't understand what am i doing wrong. I have this shared Instance of my UIViewController : static let sharedInstance = UIStoryboard(name:"Main", bundle:nil).instantiateViewControllerWithIdentifier("IAPNEW") as! newIAPClass If i'm presenting it, without accessing it outlets...
How to achieve layer separation, without mixing my Repository with my API Service?
◷
تاریخ انتشار: 1395/2/7 | ساعت: 5:56
Vote count: 0 (There is a TL;DR: at the bottom) I have a PDF produced via MVC patte . I am working with an existing code, which was a bit of a mess, but now I am seeing a patte emerge. Currently, I have a Controller class, and inside I have many many separate functions, roughly one function per page...
Display form fields depending on DropDownList selection
◷
تاریخ انتشار: 1395/2/7 | ساعت: 5:56
Vote count: 0 When a user selects an Asset Type, i want my "Create" form to display different fields depending on the Asset Type selected. For example: if a user selects Asset Type "Laptop", i want the form to display all the relevant fields for a Laptop Asset. However, if a user selects Asset Type ...