I know that this has been asked before, but the answers that others have received did not help me much.  When creating objects through Python, using bpy.ops.mesh.primitive_cube_add() there is an exponential slowdown when looping the creation of objects.  My script that I am writing takes an image and creates a grid of cubes based on every pixel.  It also assigns a material to each cube based on each pixel's color.  When running it on a 32x32 image, it is very fast (about 1 second).  When running it on a 100x100 image, the script gets slower and slower as it runs.  I also have learned that using a low-level method to create my cubes I won't experience the slowdown.  I changed my code to a low-level method, and the speeds are much faster, but I still experience the slowdown.    copy = ob.copy() copy.data = ob.data.copy() copy.data.materials.append(material) copy.location.x = x - 1 copy.location.y = y - 1 copy.location.z = 1 bpy.context.scene.objects.link(copy)   Here is my current code for creating cubes.  My full addon can be accessed here:   Is there a faster/better way of doing this?  Because I would really like to be able to create 100,000+ cubes without waiting hours.  Thanks.
In my script, I have for loop over many cube objects (~1000) and the treatment is very slow. Looking more in details, I notice that in the same amount of loops:   if I use python operation or simple blender operation like  obj = bpy.data.objects[obj_name]   or   obj.select = True   it takes less than 0.08s (for all 1000 objects) but as soon as I start using blender operators like:  bpy.ops.object.select_pattern() # or bpy.ops.object.duplicate() # or bpy.ops.object.location_clear() # or bpy.ops.object.transform_apply() # etc.   then, the performance drops down deeply with more than 6s for the same amount of objects.   And, a last information, if I reduce the amount of objects from 1000 to 50, the same set of operations with bpy.ops is 0.03s - so extrapolating, it would be 0.6s for the 1000 objects and not 6s. It is as is with 1000 objects, we loose a factor 10 in speed in comparison than with 50 objects.  I tried reducing the complexity of my mesh changing the cubes in planes but it had no effect at whole on performance.  Is there something particular to know to improve these performance or a way to use the bpy.ops methods with better performances? Obviously, I am missing something important probably.
How to calculate $$\int_{0}^{\pi/2}{\{\tan(x)\}dx}$$ where $\{x\}$ means the fractional part of $x$. I mentioned the zero points of $\{\tan(x)\}$. $\{\tan(x)\}$ equals to 0 iff $x=\arctan(k)$, $k$ is an integer. I tried to separate it into$$\sum_{k=0}^{\infty}{\int_{\arctan(k)}^{\arctan(k+1)}{(\tan(x)}-k)dx}$$ Then I found it hard to continue. I don't think I am on the right way. Is there any way to do a correct word count of a LaTeX document? Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count.  Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)? Lost space after removing bootcamp So I removed bootcamp and now there is a partition called "free space" that I can't remove.  Here is my output from diskutil list:    Here is the screenshot from disk utility showing the partitions:    And here is the error I get when I try to remove "free space":    Heres the output when I run   sudo diskutil apfs resizeContainer disk0s2 0 Any way to send a personal message to another user? I am working on an Office 365 SharePoint online 2013. Now when I wanted to create a new private site collection, inside the online SharePoint admin center, I did not find the option to create new managed path, as I use to get when creating a site collection inside SharePoint on-premise. So how do I create a new managed paths inside SharePoint online? List all sites in multisite I want to list all sites in the multi site network in alphabetical order? Right now, the code lists by registered date  &lt;?php // Query for getting blogs             $blogs = $wpdb-&gt;get_results( $wpdb-&gt;prepare("SELECT blog_id, domain, path FROM $wpdb-&gt;blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb-&gt;siteid), ARRAY_A );              // put it in array               foreach ( (array) $blogs as $details ) {$blog_list[ $details['blog_id'] ] = $details;}             unset( $blogs );             $blogs = $blog_list;              // if is valid array             if (is_array( $blogs ) ){                     echo '&lt;ul&gt;';                     $array= array();                     // reorder                     $array= array_slice( $blogs, 0, count( $blogs ) );                     for($i=0;$i&lt;count($array);$i++){                     // get data for each id                     $blog = get_blog_details( $array[$i]['blog_id'] );                     // print it                     echo '&lt;li&gt;&lt;a href="'.$blog-&gt;siteurl.'"&gt;'.$blog-&gt;blogname.'&lt;/a&gt;&lt;/li&gt;';                     }                     echo '&lt;/ul&gt;';             }             ?&gt; I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this.  This way:  export PATH=~/opt/bin:$PATH   or this?    export PATH=$PATH:~/opt/bin 80s/90s book where boy stumbles on game where aliens gamble their planets I don't remember much about it other than the setting. It's about a boy who one night stumbles upon some different alien races playing a game in which their civilizations will end if they lose. He gets involved in the game somehow and is hunted. What's the scope of a variable initialized in an if statement? Writing a git post-receive hook to deal with a specific branch Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?  The only other way I can think of doing this is to run a Mac VM image on a VMWare server running on Windows, although I'm not too sure how legal this is. Can Minecraft be played by two players locally on the same account? I just bought Minecraft. Now, my brother wants to play with me but my Mom doesn't want to buy another. We use the same Wifi network. Can we do this? Is it possible to navigate to a Visualforce page from an LWC with parameters and community compatible The LWC framework includes the NavigationMixin.Navigate functionality that can be used to obtain URLs or perform navigation to generated URLs. This supports a number of different page types, as covered in the . What I can't find is how to create a URL to a specific Visualforce page, with parameters and compatible with communities. Using the &quot;web page&quot; navigation type seems wrong to me, since the URL for a Visualforce page varies based on whether access is direct or within a community. Do you know what the correct approach is for navigating from a flexipage via an LWC component to a Visualforce page in the same org, passing the page some parameters? I have seen many articles that talk about a star's "habitable zone" as the ring around it which is just the right temperature for planets to have liquid water, which is necessary for life. My question is, why does a planet need to have liquid water in order to sustain life? Who says that extraterrestrial life can't live off of some other kind of sustenance? Word to describe someone who goes to all the events in town! I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)  Edit  The word will serve as a new term to describ these people in a favorable way. It will probably be used for an app name so it need to be catchy and fun. ( Preferably ) I tried to install wine using these commands: sudo apt-get install -y wine  And: sudo apt-get install wine  But terminal says that: Reading package lists... Done Building dependency tree        Reading state information... Done Package wine is a virtual package provided by:   winehq-staging 2.16.0~zesty   winehq-stable 2.0.2~zesty   winehq-devel 2.16.0~zesty   wine-development 2.0-3ubuntu1 You should explicitly select one to install.  E: Package 'wine' has no installation candidate  So there are 4 different version of wine. What is the difference between these versions. Which one is better? I wanted to install Internet Explorer from it and I installed winehq-stable. But I couldn't see that among applications in Winetricks. Do the other versions of wine have more applications to install? What is the difference? When I went to the review overview on Meta on 08.01.2015, 19:16, it listed two open items in the suggested-edits queue, however when I clicked on the queue, I was told that the queue had been cleared. When I went back to the review overview, however, the edits were there again.  Since the icons for recent reviews had not moved, I suppose that these were still the same two items waiting for review, and since phenomenon lasted for half an hour now, I would rule out  or  to be the reason for this.  After a while, the phenomenon ceased, with one new reviewer popping up in the icon list of recent reviewers.  I had not performed or skipped any suggested-edit review from the queue at that point.    A similar phenomenon occurred for several hours up to 11.04.2015, 11:05: The review overview showed two suggested edits and when I went to the suggested-edits queue, it was cleared. Sometimes, edits that I could review appeared, but two phantom edits remained. Attributing contributions to academic work that occur in Stack Exchange tkz-graph: changing individual vertex type I'm using these settings for most vertices:  \GraphInit[vstyle=Classic] \tikzset{VertexStyle/.append style = {minimum size = 5pt, inner sep = 0pt}}   But I'd like to have one or two vertices of my graph be hollow with a thick outer edge. I'm very confused about what options can be used in \Vertex, which ones can go in \SetUpVertex, for which I have to use \tikzset, etc. What's the best option here? Is it possible to tell a Valyrian steel sword from a very well crafted steel sword, by sight alone