خرید بک لینک
Recent Questions - Stack OverflowAdd Multiple scalapb Source Directories to Multi-Project SBT Buildpython unicode #-*- coding: utf-8 -*- not doing the jobI want to break the loop by a string input . But the program is taking input infinitelyLink app to like-page: like-page not foundencrypting and decripting and object that first was a JSONCompare date in two yearAccessing object data slicing numpy arrayUninitialized constant in query with joinsHow to pick out a certain row from textfile c++ [on hold]Prevent striping of HTML tagsAngularJS: Service not retuing dataGetting string length won't workjQuery trigger alert when select options are selected within multiple formsJavascript object does not see inteal functionBash script to get all file with desired extensionsOracle query on time (and not date)How to get parent node in a tree structure like thisCoded UI Test Builder fails to generate code for recorded actionGoogle Maps API & geoxml 3 - Zoom to placemark on click/Center placemark on mapspark streaming kafka backpressureHow to convert python code to Spark compatible Code (pyspark)?Using CoreData how to configure a fetch request to find upcoming birthdays?What is the recommended way to share Session across webforms and MVC in the same web application?Add and remove observer from multiple AVPlayerItem on UITableViewCellMathML: Left Adjust Equation Numbers in Table of EquationsEdited cruise work for NetLogo 5.3 version, background image is not getting displayedFrequency Table for categorical variables with empty groupsMaximum block of bits of 1 in a 32 bits array VerilogCan pip.conf specify two index-url at the same time?url not loading in UIWebView

most recent 30 from stackoverflow.com 2016-04-15T14:12:32Z http://stackoverflow.com/feeds/ http://www.creativecommons.org/licenses/by-sa/3.0/rdf http://stackoverflow.com/q/36649433 0 dthagard http://stackoverflow.com/users/1269488 2016-04-15T14:07:53Z 2016-04-15T14:07:53Z <p>I'm having some difficulties understanding the syntax for scalapb, specifically I'm trying to add multiple .proto source directories for a multi-project SBT build.</p> <p>My project structure is as follows:</p> <pre><code>/build.sbt /main/src/protobuf /common/main/src/protobuf /client/main/src/protobuf </code></pre> <p>My build.sbt is as follows:</p> <pre><code>name := "myApp" import Dependencies._ import com.trueaccord.scalapb.{ScalaPbPlugin =&gt; PB} val protoDirectories = Seq( file("common/src/main/protobuf"), file("client/src/main/protobuf") ) PB.protobufSettings ++ Seq( flatPackage := false, sourceDirectories ++= protoDirectories ) lazy val common = (project in file("common")). settings(Commons.settings: _*). settings(libraryDependencies ++= commonDependencies) lazy val client = (project in file("client")). settings(Commons.settings: _*). settings(libraryDependencies ++= clientDependencies). dependsOn(common) </code></pre> <p>When I run <code>sbt compile</code>, I get the following error message:</p> <pre><code>[error] Reference to undefined setting: [error] [error] sphere/*:sourceDirectories from myApp/*:sourceDirectories (&lt;path_to_project_dir&gt;build.sbt:11) [error] Did you mean myApp/protobuf:sourceDirectories ? </code></pre> <p>Could someone please point me in the right direction? I'm failing to understand some basic concept here...</p> http://stackoverflow.com/q/36649431 0 mike braa http://stackoverflow.com/users/5792491 2016-04-15T14:07:50Z 2016-04-15T14:07:50Z <p>Hello this is what I want to do; I simply want to switch a word,"with" here with non-english, translation of the word "with".</p> <pre><code>retu "&lt;a href='%(verify_read)s?next=%(target_url)s'&gt;%(sender)s %(verb)s %(target)s with %(action)s&lt;/a&gt;" %context </code></pre> <p>I'm unable to use other non-english in the retu. I don't know why...I have python file, I'm using django, and have put # -<em>- coding: utf-8 -</em>- at the top of my python file </p> <p>This is my full code</p> <pre><code>def __unicode__(self): target_url = self.target_object.get_absolute_url() context = { "sender":self.sender_object, "verb":self.verb, "action":self.action_object, "target":self.target_object, "verify_read": reverse("notifications_read", kwargs={"id": self.id}), "target_url":target_url, } if self.target_object: if self.action_object and target_url: retu "%(sender)s %(verb)s &lt;a href='%(verify_read)s?next=%(target_url)s'&gt;%(target)s&lt;/a&gt; with %(action)s" %context if self.action_object and not target_url: retu "%(sender)s %(verb)s %(target)s with %(action)s" %context retu "%(sender)s %(verb)s %(target)s" %context retu "%(sender)s %(verb)s" %context @property def get_link(self): try: target_url = self.target_object.get_absolute_url() except: target_url = reverse("notifications_all") context = { "sender": self.sender_object, "verb": self.verb, "action": self.action_object, "target": self.target_object, "verify_read": reverse("notifications_read", kwargs={"id": self.id}), "target_url": target_url, } if self.target_object: retu "&lt;a href='%(verify_read)s?next=%(target_url)s'&gt;%(sender)s %(verb)s %(target)s with %(action)s&lt;/a&gt;" %context else: retu "&lt;a href='%(verify_read)s?next=%(target_url)s'&gt;%(sender)s %(verb)s&lt;/a&gt;" %context </code></pre> http://stackoverflow.com/q/36649429 0 abu obaida http://stackoverflow.com/users/6201931 2016-04-15T14:07:41Z 2016-04-15T14:09:47Z <p>I want to break the loop by a string input . But the program is taking input infinitely.</p> <pre><code>public static void main(String[] args) { int i; String test; Scaer inputString = new Scaer(System.in); while(1==1){ test=inputString.next(); if(test=="Break"){ break;} } System.out.println("the loop actually broke"); } </code></pre> http://stackoverflow.com/q/36649428 0 Elena S http://stackoverflow.com/users/6209619 2016-04-15T14:07:40Z 2016-04-15T14:07:40Z <p>I've some problem to link my app to my like-page on Facebook; I already have a like-page but what I see is this:</p> <p>[[1]: <a href="http://i.stack.imgur.com/CGc3q.png][1]" rel="nofollow">http://i.stack.imgur.com/CGc3q.png][1]</a></p> <p>as my Facebook profile hadn't a like-page (I have three like-pages, actually, none of them is shown among the options..)</p> <p>Thank you, Elena</p> http://stackoverflow.com/q/36649425 1 Lima9 http://stackoverflow.com/users/6087631 2016-04-15T14:07:25Z 2016-04-15T14:07:25Z <p>I am trying to encrypt an object that is a JSON, in order to do so first i convert it to String, encrypt it and when is decrypted it cames back as random simbols because it is unable to convert it.</p> <p>I try to encrypt: </p> <pre><code> { a: 'A', L: 'GET ALL USERS', Po: { ttp: 'localhost:3000/ttp/allusers', b: 'localhost:8000/server/allusers', Mhash: '6d2e5cc3a67ae82ae7edf6fb6054f977' } } var mensajeToBbignum = bignum.fromBuffer(new Buffer(x)); console.log('nCleartext:', mensajeToBbignum.toBuffer().toString(),'n'); var mensajeToBcrip = keys2.publicKey.encrypt(mensajeToBbignum); console.log('encryption with public:', 'n', mensajeToBcrip.toBuffer().toString('base64'), 'n'); </code></pre> <p>From String to encryption i have the following:</p> <pre><code>{"a":"A","L":"GET ALL USERS","Po":{"ttp":"localhost:3000/ttp/allusers","b":"localhost:8000/server/allusers","Mhash":"6d2e5cc3a67ae82ae7edf6fb6054f977"}} </code></pre> <p>And finally encrypted in base64:</p> <pre><code> augf1Fuv2GwOYy0aipv1u6LZ3nWvGVz4M9JoA8uhlJgbuoGtYxe0GLSW+u6s1/kiOIqeF0s0cmCFgzpj/oKdF+0k9+OC/TVBgmk+1mO19pWnhcfS42j5OKPpy27mx0tRymQcS7TVDDsak2JptEv7O3POAvWVAKZRJ13zGMwP4qU= </code></pre> <p>I know it receives the same string in base64 with this code:</p> <pre><code>var recibidoBignum = bignum(req.body.mensaje); console.log('recibidoBignum:', 'n', recibidoBignum.toBuffer().toString('base64'), 'n'); var reqdecrip = keys.privateKey.decrypt(recibidoBignum); console.log('decryption with private:', 'n', reqdecrip.toBuffer().toString(), ''); </code></pre> <p>And the following logs: encryption with public: </p> <pre><code>augf1Fuv2GwOYy0aipv1u6LZ3nWvGVz4M9JoA8uhlJgbuoGtYxe0GLSW+u6s1/kiOIqeF0s0cmCFgzpj/oKdF+0k9+OC/TVBgmk+1mO19pWnhcfS42j5OKPpy27mx0tRymQcS7TVDDsak2JptEv7O3POAvWVAKZRJ13zGMwP4qU= decryption with private: �8����P�`��t�&gt; �x)���m��S���n�l� �:�17^�����l�}%��綷K�N�Y�a-5��J���p���8�@�b�Vs� </code></pre> <p>So it seems it can encrypt a JSON object but then is unable to decrypt it</p> http://stackoverflow.com/q/36649336 0 vahid http://stackoverflow.com/users/2319945 2016-04-15T14:03:54Z 2016-04-15T14:09:19Z <p>I have a table of population that I want to compare population in two year. </p> <p>My table structure:<br> id (auto increment), type (man,woman,child), population (1 to 10000), date</p> <p>I want run two under query and show into one table result: </p> <p>query1: </p> <pre><code> SELECT type, COUNT(population) AS count_of_year1 FROM population WHERE date BETWEEN '2013-01-01' AND '2013-01-24' GROUP BY type </code></pre> <p>query2:</p> <pre><code> SELECT type, COUNT(population) AS count_of_year2 FROM population WHERE date BETWEEN '2014-01-01' AND '2014-01-24' GROUP BY type </code></pre> <p>I need this result table:</p> <pre><code>type----population_of_year1-------population_of_year2 </code></pre> <p>How to do this?</p> http://stackoverflow.com/q/36649251 2 Kyle Hunter http://stackoverflow.com/users/5577564 2016-04-15T14:00:02Z 2016-04-15T14:07:34Z <p>So i'm working on optimizing some python code by using numpy arrays instead of for each loops. Is there any way to access fields from a class during slicing of a numpy array?</p> <pre><code>class foo: the_int = 0 def __init__(self, i): self.bar = i one, two = foo(5), foo(10) ar = array([one, two]) int_array = ar[0:2].the_int #I want int_array = [5, 10] </code></pre> <p>If that isn't possible in that maer, how would I efficiently generate my "int_array" variable without using a for each loop to loop through "ar", gather "the_int" from each entry?</p> <p>Thanks, Kyle</p> http://stackoverflow.com/q/36649155 0 Łukasz Korol http://stackoverflow.com/users/4645227 2016-04-15T13:55:57Z 2016-04-15T14:12:06Z <p>Hi I want to use joins to match two entities.</p> <p>Expected result:</p> <pre><code>select sum(price) from entry_types ier join bought_details on entry_types.id = bought_details.entry_type_id </code></pre> <p>Now I have:</p> <pre><code>@sum_eaings = EntryType.joins(:bought_details).sum(:price) </code></pre> <p>There is a error:</p> <pre><code>uninitialized constant EntryType::BoughtDetail </code></pre> <p>Schema information:</p> <pre><code># Table name: bought_details # # id :integer not null, primary key # bought_data :date not null # end_on :date not null # entry_type_id :integer # person_id :integer # start_on :date # Table name: entry_types # # id :integer not null, primary key # kind :string not null # kind_details :string not null # description :text # price :decimal(5, 2) not null </code></pre> <p>How to resolve this problem? What does mean this error? Thanks in advance.</p> <p>Models:</p> <pre><code>class Backend::EntryType &lt; ActiveRecord::Base has_many :bought_details end class Backend::BoughtDetail &lt; ActiveRecord::Base belongs_to :entry_type end </code></pre> http://stackoverflow.com/q/36649141 -7 Grunter http://stackoverflow.com/users/4108291 2016-04-15T13:55:27Z 2016-04-15T14:07:48Z <p>Is there an easy way to store a row of text from a textfile to a <code>string</code> variable, if lets say you have a list of names like this:</p> <pre><code>name1 name2 name3 name4 </code></pre> <p>How do I store, lets say "name2" from the text file in a variable ex. <code>string choice;</code> ?</p> http://stackoverflow.com/q/36649111 0 boomcode http://stackoverflow.com/users/5790063 2016-04-15T13:54:25Z 2016-04-15T14:07:25Z <p>I am making an HTML editor in my application, which takes the HTML content from the database and copies it in an content editable DIV. But after making the changes, it strips the <code>&lt;html&gt;</code>, <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code> tags, but keeps the body content.</p> <p>How can I resolve the issue?</p> <pre><code> document.getElementById('editHtmlView').ierHTML = document.getElementById('content').value; </code></pre> <p>where #content has the content fetched from database.</p> <pre><code>&lt;div id="editHtmlView" contenteditable="true"&gt;&lt;/div&gt; </code></pre> http://stackoverflow.com/q/36649106 0 Sreehari http://stackoverflow.com/users/2367302 2016-04-15T13:54:19Z 2016-04-15T14:11:24Z <p>I have been trying to get data from a json file through service in AngularJS(1.5.3). I am unable to retrieve the data from json and display it in the view. I get blank values instead. Below is the code:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>//Service angularStoreApp.factory('dataService', ['$http', function ($http, $q) { retu { getProducts: function () { var promise = $http.get('/api/json/products.json') .then(function successCallback(response) { if (typeof response.data === 'object') { retu response.data; } else { // invalid response retu "Invalid data"; } }, function errorCallback(response) { retu "Invalid data"; }) retu promise; } }; }]); //Controller /// &lt;reference path="SearchController.js" /&gt; angularStoreApp.controller('SearchCtrl', ['$scope', 'dataService', function ($scope, dataService) { $scope.ProductItems = []; dataService.getProducts() .then(function (data) { $scope.ProductItems = data; }); }]);</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;blockquote&gt; &lt;h4 style="color: salmon"&gt;Welcome to the New Store &lt;br /&gt; Please select the products you want and add them to your shopping cart. &lt;br /&gt; When you are done, click the shopping cart icon to review your order and checkout. &lt;br /&gt; &lt;/h4&gt; &lt;div class="row"&gt; &lt;div class="col-sm-12" ng-repeat="ProductItem in ProductItems track by $index"&gt; {{ProductItem.Name}}, {{ProductItem.Price}} &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>Could anyone help me out.</p> http://stackoverflow.com/q/36649054 -5 Antônio Dias Fagundes http://stackoverflow.com/users/5721735 2016-04-15T13:52:10Z 2016-04-15T14:07:31Z <p>I'm using below code to find out what is the length of a given string:</p> <pre><code>string foo = "Welcome to stack overflow"; int strlen; for (int i=0; i&lt;foo.length; strlen++){} Console.WriteLine(strlen.ToString()); </code></pre> <p>But the code never leaves the loop.</p> <p>I'm a begginer really and this is kinda bugging me.</p> http://stackoverflow.com/q/36649049 -1 Adam http://stackoverflow.com/users/5969803 2016-04-15T13:51:49Z 2016-04-15T14:09:48Z <p>I have three forms created with woocommerce (see attached), I want to be able to target each form and then when the first and second select options have been selected within each, an alert message is triggered - only when select option one and select option two is valid/selected.</p> <p>The problem, when selecting an option the alert is triggered with only the product id and that options value, instead of alerting once both select options have been selected and alerting confirmation message. </p> <p>This should be simple right?</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function variationForms() { $('form.variations_form').on('change', function() { // Product ID var product_id = $(this).data('product_id'); alert(product_id); // Select 1 Value var select_one = $(this).find('[id=covers]').val(); alert(select_one); // Select 2 Value var select_two = $(this).find('[id=extras]').val(); alert(select_two); // Message if (product_id &amp;&amp; select_one &amp;&amp; select_two) { alert('Confirm Selection') } }); }; variationForms();</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form class="variations_form cart" method="post" enctype="multipart/form-data" data-product_id="form_207"&gt; &lt;table class="variations" id="product_207" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td class="value"&gt; &lt;select id="covers" class="" name="attribute_covers" data-attribute_name="attribute_covers"&gt; &lt;option value="" selected="selected"&gt;Choose an option&lt;/option&gt; &lt;option value="6" class="attached enabled"&gt;6&lt;/option&gt; &lt;option value="7" class="attached enabled"&gt;7&lt;/option&gt; &lt;option value="8" class="attached enabled"&gt;8&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="value"&gt; &lt;select id="extras" class="" name="attribute_extras" data-attribute_name="attribute_extras"&gt; &lt;option value="" selected="selected"&gt;Choose an option&lt;/option&gt; &lt;option value="Fruit" class="attached enabled"&gt;Fruit&lt;/option&gt; &lt;option value="Cake" class="attached enabled"&gt;Cake&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/form&gt; &lt;form class="variations_form cart" method="post" enctype="multipart/form-data" data-product_id="form_206"&gt; &lt;table class="variations" id="product_206" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td class="value"&gt; &lt;select id="covers" class="" name="attribute_covers" data-attribute_name="attribute_covers"&gt; &lt;option value="" selected="selected"&gt;Choose an option&lt;/option&gt; &lt;option value="6" class="attached enabled"&gt;6&lt;/option&gt; &lt;option value="7" class="attached enabled"&gt;7&lt;/option&gt; &lt;option value="8" class="attached enabled"&gt;8&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="value"&gt; &lt;select id="extras" class="" name="attribute_extras" data-attribute_name="attribute_extras"&gt; &lt;option value="" selected="selected"&gt;Choose an option&lt;/option&gt; &lt;option value="Fruit" class="attached enabled"&gt;Fruit&lt;/option&gt; &lt;option value="Cake" class="attached enabled"&gt;Cake&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/form&gt; &lt;form class="variations_form cart" method="post" enctype="multipart/form-data" data-product_id="form_205"&gt; &lt;table class="variations" id="product_205" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td class="value"&gt; &lt;select id="covers" class="" name="attribute_covers" data-attribute_name="attribute_covers"&gt; &lt;option value="" selected="selected"&gt;Choose an option&lt;/option&gt; &lt;option value="6" class="attached enabled"&gt;6&lt;/option&gt; &lt;option value="7" class="attached enabled"&gt;7&lt;/option&gt; &lt;option value="8" class="attached enabled"&gt;8&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="value"&gt; &lt;select id="extras" class="" name="attribute_extras" data-attribute_name="attribute_extras"&gt; &lt;option value="" selected="selected"&gt;Choose an option&lt;/option&gt; &lt;option value="Fruit" class="attached enabled"&gt;Fruit&lt;/option&gt; &lt;option value="Cake" class="attached enabled"&gt;Cake&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/form&gt;</code></pre> </div> </div> </p> <p><strong>SCREENSHOT:</strong><br/> <a href="http://i.stack.imgur.com/DSVjY.png" rel="nofollow">Screenshot</a></p> http://stackoverflow.com/q/36648827 0 Hans http://stackoverflow.com/users/909227 2016-04-15T13:40:52Z 2016-04-15T14:07:52Z <p>I'm trying to create a javascript prototype style class like this ...</p> <pre><code>const _FormValidator = function(fieldDefinition){ // check the regEx is actually a regEx const regEx = fieldDefinition.regEx; const regExType = Object.prototype.toString.call(regEx); if (regExType === '[object RegExp]'){ this.regEx = regEx; } // just make the mandatory property true or false. this.isMandatory = false; if (fieldDefinition.mandatory){ self.isMandatory = true; } } _FormValidator.prototype.validateRegEx = function(value){ const regEx = this.regEx; if (!regEx){ retu true; } retu regEx.test(value); } _FormValidator.prototype.validateMandatory = function(value){ if (!value){ retu !this.mandatory; } retu true; } _FormValidator.prototype.validate = function(value){ const validRegEx = this.validateRegEx(value); const validMandatory = this.validateMandatory(value); retu validRegEx &amp;&amp; validMandatory; } export const FormValidator = _FormValidator; </code></pre> <p>The FormValidator is imported and used as a constructor in side a Meteor (1.3) helper for a Blaze Template. </p> <p>However I get the response <code>validator.js:33 Uncaught TypeError: this.validateRegEx is not a function</code>. I'm struggling to figure out why. Can anyone help?</p> <p><strong>Update the comment gave me the hint I needed - solution below.</strong></p> <p>This is what I used to do to call validate (inside a Meteor Blaze template): </p> <p>I initialize the validator in the <code>onCreated</code> method like this: </p> <pre><code> const validator = new FormValidator(instance.data.field); instance.validate = validator.validate; </code></pre> <p>Then I used to call it as <code>instance.validate(value)</code>.</p> <p>I have now changed this to: </p> <pre><code> const validator = new FormValidator(instance.data.field); instance.validator = validator; </code></pre> <p>And call this as <code>instance.validator.validate(value)</code> which resolves the issue. Sorry I'm still hitting utter confusion when dealing with this in javascript. </p> http://stackoverflow.com/q/36648621 -1 AndreaF http://stackoverflow.com/users/1145744 2016-04-15T13:32:42Z 2016-04-15T14:09:08Z <p>I'm trying to write a bash script that if I pass a text file containing some extension and a folder retus me an output file with the list of all files that match the desired extension, searching recursively in all sub-directories</p> <p>the folder is my second parameter the extension list file my first parameter</p> <p>I have tried:</p> <pre><code>for i in $1 ; do find . -name $2*.$i -print&gt;&gt;result.txt done </code></pre> <p>but doesn't work</p> http://stackoverflow.com/q/36648234 0 Marcus Leon http://stackoverflow.com/users/47281 2016-04-15T13:15:46Z 2016-04-15T14:07:48Z <p>How can you query on just the time portion of an Orace date field. Ie:</p> <pre><code>select * from mytable where date_column &lt; '05:30:00' </code></pre> <p>Want the query to retu any rows where the time represented by date_column is less than 5:30 regardless of the date.</p> http://stackoverflow.com/q/36647672 0 Zulis http://stackoverflow.com/users/1436789 2016-04-15T12:51:38Z 2016-04-15T14:07:16Z <p>How it would be possible to get a parent when tree structure is like this:</p> <pre><code>public class TreeModel { public int ID { get; set; } public List&lt;TreeModel&gt; Children { get; set; } } </code></pre> <p>Let's say we can't add a parent element item to this class (public TreeModel Parent { get; set; }).</p> <h1>Edit</h1> <p>How to get element m22 (ID=22) parent m2 (ID=2) from the m1? I thought we could iterate through m1 and somehow retu parent when condition is right.</p> <pre><code>var m1 = new TreeModel() { ID = 1 }; var m2 = new TreeModel() { ID = 2 }; var m21 = new TreeModel() { ID = 21 }; var m22 = new TreeModel() { ID = 22 }; var m3 = new TreeModel() { ID = 3 }; m1.Children.Add(m2); m2.Children.Add(m21); m2.Children.Add(m22); m1.Children.Add(m3); var parent = m1.GetParent(p =&gt; p.ID == 22); //&lt;-- How? </code></pre> http://stackoverflow.com/q/36645903 1 Dmytro Tsiniavskyi http://stackoverflow.com/users/1346161 2016-04-15T11:26:22Z 2016-04-15T14:07:25Z <p>I try to record the simplest Coded UI action in IE ruing on Windows 10 from my Visual Studio 2015 Enterprise. The problem is that recently I started to get <code>Value caot be null. Parameter name: key</code> error each time I click <code>Add and Generate</code> button.</p> <p><a href="http://i.stack.imgur.com/TCSGf.png" rel="nofollow"><img src="http://i.stack.imgur.com/TCSGf.png" alt="enter image description here"></a></p> <p>Also each time I hover the link on IE web page I get Access is denied error. I believe these problems could be related.</p> <p><a href="http://i.stack.imgur.com/EieTW.png" rel="nofollow"><img src="http://i.stack.imgur.com/EieTW.png" alt="enter image description here"></a></p> <p>One more issue is that I can not generate any assertions since am unable to select any web control on web page. After I placed Coded UI Test Builder's crosshair in the middle of text input the whole document was highlighted. <a href="http://i.stack.imgur.com/tSihg.png" rel="nofollow"><img src="http://i.stack.imgur.com/tSihg.png" alt="enter image description here"></a></p> <p>To fix the issue I was advised to check project references. So I included any possibly related to Coded UI reference I could find. This is the full list of references included in the project:</p> <p><a href="http://i.stack.imgur.com/T0UHD.png" rel="nofollow"><img src="http://i.stack.imgur.com/T0UHD.png" alt="enter image description here"></a></p> <p>Except that I've already tried to:<br> 1. Restart VS<br> 2. Restart PC<br> 3. Run VS and IE as administrator (related to Access is Denied issue)<br> 4. Added new UIMap file to the project. I tried to record actions there.<br> 5. As it was suggested in one of the Idea <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/efa0bb2e-8d1a-4213-95a7-fb521cfad97e/get-access-is-denied-while-recording-on-code-ui-test-builder?forum=vstest" rel="nofollow">here</a> I checked browser zoom level and set it to 100%. 6. Started new solution with new CodedUI test project. 7. Started Coded UI from Visual Studio developer command prompt.</p> <p>Most of the solutions in the web are to reinstall Visual Studio and if it doesn't help - reinstall Windows. This is unacceptable solution for me. <strong>How can I solve the issue without reinstalling my Visual Studio and/or Windows?</strong></p> http://stackoverflow.com/q/36645128 0 Nathan http://stackoverflow.com/users/5516686 2016-04-15T10:48:56Z 2016-04-15T14:07:49Z <p>Hi i'm trying to create a custom map using Google Maps API and geoxml3. I have managed to set up the map and add a custom sidebar with a list of placemarks which are loaded from an exteal KML.xml file.</p> <p>I want to have it so when you click a placemark from the sidebar, or on the map itself, the map will auto center on the placemark and also zoom in.</p> <p>Heres the HTML and Script I have so far,</p> <p>HTML: </p> <pre><code>&lt;head&gt; &lt;title&gt;Test Map&lt;/title&gt; &lt;link rel="stylesheet" href="css/style.css" type="text/css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="map"&gt; &lt;div id="map"&gt;&lt;/div&gt; &lt;div id="side_bar"&gt; &lt;h3&gt;Locations&lt;/h3&gt; &lt;div id="sidebar"&gt;&lt;/div&gt; &lt;p&gt;*Click to show location on map&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Scripts --&gt; &lt;script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAWj4S3HGnCZ2ZzlRg4bfb4Z7HcpJ82tl8&amp;"&gt;&lt;/script&gt; &lt;script src="js/map.js"&gt;&lt;/script&gt; &lt;script src="js/geoxml3.js"&gt;&lt;/script&gt; &lt;!-- jQuery --&gt; &lt;script src="js/jquery.js"&gt;&lt;/script&gt; &lt;/body&gt; </code></pre> <p>Script:</p> <pre><code>// When the window has finished loading create our google map below google.maps.event.addDomListener(window, 'load', initialize); var geoXml = null; var geoXmlDoc = null; var map = null; var myLatLng = null; var myGeoXml3Zoom = false; var sidebarHtml = ""; var infowindow = null; var kmlLayer = null; var filename = "test.kml.xml"; function initialize() { myLatLng = new google.maps.LatLng(52.60426, 1.72764); // these set the initial center and zoom for the map // if it is not specified in the query string var lat = 52.60426; var lng = 1.72764; var zoom = 16; if (!isNaN(lat) &amp;&amp; !isNaN(lng)) { myLatLng = new google.maps.LatLng(lat, lng); } var myOptions = { zoom: zoom, center: myLatLng, streetViewControl: false, mapTypeControl: false, zoomControl: true, // How you would like to style the map. // This is where you would paste any style found on Snazzy Maps. styles: [{"featureType":"all","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"administrative.country","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"administrative.province","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"administrative.neighborhood","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels.text","stylers":[{"visibility":"on"}]},{"featureType":"transit","elementType":"labels","stylers":[{"visibility":"off"}]}] // zoom: 16, // center: myLatlng, }; map = new google.maps.Map(document.getElementById("map"), myOptions); infowindow = new google.maps.InfoWindow({}); geoXml = new geoXML3.parser({ map: map, infoWindow: infowindow, singleInfoWindow: true, zoom: myGeoXml3Zoom, afterParse: useTheData }); geoXml.parse(filename); }; function kmlClick(pm) { if (geoXml.docs[0].placemarks[pm].marker.getMap()) { google.maps.event.trigger(geoXml.docs[0].placemarks[pm].marker,"click"); } else { geoXmlDoc.placemarks[pm].marker.setMap(map); google.maps.event.trigger(geoXmlDoc.placemarks[pm].marker,"click"); } } // == builds the sidebar == function makeSidebarEntry(i) { var name = geoXmlDoc.placemarks[i].name; if (!name || (name.length == 0)) name = "marker #"+i; // alert(name); sidebarHtml += '&lt;tr id="row'+i+'"&gt;&lt;td&gt;&lt;img src='+geoXmlDoc.placemarks[i].style.href+' height="20" alt="icon" /&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="javascript:kmlClick('+i+');"&gt;'+name+'&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;'; } function makeSidebar() { sidebarHtml = '&lt;table&gt;&lt;tr&gt;&lt;/tr&gt;'; var currentBounds = map.getBounds(); // if bounds not yet available, just use the empty bounds object; if (!currentBounds) currentBounds=new google.maps.LatLngBounds(); if (geoXmlDoc) { for (var i=0; i&lt;geoXmlDoc.placemarks.length; i++) { if (geoXmlDoc.placemarks[i].marker) { if (currentBounds.contains(geoXmlDoc.placemarks[i].marker.getPosition())) { makeSidebarEntry(i); } } } } sidebarHtml += "&lt;/table&gt;"; document.getElementById("sidebar").ierHTML = sidebarHtml; } function useTheData(doc){ var currentBounds = map.getBounds(); if (!currentBounds) currentBounds=new google.maps.LatLngBounds(); // Geodata handling goes here, using JSON properties of the doc object sidebarHtml = '&lt;table&gt;&lt;tr&gt;&lt;/tr&gt;'; // var sidebarHtml = '&lt;table&gt;'; geoXmlDoc = doc[0]; for (var i = 0; i &lt; geoXmlDoc.placemarks.length; i++) { // console.log(doc[0].markers[i].title); var placemark = geoXmlDoc.placemarks[i]; if (placemark.marker) { if (currentBounds.contains(placemark.marker.getPosition())) { makeSidebarEntry(i); } } /* doc[0].markers[i].setVisible(false); */ } sidebarHtml += "&lt;/table&gt;"; document.getElementById("sidebar").ierHTML = sidebarHtml; }; </code></pre> <p>Any help would be greatly appreciated.</p> http://stackoverflow.com/q/36641401 0 YichaoCai http://stackoverflow.com/users/6016213 2016-04-15T07:57:16Z 2016-04-15T14:07:40Z <p>We have a Spark sSreaming application, it reads data from a Kafka queue in receiver and do some transformation and output to hdfs. The batch interval is 1min, we have already tuned the backpressure and <code>spark.streaming.receiver.maxRate</code> parameters, so it works fine most of the time.</p> <p>But we still have one problem. When hdfs is totally down, the batch job will hang for a long time (let us say the hdfs is not working for 4 hours, and the job will hang for 4 hours), but the receiver does not know that the job is not finished, so it is still receiving data for the next 4 hours. This causes OOM exception, and the whole application is down, we lost a lot of data.</p> <p>So, my question is: is it possible to let the receiver know the job is not finishing so it will receive less (or even no) data, and when the job finished , it will start receiving more data to catch up. In the above condition , when HDFS is down , the receiver will read less data from Kafka and block generated in the next 4 hours is really small, the receiver and the whole application is not down, after the HDFS is ok, the receiver will read more data and start catching up</p> http://stackoverflow.com/q/36639592 0 marupav http://stackoverflow.com/users/5751573 2016-04-15T06:19:12Z 2016-04-15T14:07:28Z <p>I have a pyspark code which can extract the required names from the piece of text.This codes gives me the results,but takes hell lot of time to process on my large data as some part of it is more pythonic.Request your help to convert it into more pyspark way to improve the efficiency (new to spark environment)</p> <pre><code>articles=sc.textFile("file:///home//XXX//articles.csv").map(lambda line: line.split(",")) articles_ls=list(articles.map(lambda x: [x[0].lower(),x[1].lower(),x[2].lower(),x[3].lower().strip()]).collect()) #Function which needs to be optimized to run faster def mapper(f): article_list=[] list1=[] list2=[] list3=[] list4=[] list5=[] list6=[] list7=[] for i in range(len(articles_ls)): for j in range(len(articles_ls[i])-1): comment=re.split(r'W+', f.lower().strip()) if articles_ls[i][j] in comment: if articles_ls[i][j]: if articles_ls[i][3] == 'typea': if articles_ls[i][j] not in list1: list1.append(articles_ls[i][0]) if articles_ls[i][3] == 'typeb': if articles_ls[i][j] not in list2: list2.append(articles_ls[i][0]) if articles_ls[i][3] == 'typec': if articles_ls[i][j] not in list3: list3.append(articles_ls[i][0]) if articles_ls[i][3] == 'typed': if articles_ls[i][j] not in list4: list4.append(articles_ls[i][0]) if articles_ls[i][3] == 'typee': if articles_ls[i][j] not in list5: list5.append(articles_ls[i][0]) if articles_ls[i][3] == 'typef': if articles_ls[i][j] not in list6: list6.append(articles_ls[i][0]) if articles_ls[i][3] == 'typeg': if articles_ls[i][j] not in list7: list7.append(articles_ls[i][0]) list1 = list(set(list1)) list2 = list(set(list2)) list3 = list(set(list3)) list4 = list(set(list4)) list5 = list(set(list5)) list6 = list(set(list6)) list7 = list(set(list7)) article_list.append([("ProductA:".split())+list1]+[("ProductB:".split())+list2]+[("ProductC:".split())+list3]+ [("ProductD:".split())+list4]+[("ProductE:".split())+list5]+[("ProductF:".split())+list6]+ [("ProductG:".split())+list7]) retu article_list lines = sc.textFile("file:///home//XXX//data.csv").map(lambda line: line.split(",")).map(lambda x: (x[0],x[1],x[2].encode("ascii", "ignore"))) articles_all = (lines.map(lambda x: (x[0],x[1],x[2],(mapper(x[2].lower()))))) </code></pre> http://stackoverflow.com/q/36637896 1 Murray Sagal http://stackoverflow.com/users/1614300 2016-04-15T03:45:09Z 2016-04-15T14:07:52Z <p>Given a <code>Person</code> entity that has a <code>birthDate</code> attribute how do I configure a fetch request to retu upcoming birthdays? Here’s what I have tried: </p> <ol> <li><p>I created a transient attribute called <code>birthDateThisYear</code> and configured it to retu the person’s birthday this year. But I discovered that you can’t use a transient attribute in a fetch request with Core Data. </p></li> <li><p>I tried the accepted answer <a href="http://stackoverflow.com/questions/3455512/custom-sorting-using-categories-and-core-data-is-it-supported-by-the-framework">here</a> by denormalizing with <code>birthDateDayNumber</code> and <code>birthDateMonthNumber</code> attributes along with a custom setter for <code>birthDate</code> but I couldn’t figure out the predicate. What if today was Dec 31? Somehow it would need to wrap around to include Jan, Feb, and Mar. </p></li> <li><p>I read that it could be done with expressions and comparison predicates. But I couldn’t figure out a solution. Anyone got this working?</p></li> <li><p>I thought it work to create a denormalized attribute called <code>birthDateInYear2000</code> but, again, that suffers from the same overlap problem. </p></li> </ol> <p>I’m using Xcode 7.3 and Swift 2.2.</p> <p>Any ideas? </p> http://stackoverflow.com/q/36633499 0 BeeTee2 http://stackoverflow.com/users/3046754 2016-04-14T20:36:52Z 2016-04-15T14:07:34Z <p>I have a legacy webforms application that is ruing on asp.net 4.6.1 that I'm heavily involved in modifying, so I'm adding new functionality as MVC. So far everything has worked fine, until today when I needed to access Session in both webforms and MVC. </p> <p>I've tried this approach: <a href="http://stackoverflow.com/questions/15637491/how-to-inject-httpcontextbase-using-autofac-in-asp-net-mvc-4">How to inject HttpContextBase using Autofac in ASP.NET MVC 4</a></p> <p>And this approach: <a href="http://stackoverflow.com/questions/5447611/why-are-there-two-incompatible-session-state-types-in-asp-net/5448138#5448138">Why are there two incompatible session state types in ASP.NET?</a></p> <p>I have a login.aspx page, where a variable gets stored in the Session in webforms via:</p> <pre><code>HttpSessionStateBase session = new HttpSessionStateWrapper(HttpContext.Current.Session); var model = Service.GetModel(); Utilities.AddModelToSession(session, model); </code></pre> <p>Which calls this helper function.</p> <pre><code>public static void AddModelToSession(HttpSessionStateBase session, Model model) { try { if (model != null) { session["Model"] = model; } } catch (Exception ex) { ExceptionHelper.LogException(ex); } } </code></pre> <p>And here is how I retrieve the session variable:</p> <pre><code>public static Model GetModelFromSession(HttpSessionStateBase session) { try { if (session["Model"] != null) { var model = (Model)session["Model"]; retu model; } retu null; } catch (Exception ex) { ExceptionHelper.LogException(ex); retu null; } } </code></pre> <p>Here is how the code from web forms code behinds creates the session variable to pass into the helper method:</p> <pre><code>HttpSessionStateBase session = new HttpSessionStateWrapper(HttpContext.Current.Session); if (Utilities.GetModelFromSession(session) != null) execute some code... </code></pre> <p>The problem is when I try to set a viewmodel property in an MVC controller for logic on showing / hiding a login button, the MVC controller doesn't pick up the session variable, it's null.</p> <p>Everything works fine on my development VM (Windows 10 using IIS 10), the session variables seem to work across webforms and MVC. However, when I deploy the code to our test environment, it just doesn't work (IIS 7.0). I've looked at IIS logs on our test environment, and didn't notice anything suspicious. There is nothing in the exception logs indicating that an exception is being thrown in my Utilities class. I'm also logging requests and logging the SessionID to the database, and across both webforms and MVC, the SessionID from asp.net is being saved to the database as the same value.</p> <p>Here is the code from the MVC Controller where I'm trying to access the session variable:</p> <pre><code>public class HomeController : Controller { public ActionResult Header(string currentController) { var viewModel = new HeaderViewModel { ShowHome = currentController != "home", ShowLogin = Utilities.GetModelFromSession(Session) == null }; retu PartialView("_Header", viewModel); } } </code></pre> <p>The Session variable passed into GetModelFromSession above (^) is of type System.Web.HttpSessionStateBase.</p> <p>I also have this registered in my Global.asax.cs:</p> <pre><code>builder.RegisterModule(new AutofacWebTypesModule()); </code></pre> <p>I'm at a loss of where else to look to solve this problem. Every article I've read says this can be done, but I'm not having much luck. Any help would be greatly appreciated! I'd prefer not persisting Session State via SQL Server currently, if possible.</p> <p>The only noticeable symptom is that, in the test environment, after I login using the webforms code, and navigate to an MVC page, there is a <em>noticeable</em> delay before the page loads, and the session variable is lost. There is no database call on this page either, so it's caused by the runtime. However, there is nothing in the logs (IIS, web server) to indicate there is a problem. This delay is <em>not present</em> on my local development VM.</p> <p><strong><em>Update</em></strong> I've also tried removing and re-adding the System.Web.SessionState.SessionStateModule in IIS, and in the web.config of the application, recycling the App Pool and the Site in the test environment. That didn't do the trick either. I just figured I would update in hopes of saving anyone the time who would have suggested that.</p> <p><strong><em>Update 2</em></strong> I just tried moving the session management from InProc to SqlServer. The SqlServer session management is working, but I'm having the same issue still. I verified that the session is persisted in the <em>ASPStateTempSessions</em> table, and the SessionId value stored there matches what I am logging to the database on each request. That SessionId is also logged when I navigate to the MVC route. </p> <p>Across all webforms pages in the application, the session value is persisted, but when I navigate to the MVC route, the session value is <strong>not</strong> persisted. This tells me the problem is somewhere besides the InProc .net session management.</p> http://stackoverflow.com/q/36632104 0 Panda http://stackoverflow.com/users/3576792 2016-04-14T19:20:49Z 2016-04-15T14:07:48Z <p>i am trying to make a table view that plays multiple videos with <code>AVPlayer</code> and <code>AVPlayerItem</code> and i needed to addObserver to each <code>AVPlayerItem</code> so i can keep track of playbackLikelyToKeepUp property</p> <p>what i tried and failed is adding the observer after setting the <code>AVPlayerItem</code> and removing it in the <code>deinit</code> of the <code>UITableViewCell</code> but since the cells never gets deallocated but gets dequeued so this won't work and i will get this error </p> <pre><code>An instance 0x14eedebc0 of class AVPlayerItem was deallocated while key value observers were still registered with it. </code></pre> <p>After searching I came up with this</p> <ul> <li>I should not add or remove observers on <code>UITableViewCell</code> but i had to because the player item is made in the cell subclass</li> <li>The best way to handle observer is within 'UITableViewDelegate' methods </li> <li>Adding in <code>willDisplayCell</code> and removing in <code>didEndDisplayingCell</code></li> </ul> <p>but even that does not work in my case because <code>AVPlayerItem</code> takes time to be initialized </p> <pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! TableViewCell cell.setUpPLayer() retu cell } override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { let cell = cell as! TableViewCell if cell.Player == nil { self.addObserversToCell(cell) } } override func tableView(tableView: UITableView, didEndDisplayingCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { let cell = cell as! TableViewCell self.removeMyObserversFromCell(cell) } </code></pre> <p>so the observer won't be add in the <code>willDisplayCell</code> but removing the observer will be called and will cause runtime error with </p> <pre><code>'Caot remove an observer &lt;AVFPlayer.TableViewCell 0x13cf1e9b0&gt; for the key path "playbackLikelyToKeepUp" &lt;AVPlayerItem0x13cf31860&gt; because it is not registered as an observer.' </code></pre> <p>if anyone knows how to achieve this , I would be happy to know ? thanks</p> http://stackoverflow.com/q/36628111 0 Stephen http://stackoverflow.com/users/6204990 2016-04-14T15:52:38Z 2016-04-15T14:07:47Z <p>I want to have each of the equation numbers in the following code snippet left adjusted while the corresponding equations "X" and "Y" be centered in the browser window. I am at a loss as how to do this.</p> <pre><code>&lt;mml:math mode="display" display="block"&gt; &lt;mml:mtable&gt; &lt;mtable side='left'&gt; &lt;mlabeledtr&gt; &lt;mtd&gt;&lt;mtext&gt;(1)&lt;/mtext&gt;&lt;/mtd&gt; &lt;mml:mi&gt;X&lt;/mml:mi&gt; &lt;/mlabeledtr&gt; &lt;/mtable&gt; &lt;mml:mtr&gt; &lt;mtable side='left'&gt; &lt;mlabeledtr&gt; &lt;mtd&gt;&lt;mtext&gt;(2)&lt;/mtext&gt;&lt;/mtd&gt; &lt;mml:mi&gt;Y&lt;/mml:mi&gt; &lt;/mlabeledtr&gt; &lt;/mtable&gt; &lt;/mml:mtr&gt; &lt;/mml:mtable&gt; </code></pre> <p>The image below shows the result of the code above. What I don't want - everything is left aligned. Just the equations "X" and "Y" should be centered.</p> <p><a href="http://i.stack.imgur.com/2J7wM.png" rel="nofollow"><img src="http://i.stack.imgur.com/2J7wM.png" alt="enter image description here"></a></p> <p>The MathML code is an edited version of that generated by Export: TeX -> XHTML in Scientific Word. I include a script that calls mathjax to properly render the code in all browsers</p> <p>Because this is my first visit to this site, let me know if I haven't provided sufficient information for someone to answer by query.</p> http://stackoverflow.com/q/36568976 0 Abha Trivedi http://stackoverflow.com/users/5109878 2016-04-12T09:23:59Z 2016-04-15T14:07:52Z <p>I replaced the code whereever it was needed to for NetLogo 5.3 latest version. Whole code is too long to paste here and since there is no syntax error, I attached the runing interface of this edited model. At run time the background image was not there and turtles rotate at the same position without any displacement.</p> <p><a href="http://i.stack.imgur.com/CGzWJ.png" rel="nofollow"><img src="http://i.stack.imgur.com/CGzWJ.png" alt="enter image description here"></a></p> <p>The last part of the code reports a big combination of digits and it is said that this "can be removed if data file used for map".</p> <p>Further, I replaced the statement: 'set datfile datfile + ".dat" ' with 'set datfile word datfile ".dat" '<br> How to get the background image and make the model work. Is there any option to get the new version of cruise work. Thanks in advance.</p> http://stackoverflow.com/q/36559857 0 Oligg http://stackoverflow.com/users/5847561 2016-04-11T21:45:59Z 2016-04-15T14:07:31Z <p>I am trying to do a frequency table of categorical variables by category. I was using the <code>aggregate</code> function with <code>table</code> and it was working well. </p> <p>My problem is the following: There is a variable with empty groups and the output gets all messy (table contains vectors).</p> <p>Is there a package that does it or another function i could use with <code>aggregate</code>? </p> <p>Also, if you feel very enthousiast, i need to put the proportion of group beside the freq (but i should be able to figure that out myself)</p> <p>Reproducible data :</p> <pre><code>group &lt;- c(sample(1:3,100, replace = T), rep(4,11)) problem &lt;- c(sample(0:2,100, replace = T),sample(0:1,11,replace=T)) correct &lt;- sample(1:3,37, replace = T) df&lt;- data.frame(correct, problem, group) </code></pre> <p>This is the function i was using: </p> <pre><code>temp &lt;- aggregate(df, by=list(df[,"group"]),FUN=table) result &lt;- t(subset(temp, select=-Group.1)) </code></pre> <p>Any suggestions or help will be appreciated :)</p> <p><strong>EDIT:</strong> This is the output i get with what i've tried. I would want to have the 2nd variable formatted like the first one but with a 0 where the group is empty.</p> <pre><code> Group.1 correct.1 correct.2 correct.3 problem group 1 1 15 9 9 9, 11, 13 33 2 2 12 8 21 11, 15, 15 41 3 3 14 2 10 11, 11, 4 26 4 4 7 2 2 6, 5 11 </code></pre> http://stackoverflow.com/q/36477729 0 Vlad http://stackoverflow.com/users/6141675 2016-04-07T13:30:22Z 2016-04-15T14:07:14Z <p>I am a begier in Verilog and I have this task.</p> <p>max_pass circuit filters an array of 32 bits such that the blocks of bits 1 of maximum length remain on position and everything else becomes 0.</p> <p>A block/set is consisted of minimum 2 bits of 1.</p> <p>The circuit has to be combinational and the interface of the max_pass module is:</p> <pre><code>input [31:0] din ; output [31:0] dout ; </code></pre> <p>The circuit has no memory. Output immediately sees any changes in input.</p> <p>It is recommended to use modular and hierarchical design.</p> <p><strong>Examples</strong></p> <pre><code>Example 1 input: 01011100111111111111011100101010 output: 00000000111111111111000000000000 The maximum length of a block is 12. Example 2 input: 00100111111001001011111100101101 output: 00000111111000000011111100000000 Two blocks of maximum length of 6. Example 3 input: 11011011011011011011011011011011 output: 11011011011011011011011011011011 Eleven blocks of maximum length of 2. </code></pre> http://stackoverflow.com/q/30889494 2 andy http://stackoverflow.com/users/1889327 2015-06-17T10:54:14Z 2016-04-15T14:07:50Z <p>I have tried using pip with index-url in <code>pip.conf</code>. However, i can not make sure that we can get all the necessary python library. So, i want to know if pip support specify more than one <code>index-url</code> in <code>[global]</code> section in <code>pip.conf</code>.</p> http://stackoverflow.com/q/5645275 9 mua http://stackoverflow.com/users/692275 2011-04-13T06:31:53Z 2016-04-15T14:07:09Z <p>i have a tab bar control. 1st tab contains a navigation control. On the 2nd tab i want to load a web page (say google.com). I have written the code as </p> <p><strong>NPIViewController.h</strong></p> <pre><code>@interface NPIViewController : UIViewController { IBOutlet UIWebView *webView; } @property (nonatomic,retain) IBOutlet UIWebView *webView; @end </code></pre> <p><strong>NPIViewController.m</strong> </p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView setScalesPageToFit:YES]; [self.webView loadRequest:request]; } </code></pre> <p>The page just does not load. No compilation or runtime errors. What is wrong in this ?</p>

برچسب: نویسنده: استخدام کار تاريخ: جمعه 27 فروردين 1395 ساعت: 21:24

صفحه بندی