summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Redirect a subsite home link to the root site collection home page
I often get requests to have the link of the home logo on a subsite link to the home page of the root site collection? I can't see any native way of doing this with the SharePoint navigation but might be missing something?
As tylerr07 said you'll need to edit the master page, however you'll need to use the ~sitecollection token to get to the root site of the site collection. eg: NavigateUrl="~sitecollection" <SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection" id="onetidProjectPropertyTitleGraphic"> <SharePoint:SiteLogoImage name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/images/siteIcon.png" runat="server"/> </SharePoint:SPLinkButton>
1
sitecollection token to get to root site of site collection
25V for PMOS switch VGS?
In a load supply using P-MOS, the input to source is 25V. We found unfortunately that the MOSFET we chose and soldered has only 20V maximum gate-source voltage. Although there are voltage dividers consisting of R1 and R2, we are not sure upon the sudden turning on of NMOS, whether VGS could temporarily reach 25V, and whether the P-MOSFET Q1 could stand it. We haven’t yet found MOSFETs having rated VGS>20V yet. Questions: http://www.diodes.com/datasheets/ZXMP6A17G.pdf Could someone recommend PMOS having larger maximum VGS? The application of using PMOS for high voltage switch should be common and VCC=25V is unlikely to be at the high end of typical applications. So how do applications typically handle voltage exceeding maximum VGS? Matt
Add a Zener diode from Source to Gate. This can either replace the resistor that you already have there or can be added in parallel with it. Zener voltage is not critical - anywhere from 12 to 20 Volts is fine.
1
Add a Zener diode from Source to Gate
How can I get to view the North Face of the Eiger in Switzerland?
I can't seem to find information online about trains, buses, to take to get there etc. I would be travelling in from Stainach in Austria. Is there a mountain station or similar that I can view it from? e: I see from VMA's comment that I can go there via Grindelwald. What is the best way to get there from Stainach? I'm thinking the train in the way of Stainach - Salzburg - Zurich - Bern - Grindelwald, but I can't get fares online for the Salzburg-Zurich-Bern portion. Anyone have an idea of the rough estimate of the fare?
You can also view the North face of the Eiger from the inside. The Jungfraubahn takes you from Kleine Scheidegg to the Jungfraujoch via a stop in the Eigerwall complete with panoramic windows. Looks like you can connect with mainline services from Grindelwald or Lauterbrunnen. See also http://en.wikipedia.org/wiki/Jungfraubahn
1
The Jungfraubahn takes you from Kleine Scheidegg via a stop in the Eigerwall
Where does the Bible say to read itself?
It seems rather basic, but I'm having trouble finding verses that say to read God's Word often. It seems like something that Paul said quite a few times, and it's obviously a good thing, but I can't find any specific verses. Can someone help me?
Study to show thyself approved to God, a worker who needed not be ashamed. Rightly divided the word of truth. II Timothy 2:15
1
Study to show thyself approved to God
Is there a document class optimized for small screens (i.e. phone screens)
I happen to read more documents on my (android) phone, including scientific papers from the arXiv (where the TeX source is available). Obviously, such a narrow screen is not well suited to read papers made with the usual \documentclasses . What is the best way to compile a LaTeX document in order to read it easily on a small screen (smart phone or e-book reader) ?
you can specify your own paper size: \documentclass{article} \usepackage{geometry} \geometry{papersize={<width>,<height>},margin=5mm} ...
0.888889
How to specify your paper size
Need to notify users that the form has recently been edited?
We have a list page where users see a list of data and can select one to edit. The data opens up in an editable form. Here is the scenario: User 1: Loads the list of data and selects to edit form 'ABC' User 2: Loads the list of data and hangs out for a bit User 1: Updates form 'ABC' to be 'CDE' and submits their update User 2: Clicks to edit form 'ABC' as it was displayed on the list - but the form is now 'CDE' and opens as such. The question is should I let the user know that the form they are about to edit was recently changed? Is this more confusing than it is helpful? Will expecting to load 'ABC' and actually loading 'CDE' confuse the user? What happens if it wasn't a re-name of the form but a deletion of the form? Then what should load?
Assuming that both users cannot work in collaboration at the same time on the same form: Case I: User 1 is editing the form ABC - On the forms list, User 2 gets an indication that form ABC is in edit mode right now. - If User 2 opens form ABC, it will open in read-only mode. He cannot make any changes. - User 2 can only see the updated version when he closes and opens the new version of the form again. Case II: User 1 has deleted/moved form ABC - User 2 just opens the form ABC, and he gets a notification at the same time that the action cannot be completed as the selected item has already deleted/moved.
0.777778
Case I: User 1 has deleted/moved form ABC
Can I safely exclude sleepimage from OS X backups
Crossposted to Stackoverflow: I am using Chronosync to make a complete bootable backup of my OS X 10.6.4 machine to an external USB drive. It takes a LONG time (even incrementals) and part of the problem is the 8GB sleepimage. Can I safely exclude this from the backup? I realize that in case of a disaster requiring the use of the cloned drive, I would not be able to wake the Mac from sleep, but would need to reboot, but the point is to not have to reinstall all of my work from a Time Machine backup. Thanks, Ralph
Your sleep image is typically just a dump of your machine's memory onto the hard drive so that in the event of a power loss you can resume slightly faster than a boot process. You can safely ignore it. Typically in my backups the only thing I grab is my Users folder. Occasionally I might be interested in things in /Library/Preferences, but rare is that event. There's nothing outside that system that can't be recovered through other means. As for applications in /Applications, part of my backup scripts dump an ls of that directory into a file, so I know what I had there in the event of a drive failure, but I don't actively back up what can be reinstalled / redownloaded later. 'Tis a waste of backup space, especially since with new program versions, etc., that data changes quite often anyway.
1
In my backups the only thing I grab is my Users folder
Firefox flex and max-width
I’m trying to display an image centered and resized by CSS (max-width / max-height, flex). This is working fine in Chrome but not in Firefox. What’s wrong? a { border: 1px solid red; display: flex; height: 100px; width: 100px; justify-content: center; align-items: center; box-sizing: border-box; padding: 5px; } img { max-width: 100%; max-height: 100%; border: 1px solid green; } <a class="frame"> <img src="http://placehold.it/500x150"/> </a> See: http://jsfiddle.net/ymLb50w0/2/
Try this solution... a { border: 1px solid red; display: inline-block; height: 100px; width: 100px; justify-content: center; align-items: center; box-sizing: border-box; padding: 5px; max-width: 100%; } img { max-width: 100%; max-height: 100%; border: 1px solid green; } <body style="text-align: center;"> <a class="frame"> <img src="http://placehold.it/500x150"/> </a> </body>
0.888889
Try a border: 1px solid red; display: inline-block; height: 100px; width: 100
Is UX better marketing than marketing?
In our field we continue to sell our product in terms of better user experience, easier to complete tasks, less pressure on user and so on. We do that being convinced that it benefits our customers and employers. This is great, because we make the digital world better and easier and more joyful. Marketers also sell products and solutions to company to solve problems and issues. They too have a vision and a concept of a better digital world, but from a different facet. I’m often stunned by how they accomplish tasks and gain rightful trust by the customers. Sometimes marketers and user experience experts are colliding; sometimes they work side by side in collaboration. But from a general notice – which marketing activity gets the best conversion rate marketing or UX? Does a dollar spent on UX make more ROI than a dollar spent on marketing?
This takes into account the marketing / UX cross over. I see UX crossing over into many functions that already exist within a business. This is the reason that many business feel that they are doing UX because the concepts that make up UX artefacts and deliverables have been produced by already established departments. Like already noted in the answers each department within a business is subtly different and reports appropriately to answer their own remit. UX is the sum of all of this knowledge unless its used together to answer the wider questions and demands UX as a practice is unable to deliver the expected results. I get to talk to many departments and functions within the companies I work with, when I succeed and the conversions start providing answers my agency rapidly gains respect as we are linking people and data together with the organisation that otherwise would remain in unconnected silos and databases.
0.888889
Marketing / UX cross over into many functions that exist within a business
Failed to allocate memory - What is it trying to say?
In my early days of programming I often used to get memory related fatal errors in the following format: Fatal error: Allowed memory size of <some big number> bytes exhausted (tried to allocate <some small number> bytes) in /path/to/filename.php on line <some line number> I'm a little embarrassed to state that even though I have figured out how to solve them and take steps to avoid them altogether, I'm still not quite sure what exactly does the message translate to in simple words. For example, if I get a message such as: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4000 bytes) in ........ on line 34 As things stand at the moment, I assume it to be stating that the script consumes 67108864 bytes of data, but only 4000 bytes are available during runtime. Am I right in my assumption? If not, what's the correct interpretation?
67108864 bytes are also known as 64 MiB (Mebibyte). Many softwares like PHP still identifies 64 MB as 64 MiB, this is an historically grown issue. Nowaday we define 64 000 000 bytes as 64 MB (Megabyte, 64 * 1000 ^ 2) and 67108864 bytes as 64 MiB (Mebibyte, 64 * 1024 ^ 2).
0.888889
67108864 bytes are also known as 64 MiB (Mebibyte)
How to upload to WebDAV using a web browser?
I've setup and configured webdav on debian using the following tutorial: http://www.unix-tutorials.com/go.php?id=3711 I want to be able to download and upload files to the webdav share using a web browser. I can download and upload files to the webdav share if I mount it to my file system but we don't want the other people accessing this to have to do that. We want people to be able to go to the URL in their web browser, authenticate, and do everything, download, upload in their browser. When I go to the webdav URL in my browser and authenticate I'm given a list of the webdav share's contents and I can download the files but I don't see any way to upload files? How can I upload files to the webdav share using a web browser? Thanks in advance.
AFAIK there is no built-in support for webdav in browsers. I think there are applications and AJAX libraries you could run on your web server that would make webdav through the browser possible. A quick google search for ajax webdav showed one interesting looking product (http://www.webdavsystem.com/ajaxfilebrowser). I have never used this, just happened to look neat when I did a search related to this question.
0.888889
AFAIK there is no built-in support for webdav
Unable to Import Data
I am following this tutorial, but i am not able to get the right username and password to import data. How do I know what the username password is? By default I see tomcat6 as database and username and no password in the textbox. As i am following the tutorial I changed it to username: postgis and password: postgres. How do I know what my username and password is? EDIT Import the data in PostGIS, which requires PostGIS connection. UPDATE Ok so i got the user and passwd but when I am trying to add the shapefile using the Shape File to PostGIS Importer Plugin and having made connection successfully, I am getting this error when I am adding the shapefile. Connecting: host=localhost port=5432 user=admin dbname=shpRepo password='**********' Connection succeeded. Connection: host=localhost port=5432 user=admin dbname=shpRepo password='**********' Destination: public.AllQuebecSpecies Source File: /home/smaranh/development/Biodiversity/biodiversity/shapefile/AllQuebecSpecies Shapefile type: Point Postgis type: POINT[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."AllQuebecSpecies" (gid serial PRIMARY KEY, "family" varchar(50), "species" varchar(50)); SELECT AddGeometryColumn('public','AllQuebecSpecies','the_geom','-1" Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 7: SELECT AddGeometryColumn('public','AllQuebecSpecies','the_ge... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Shapefile import failed. Can somebody tell me where am I going wrong?
Have you tried the username and password they show in the image when reading the documentation? (admin/geoserver) When you first start the dashboard, it provides a reminder about the default password for accessing GeoServer [....] {followed by the image} Otherwise, just above step 1 it says: Note The PostGIS database has been installed with unrestricted access for local users (users connecting from the same machine as the database is running). That means that it will accept any password you provide. If you need to connect from a remote computer, the password for the postgres user has been set to postgres.
0.777778
Password for accessing GeoServer
Howto bin series of float values into histogram in Python?
I have set of value in float (always less than 0). Which I want to bin into histogram, i,e. each bar in histogram contain range of value [0,0.150) The data I have looks like this: 0.000 0.005 0.124 0.000 0.004 0.000 0.111 0.112 Whith my code below I expect to get result that looks like [0, 0.005) 5 [0.005, 0.011) 0 ...etc.. I tried to do do such binning with this code of mine. But it doesn't seem to work. What's the right way to do it? #! /usr/bin/env python import fileinput, math log2 = math.log(2) def getBin(x): return int(math.log(x+1)/log2) diffCounts = [0] * 5 for line in fileinput.input(): words = line.split() diff = float(words[0]) * 1000; diffCounts[ str(getBin(diff)) ] += 1 maxdiff = [i for i, c in enumerate(diffCounts) if c > 0][-1] print maxdiff maxBin = max(maxdiff) for i in range(maxBin+1): lo = 2**i - 1 hi = 2**(i+1) - 1 binStr = '[' + str(lo) + ',' + str(hi) + ')' print binStr + '\t' + '\t'.join(map(str, (diffCounts[i]))) ~
The first error is: Traceback (most recent call last): File "C:\foo\foo.py", line 17, in <module> diffCounts[ str(getBin(diff)) ] += 1 TypeError: list indices must be integers Why are you converting an int to a str when a str is needed? Fix that, then we get: Traceback (most recent call last): File "C:\foo\foo.py", line 17, in <module> diffCounts[ getBin(diff) ] += 1 IndexError: list index out of range because you've only made 5 buckets. I don't understand your bucketing scheme, but let's make it 50 buckets and see what happens: 6 Traceback (most recent call last): File "C:\foo\foo.py", line 21, in <module> maxBin = max(maxdiff) TypeError: 'int' object is not iterable maxdiff is a single value out of your list of ints, so what is max doing here? Remove it, now we get: 6 Traceback (most recent call last): File "C:\foo\foo.py", line 28, in <module> print binStr + '\t' + '\t'.join(map(str, (diffCounts[i]))) TypeError: argument 2 to map() must support iteration Sure enough, you're using a single value as the second argument to map. Let's simplify the last two lines from this: binStr = '[' + str(lo) + ',' + str(hi) + ')' print binStr + '\t' + '\t'.join(map(str, (diffCounts[i]))) to this: print "[%f, %f)\t%r" % (lo, hi, diffCounts[i]) Now it prints: 6 [0.000000, 1.000000) 3 [1.000000, 3.000000) 0 [3.000000, 7.000000) 2 [7.000000, 15.000000) 0 [15.000000, 31.000000) 0 [31.000000, 63.000000) 0 [63.000000, 127.000000) 3 I'm not sure what else to do here, since I don't really understand the bucketing you are hoping to use. It seems to involve binary powers, but isn't making sense to me...
1
How do you convert an int to a str when a string is needed?
Are there /ɔ/ and /ʌ/ sounds in informal American English?
I read a book about American English. It reports that, in standard informal conversations, American English doesn't use the /ɔ/ sound; it uses the /ɑ/ sound and /ʌ/ and /ə/ are not different. Are they really? That book would not use the /ɔ/ and /ʌ/ sounds, but when I look in my American English Dictionary for some words, such as more, door, and love, they are reported to be pronounced /mɔr/, /dɔr/, and /lʌv/. How should I pronounce these words, if there are no /ɔ/and /ʌ/ sounds? Should they be /mɑr/, /dɑr/, and /ləv/? Can /ɑ/ sound replace /ɔ/, and /ə/ replace /ʌ/ in every word? What about formal American English? Does it have /ɔ /and /ʌ/ sounds or not?
The /ɔ/ as described by Wikipedia is an unelisioned "aw" sound, as in the pure Latin vowel "o" for those singers out there. The /ʌ/ sound, as found in the word "plus", is an open-backed "uh". Close off the back of the throat by dropping the soft palate, bringing the jaw back and/or raising the back of the tongue and you have what most Americans would call a "schwa" (/ə/) as in the second syllable of "special". In most American English dialects/accents, the mouth is held in a more open, relaxed position while speaking than for most British accents. This can tend to make "aw" sound more like more like "ah", and "ah" like an open short "a" as in "bat". Similarly, the opening of the lips leads to closing off the back of the throat to provide nuances between vowels, which can make "uh" sound like "ugh", "oo" sound like "eu", etc. Vocal coaches tear their hair out over this natural accent, especially in the deep South and Texas, where the "twang" pollutes the "pure" Latin vowels normally desired for singing in almost any language. However, I doubt you will find an English dialect where a particular vowel shape is never heard. First of all, there will always be a word in the language that even a heavily-accented speaker will pronounce using the shape you're looking for. It may be misplaced, but it'll be there. Second, there are degrees of vowel modification from what we would consider "neutral" American English to "accented", no matter the accent, so you will always find a person who speaks with just the right level of accent to use the vowel shape you're looking for at least some of the time. Urban residents tend to accent less than suburban and rural in my experience, and higher education, which normally involves a mingling of people from many locations nationwide, also tends to reduce accenting. Watching national broadcast TV also tends to reduce accenting, as most actors have their natural accents trained, coached, and/or beaten out of them while on camera.
1
"aw" sound, as in the word "plus", is an open-backed "uh"
HowTo: Add Class to Sidebar Widget List-Items
The newest version of Bootstrap (v3.0) adds a new List Group component which has the following structure: <ul class="list-group"> <li class="list-group-item">Cras justo odio</li> <li class="list-group-item">Dapibus ac facilisis in</li> <li class="list-group-item">Morbi leo risus</li> <li class="list-group-item">Porta ac consectetur ac</li> <li class="list-group-item">Vestibulum at eros</li> </ul> I would like to be able to add a class to the ul (i.e. <ul class="list-group">) I would like to style my Category sidebar widget to support this new component, but as you see, this requires classes on each li item. In reading some similar posts, one option I found is to use jQuery to add the class to each li, but I am concerned about the dreaded FOUC. Is there some WordPress function that gets me to my goal? Please advise, Update: I was able to add classes to the individual li's by creating a Custom Walker which extends Walker_Category (see code below), but this still does not get me to the ul which also needs a class added (eg <ul class="list-group">). class Walker_Category_BS extends Walker_Category { function start_el( &$output, $category, $depth = 0, $args = array() ) { extract($args); $cat_name = esc_attr( $category->name ); $cat_name = apply_filters( 'list_cats', $cat_name, $category ); $link = '<a href="' . esc_url( get_term_link($category) ) . '" '; if ( $use_desc_for_title == 0 || empty($category->description) ) $link .= 'title="' . esc_attr( sprintf(__( 'View all posts filed under %s' ), $cat_name) ) . '"'; else $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"'; $link .= '>'; $link .= $cat_name . '</a>'; if ( !empty($feed_image) || !empty($feed) ) { $link .= ' '; if ( empty($feed_image) ) $link .= '('; $link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) ) . '"'; if ( empty($feed) ) { $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; } else { $title = ' title="' . $feed . '"'; $alt = ' alt="' . $feed . '"'; $name = $feed; $link .= $title; } $link .= '>'; if ( empty($feed_image) ) $link .= $name; else $link .= "<img src='$feed_image'$alt$title" . ' />'; $link .= '</a>'; if ( empty($feed_image) ) $link .= ')'; } if ( !empty($show_count) ) $link .= ' (' . intval($category->count) . ')'; if ( 'list' == $args['style'] ) { $output .= "\t<li"; $class = 'list-group-item cat-item cat-item-' . $category->term_id; if ( !empty($current_category) ) { $_current_category = get_term( $current_category, $category->taxonomy ); if ( $category->term_id == $current_category ) $class .= ' current-cat'; elseif ( $category->term_id == $_current_category->parent ) $class .= ' current-cat-parent'; } $output .= ' class="' . $class . '"'; $output .= ">$link\n"; } else { $output .= "\t$link<br />\n"; } } /* end start_el */ } /* end Walker_Category_BS */ Update 02: After viewing default-widgets.php in the core, I decided to create a new widget (WP_Widget_Categories_BS, see code below) wherein I basically, copied all the code from the default category widget and simply modified the the UL to add the necessary class. <?php /** * Categories widget class * * @since 2.8.0 */ class WP_Widget_Categories_BS extends WP_Widget { function __construct() { $widget_ops = array( 'classname' => 'widget_categories_bs', 'description' => __( "A list or dropdown of categories for Bootstrap 3.0" ) ); parent::__construct('categories', __('Boostrap Categories'), $widget_ops); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base); $c = ! empty( $instance['count'] ) ? '1' : '0'; $h = ! empty( $instance['hierarchical'] ) ? '1' : '0'; $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); if ( $d ) { $cat_args['show_option_none'] = __('Select Category'); wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args)); ?> <script type='text/javascript'> /* <![CDATA[ */ var dropdown = document.getElementById("cat"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; } } dropdown.onchange = onCatChange; /* ]]> */ </script> <?php } else { ?> <ul class="list-group"> <?php $cat_args['title_li'] = ''; wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> </ul> <?php } echo $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['count'] = !empty($new_instance['count']) ? 1 : 0; $instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0; $instance['dropdown'] = !empty($new_instance['dropdown']) ? 1 : 0; return $instance; } function form( $instance ) { //Defaults $instance = wp_parse_args( (array) $instance, array( 'title' => '') ); $title = esc_attr( $instance['title'] ); $count = isset($instance['count']) ? (bool) $instance['count'] :false; $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false; $dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false; ?> <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p> <p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?></label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?></label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> /> <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label></p> <?php } } // end WP_Widget_Categories_BS Combined with a Custom Walker I created (Walker_Category_BS) I now have what I wanted. Analysis Is this the best way to do it? Don't know as I have have received zero feedback so far, and this is the first time i've done this (hence the question), but ...it works! I could use a review. Debug Warning Concerning my Custom Category Walker Walker_Category_BS, i'm seeing this message "Strict standards: Declaration of Walker_Category_BS::start_el() should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in C:\wamp\www\mysite\wp-content\themes\mytheme\assets\inc\Walker_Category_BS.php" It appears to be a warning, of some sort.
what about creating a seperate sidebar for this widget and adding class using register_sidebar funciton ? register_sidebar(array( 'name' => 'First_sidebar', 'id' => 'sidebar-1', 'class' => 'ul-class-name', 'before_widget' => '<div class="well">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' ));
0.777778
Create a seperate sidebar for register_sidebar funciton
More colloquial term for "confidant"
Is there a more colloquial term for a "confidant", or someone who has been entrusted with sensitive information to be disclosed only under certain conditions? This is related to my previous question on trusted proxies.
I don't think there is a more colloquial term that fully encompasses the meaning of confidant. I can't think of a more formal one, either. Confidant and confidante are not particularly formal terms, even if they sound it. These are not uncommon in everyday parlance. If you truly require something more colloquial, you'll probably have to settle for a longer phrase. Even then, many of the terms I might use to construct such a phrase seem no less formal than confidant: privileged privy trusted counselor
1
Confidant and confidante are not particularly formal terms, even if they sound it
Does MySQL Enterprise Backup work across Operating Systems?
The problem with testing is that one can never be sure (it may seem to work and then you find some thing changed later). A definitive statement from the vendor would definitely be helpful (I cannot seem to find any). I am thinking about running MySQL Enterprise Backup between MacOS and Liunx OSes
MySQL Enterprise Backup (MEB) is designed to create a point-in-time snapshot of data but only backs up data locally. If the dataset is relatively small, try setting up an NFS share and run MySQL Enterprise Backup with the NFS share as the Target. Of course, there may be some risk involved. Please check out these links on this subject for further research on MEB http://dev.mysql.com/doc/mysql-enterprise-backup/3.6/en/meb-backup-streaming.html http://dev.mysql.com/doc/mysql-enterprise-backup/3.6/en/meb-backup-single-file.html http://forums.mysql.com/read.php?28,409106,410496#msg-410496 Using MEB with data on server with MacOS and Linux OS on the Target Server? One can only guess. Personally, if I had to port mysql data from one OS to another I would recommend this: Run mysqldump from MacOS to sqldump.sql Install mysql on Linux Load sqldump.sql into Linux Setup replication between servers MacOS running mysql as Master Linux running mysql as Slave From here, just install MEB on the Linux Box (For free version, use XtraBackup) and run your MEB backups locally on the Linux.
0.888889
MySQL Enterprise Backup (MEB) backs up data locally .
When should a supervisor be a co-author?
What are people's views on this? To be specific: suppose a PhD student has produced a piece of original mathematical research. Suppose that student's supervisor suggested the problem, and gave a few helpful comments, but otherwise did not contribute to the work. Should that supervisor still be named as a co-author, or would an acknowledgment suffice? I am interested in two aspects of this. Firstly the moral/etiquette aspect: do you consider it bad form for a student not to name their supervisor? Or does it depend on that supervisor's input? And secondly, the practical, career-advancing aspect: which is better, for a student to have a well-known name on his or her paper (and hence more chance of it being noticed/published), or to have a sole-authored piece of work under their belt to hopefully increase their chances of being offered a good post-doc position? [To clarify: original question asked by MrB ]
One anecdote ... Serving on a university-wide committee, I found that in one field (I think zoology?) the norm is having the advisor as co-author; and when the advisor does not appear as co-author it is taken as a sign that the advisor has a low opinion of the thesis. During my career, there are only two Ph.D. theses that were published with me as co-author. One case (Yuri Dimitrov): After the degree was completed, the thesis had to be abridged for publication. Dr Dimitrov would come to my office once or twice a week and show me his progress (much as he had done before the degree was completed). In the end he suggested joint authorship for the paper. Subsequently, we wrote another joint paper extending the work. Another case (Jeff Golds): This guy, upon completion of his degree, was raring to begin his career in the software industry. It was clear he would never publish the work, but I thought it deserved publication. So I wrote it up for publication, and it appeared as a joint paper.
0.888889
Yuri Dimitrov: After the degree was completed, the thesis had to be abridged for publication.
High pitched noise from Shower
I live in an 8 unit co-op. Recently had the bathroom totally redone. New pipes and bathtub/shower. My new shower seems fine. Not long after I got this done I have noticed someone is causing a high pitched sound when they take a shower. Could the plumbing done in my unit cause someone else to experience this problem? Could the pressure change in my Unit cause someone else to have pressure problems. What should I do about it? The noise is very load.
My tub spout would make an awful squeal when the shower stopper was pulled up (air in the line trying to escape the poorly seating valve). It would change pitch and stop sometimes if I jiggled the lever right. Find the offending unit and ask to replace their tub spout. Tell them why and they will almost certainly agree to it. A change in pressure may get it to stop momentarily. Take a shot in the dark and cycle your faucet valves on and off to attempt re-seating the seal of your neighbors' tub spout stopper valve, when you hear it howling. Or be proactive, finding out whose it is and whose job it is to fix it.
1
How to replace a tub spout?
The graph has an Euler tour iff in-degree($v$)=out-degree($v$)
I am looking at the proof that $G$ has an Euler tour iff in-degree($v$)=out-degree($v$), that I found at this site: www.cs.duke.edu/courses/fall09/cps230/hws/hw3/headsol.pdf (Problem 2) A simple cycle is a path in a graph that starts and ends at the same vertex without passing through the same vertex more than once. A complex cycle is a cycle that passes through the same vertex more than once. We can easily decompose a complex cycle to a set of simple cycles by breaking up the cycle at those points where the cycle passes through the same vertex more than once. As the first part of our proof, we will prove that if $G$ has an Euler tour, in-degree($v$)=out-degree($v$) for each vertex $v \in V$. We have already established that a complex cycle can be decomposed to a collection of simple cycles. However vertices on a simple cycle have in-degree($v$)=out-degree($v$)=1. Since each vertex in a complex cycle, and therefore in an Euler tour, is part of one or more simple cycles it will have in-degree($v$)=out-degree($v$). Could you give me an example of a complex cycle that is decomposed to a set of simple cycles, where we can see that in-degree($v$)=out-degree($v$)? The second part of our proof requires us to prove that if in-degree($v$)=out-degree($v$) for each vertex $v \in V$, $G$ has an Euler-tour. Let $C$ be the complex cycle involving the most edges in $G$. In order for $G$ not to be an Euler tour, there must be some vertices that $C$ passes through ( since the graph is connected ) but does not exhaust all edges. We have already established that the vertices of a complex cycle have the property that in-degree($v$)=out-degree($v$). Therefore $G'=G-C$ will also have that property. If a connected component in a graph has in-degree($v$)=out-degree($v$) then it contains at least one cycle $C'$. However this contradicts our initial hypothesis that $C$ is the cycle involving the most edges in $G$ since we would construct a larger cycle by starting at some common vertex of $C$ and $C'$, traversing all of $C$s edges and then $C'$s edges. Therefore $C$ is an Euler tour. First of all, it says that "In order for $G$ not to be an Euler tour, there must be some vertices that $C$ passes through ( since the graph is connected ) but does not exhaust all edges. " I haven't understood why we have to show that $G$ does not exhaust all edges. In order for $G$ not to be an Euler tour, couldn't it also hold that $G$ traverses an edge more than once? Then it says that "We have already established that the vertices of a complex cycle have the property that in-degree($v$)=out-degree($v$). Therefore $G'=G-C$ will also have that property." Why will $G'=G-C$ be a complex cycle, although $G$ isn't necessarily? Also, could you explain me why it holds that: " If a connected component in a graph has in-degree($v$)=out-degree($v$) then it contains at least one cycle $C'$." Finally, could you explain me the contradiction? EDIT: I also want to describe an algorithm that runs in time $O(E)$ and finds an Euler tour of $G$, if it exists. (Hint: Merge edge-disjoint cycles.) If we apply DFS, we will get a set of cycles formed by disjoint sets of edges, right? But how can we know if it holds that in-degree(v)=out-degree(v), for all vertices in $V$? Do we have to do something like that? algorithm
In a simple cycle the in degree and the out degree are both one, so if we add to some simple cycle another simple cycle at some vertex, the in degree and the out degree of the vertex will increase both by 1. You got some wrong concept on $G'$, it is not a complex cycle in fact it doesn't even need to be connected. As we defined cycles in my (algorithmic) dicrete math classes we said that every edge may be traversed at most once so it is not possible that $C$ is a complex cycle which traverses one edge more than once. So the idea is more that there must be some complex cycle which passes trough every vertex, because your graph is connected, and if uses every edge it is an euler tour. So we take the complex cycle with most edges, and look at $G'=G-C$, as the in degree of some vertex in $G'$ is the in degree of the vertex in $G$ minus the in degree of the vertex in $C$ and the same for the out degrees the graph $G'$ does still have the property, that the in degrees coincide with the out degrees. But if those degrees aren't all $0$ we could add some cycle to $C$ which would result in some complex cycle with more edges, which is some contradiction to our assumption, that $C$ does have the most edges.
0.888889
In a simple cycle the in degree and the out degree of the vertex will increase both by 1 .
How to avoid being asked passphrase each time I push to Bitbucket
I set up my ssh stuff with the help of this guide, and it used to work well (I could run hg push without being asked for a passphrase). What could have happened between then and now, considering that I'm still using the same home directory. $ cat .hg/hgrc [paths] default = ssh://[email protected]/tshepang/bloog $ hg push Enter passphrase for key '/home/wena/.ssh/id_rsa': pushing to ssh://[email protected]/tshepang/bloog searching for changes ...
A way to solve this is with ssh-agent and ssh-add: $ exec ssh-agent bash $ ssh-add Enter passphrase for ~/.ssh/id_rsa: After this the passphrase is saved for the current session. and won't be asked again.
0.888889
Passphrase for /.ssh/id_rsa
Is pretending to want to trade before playing a monopoly card objectionable?
In Settlers of Catan, I sometimes try to ask people if they want to trade a certain resource, tricking them into revealing the approximate amount of that resource in everyone's hand. After this I play the monopoly card. This has on some occasions not been received very well. Is this fair play?
There's no rule about it, so I'd say it's fair play. However, it's a social game so if you keep 'crying wolf' then you might find your game-mates less likely to trade with you!
1
'crying wolf' is a social game so you might find your game-mates less likely to trade with you
Rails undefined method `model_name' for NilClass:Class When trying to render simple_form in a view
I've searched through the questions and couldn't find an answer that would work for me and I'm new to Rails and am stuck. I'm trying to render a simple_form I use to post statuses into a view for user profiles. But every time I load the profile page I get the following error: undefined method `model_name' for NilClass:Class Extracted source (around line #1): 1: <%= simple_form_for(@status) do |f| %> I don't know why because it renders fine in two other views I have, only difference they are located in the same folder as the form. The profile is not. This is what I used to render the form: <%= render partial: "statuses/form", locals: { status: @status} %> and here's what my controller looks like: class StatusesController < ApplicationController before_filter :authenticate_member!, only: [:new, :create, :edit, :update] # GET /statuses # GET /statuses.json def index @statuses = Status.all respond_to do |format| format.html # index.html.erb format.json { render json: @statuses } end end # GET /statuses/1 # GET /statuses/1.json def show @status = Status.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @status } end end # GET /statuses/new # GET /statuses/new.json def new @status = Status.new respond_to do |format| format.html # new.html.erb format.json { render json: @status } end end # GET /statuses/1/edit def edit @status = Status.find(params[:id]) end # POST /statuses # POST /statuses.json def create @status = current_member.statuses.new(params[:status]) respond_to do |format| if @status.save format.html { redirect_to @status, notice: 'Status was successfully created.' } format.json { render json: @status, status: :created, location: @status } else format.html { render action: "new" } format.json { render json: @status.errors, status: :unprocessable_entity } end end end # PUT /statuses/1 # PUT /statuses/1.json def update @status = current_member.statuses.find(params[:id]) if params[:status] && params[:status].has_key?(:user_id) params[:status].delete(:user_id) end respond_to do |format| if @status.update_attributes(params[:status]) format.html { redirect_to @status, notice: 'Status was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @status.errors, status: :unprocessable_entity } end end end # DELETE /statuses/1 # DELETE /statuses/1.json def destroy @status = Status.find(params[:id]) @status.destroy respond_to do |format| format.html { redirect_to statuses_url } format.json { head :no_content } end end end What am I missing here?
The local variable in the partial will be status, not @status.
1
Local variable in the partial will be status, not @status
Difficulties with re-using a variable
here is a part of my code : class projet(object): def nameCouche(self): valLissage = float(ui.valLissage.displayText()) return (valLissage) valCouche = nameCouche() # asks for a positional argument but 'self' doesnt work def choixTraitement(self): ui.okLissage.clicked.connect(p.goLissage) def goLissage(self, valCouche): if ui.chkboxLissage.isChecked(): print(valCouche) # result is False os.system(r'"C:\Program Files\FME\fme.exe" D:\Stelios\..... --MAX_NUM_POINTS {0}'.format(valCouche)) So I would like to use valCouche in goLissage method but it doesnt work. I thought that valCouche would have the argument of valLissage but instead it gives False as a value. I've tried different alternatives but still doesnt work.
You've got multiple problems here. First, if you write this in the middle of a class definition: valCouche = nameCouche() ... you're creating a class attribute, which is shared by all instances, not a normal instance attribute. Also, you're running this at class definition time. That means there is no self yet--there aren't any instances yet to be self--so you can't call a method like nameCouche, because you don't have anything to call it on. What you want to do is call the method at instance initialization time, on the instance being initialized, and store the return value in an instance attribute: def __init__(self): self.valCouche = self.nameCouche() Then, when you want to access this value in another method later, you have to access it as self.valCouche. If you make those changes, it will work. But your object model still doesn't make much sense. Why is nameCouche a method when it doesn't have anything to do with the object, and doesn't access any of its attributes? Maybe it makes sense as a @staticmethod, but really, I think it makes more sense just as a plain function outside the class. In fact, none of the code you've written seems to have anything to do with the class. This kind of cram-everything-into-the-class design is often a sign that you're trying to write Java code in Python, and haven't yet really understood how Python does OO. You might want to read a good tutorial on Python classes. But briefly: if you're writing a class just to have somewhere to dump a bunch of vaguely-related functions, what you want is a module, not a class. If you have some reason to have instances of that class, and the functions all act on the data of each instance, then you want a class.
0.555556
Why is nameCouche a method when it doesn't have anything to do with the object?
What are the disadvantages of "puncture proof" (or puncture resistant) tires?
Some people refer to tires that are more resistant to punctures as "puncture proof" tires. For example: Specialized All Condition Armadillo Tyre Even though these tires are not really puncture proof, they do reduce a lot the chances of puncturing. So the advantage is obvious. Apparently, they're not too expensive compared to regular tires. So, I was wondering why people would choose not to use these more resistant tires. What are their disadvantages?
Though there no doubt are "puncture-resistant" tires that seek to accomplish that end by means of extra-thick rubber, for the past 15-20 years the standard for puncture resistance has been Kevlar belted tires, which look and ride like ordinary tires and weight essentially the same as ordinary tires (maybe a few grams more). The Kevlar belt under the tread increases puncture resistance by at least a factor 10, eliminating most common glass/thorn punctures, and also reducing the tendency of the tire to "bruise". Price wise, my recollection is that they are about 30% more expensive than standard tires, but they likely last that much longer (plus save a lot on tubes), so the cost is pretty much a wash. (The odd thing is that Kevlar-belted tires are so hard to find.) Some people apparently confuse "Kevlar belted" tires with "Kevlar bead" tires. The latter are "folding" tires and are supposedly desired because they are a hair lighter than metal bead tires, plus they can be folded and stuffed in a pannier. But you can buy Kevlar belted with a metal bead (my preference, since folding tires are a PITA to install), and Kevlar bead tires are not necessarily Kevlar belted (in fact, most often not). Update: Last Saturday I had my first puncture in maybe 5 years (maybe 2000 miles), while finishing up a 35-mile morning. Just got around to fixing it because it's been ungodly hot and humid. (Hitched a ride home the last two miles, since there was no way to fix the flat in 95-degree weather on a 4-foot shoulder in the sun with traffic whizzing by at 70 MPH.) The culprit was apparently a construction staple that had pierced the tire just outside the belt, gone through the sidewall of the tube, and then punched a bigger hole in the inside diameter of the tube. I do notice the tire is wearing a bit thin, so I'll probably have to replace it within a year or so. I'm dreading trying to find a 700/35c road tire with Kevlar belt, though -- the catalogs are now full of off-road tires and cater even less to the touring market than they did 5-10 years ago. OK -- To make this into a direct answer to the question, the main disadvantage of Kevlar belted tires is that you forget how to change a tire, you do it so rarely.
0.888889
Kevlar belted tires are 30% more expensive than standard tires . "folding" tires are supposedly desired because they are
Undefined offset 1
Undefined offset: 1 Hello ... I am facing a problem that undefined offset :1 in line 3. I can't understand that what type of error it is. Can anyone tell me that why such error occurs in php Undefined offset in line : 3 foreach ($lines as $line) { list($var,$value) = explode('=', $line); //line 3 $data[$var] = $value; }
Your are getting PHP notice because you are trying to access an array index which is not set. list($var,$value) = explode('=', $line); The above line explodes the string $line with = and assign 0th value in $var and 1st value in $value. The issue arises when $line contains some string without =.
0.333333
PHP notice because you are trying to access array index not set
Find router on network
I've just bought a Belkin N+ Wireless Router. When I plug it directly into my computer I can navigate to its setup page at 192.168.2.1 - however, when I plug it into a random part of the network it still functions as a wireless hub but I can't get to its setup page at 192.168.2.1 Now I'm guessing that the main router has given it an IP. How can I find out what that is? I've looked on the web page for the main router and listed all IP's that are connected to it and tried to access each one but that didn't work.
First of all, I am assuming you are connecting the WAN port of the wireless router to your hub, please correct me if my assumption is wrong. Your wireless router is likely getting an WAN IP address like you said from your current DHCP server, however if your other DHCP server is giving out the same IP address ranges as your router (ie 192.168.2.xxx) then both your router and other gateway are likely trying to take 192.168.2.1 and so you'll probably never be able to access one of them. Another thing to remember is that you likely cannot access the administration page of your router from the WAN side of the router. You will need to access it from the wireless network or plug in a computer into one of the other (non-WAN) ports on the router to access the admin pages. If you are just trying to use your wireless router as an access point (just to add wireless to your wired network) try plugging your hug into one of the non-WAN ports on your wireless router.
1
How to connect wireless router to your hub?
Flash Memory Failure Modes - Block Failure
My understanding is that typical flash memory failures, such as those due to erase cycles, occur at the bit level. I have a flash in which entire blocks (actually two blocks) are failing. Is there a common explanation for this? More specifically, I have two blocks in a NAND flash device which are failing. These blocks are separated by one working block. The two failing blocks can be erased (I can confirm by reading by all ones), but after programming with 'random' data all of the bits are shown as all zeros. Both blocks appear to have failed 'simultaneously' I know that the flash part is nowhere near its max erase-cycle spec of 100k cycles.
Depending upon how error-correcting codes are implemented, it may be possible for a chip to detect a larger number of bad bits than it can reliably correct. If a chip detects the existence of uncorrectable errors, having it return all-zero data may be safer than having it try to correct the data, especially if software tries to add its own error-correcting logic. Personally, I think the "right" approach would be to have a standard means via which a chip could give an indication of data reliability (block is "clean", block has correctable errors but can tolerate more, block is near the limit for correctable errors, block has unrecoverable errors, etc.) but in the absence of such a feature I wouldn't think it unusual for blocks to transition rather abruptly between working perfectly and being totally useless.
0.888889
error-correcting codes are implemented in a chip
Specifying the keyboard layout for Chinese input
I use both Chinese (pinyin) and Japanese (romaji) input and am used to having them mapped to a standard US keyboard layout. However my regional setting is Switzerland since I'm studying here and “internet services may vary according to region”. Strangely, the Japanese input uses the US keyboard layout, but Chinese uses a European layout (not sure what, but z and y are switched). (Irrelevant to problem). My inputs are, in this order: English (US) German Japanese (Kotoeri) Chinese As Tom pointed out, in Kotoeri's preferences the layout can be defined. The Chinese input however uses the last layout of a Latin input, in this case German. There also doesn't seem to be an option to customise the order of these inputs. My workaround is to cycle backwards, but this obviously is a special case. If anyone has a better solution it would be appreciated.
If it's what I think you're asking, you can set this, but it's really hard to find. (It's not in the System Preferences app.) On OS X in the Japanese interface, there's no "Romaji" input, but based on some screenshots I found, I'm assuming this is "英字" (eiji, i.e., halfwidth Latin characters). All of the Japanese input methods use a system called Kotoeri (ことえり). When a Kotoeri input method is selected, from the keyboard layout menubar menu in the top right, choose "環境設定を表示" ("Show Preferences", maybe?), which is indented a bit under a "Kotoeri" heading. (It disappears if you have a non-Kotoeri input method selected.) There, you can choose a base keyboard input method for Kotoeri to use. Alternatively, there's nothing special about the (half-width) Romaji / 英字 characters: they're just Latin characters. I don't even have this layout enabled. When I want to type Romaji, I just use my (western) layout. I can't tell what benefit there might be to using Kotoeri for this. Sadly, I don't know anything about Chinese, so you're on your own there, but I suspect it has a similarly well-hidden setting. :-) I enabled the Chinese keyboard layouts here, and got some extra menuitems in the keyboard layout menu, but nothing that looked quite the same as the Japanese settings.
0.777778
Kotoeri () is not in the System Preferences app.
Variable scope in while-read-loop on Solaris
Could someone please explain to me why my while loop seems to have an internal scope? I've seen multiple explanations online but they all have to do with pipes. My code has none. The code: #!/bin/sh while read line do echo "File contents: $line" echo if [ 1=1 ]; then test1=bob fi echo "While scope:" echo " test1: $test1" done < test.txt if [ 1=1 ]; then test2=test2; fi echo; echo "Script scope: " echo " test1: $test1" echo " test2: $test2" The output: File contents: In the file While scope: test1: bob Script scope: test1: test2: test2
In the Bourne shell, redirecting a compound command (like your while loop) runs that compound command in a subshell. In Solaris 10 and earlier1, you don't want to use /bin/sh as it's the Bourne shell. Use /usr/xpg4/bin/sh or /usr/bin/ksh instead to get a POSIX sh. If for some reason you have to use /bin/sh, then to work around that, instead of doing: compound-command < file You can do: exec 3<&0 < file compound-command exec <&3 3<&- That is: duplicate the fd 0 onto fd 3 to save it away and then redirect fd 0 to the file. run the command restore fd 0 from the saved copy on fd 3. And close fd 3 which is no longer needed. 1. In Solaris 11 and later, Oracle eventually (at long last) made /bin/sh a POSIX shell, so it now behaves like the sh of most other Unices (it interprets the sh language specified by POSIX though it supports extensions over it as it's based on ksh88 (like other Unices, where sh is now generally based on ksh88, pdksh, bash, yash or an enhanced ash))
0.888889
/bin/sh redirects compound command in a subshell
The $ABCD$ paralelograms sides are $AB,BC,CD,DA$. On these line segments there are points in the same order: $X,Y,Z,V$.
The $ABCD$ paralelograms sides are $AB,BC,CD,DA$. On these line segments there are points in the same order: $X,Y,Z,V$. We know, that: $$\frac{AX}{XB}=\frac{BY}{YC}=\frac{CZ}{ZD}=\frac{DV}{VA}=k$$ $k$ is a positive constant what is less then $\frac{1}{2}$. What is the value of $k$, if the area of $XYZV$ is 86% of the area of $ABCD$? Can you tell me a step by step answer to this question?
Let $AB = CD = a$ and $BC = AD = b$. Then we have: $$\frac{AX}{XB} = k \implies \frac{a}{XB} = k+1 \implies XB = \frac{a}{k+1}$$ From this we obtain that: $$AX = \frac{ka}{k+1}$$ We get simular results for all other segments. Now check that $XYZV$ is inscribed in $ABCD$ and we have: $$P_{ABCD} - P_{XBY} - P_{YCZ} - P_{ZDV} - P_{VAX} = P_{XYZV}$$ Now using the condition and the formula for area of a triangle we have: $$P_{ABCD} - \frac{XB\cdot YB \cdot \sin \angle XBY}{2} - \frac{YC\cdot ZC \cdot \sin \angle YCZ}{2} - \frac{ZD\cdot VD \cdot \sin \angle ZDV}{2} - \frac{VA\cdot XA \cdot \sin \angle VAX}{2} = \frac{86P_{ABCD}}{100}$$ Substitute for all the segments and the recall the formula for area of a paralelogram: $P = ab \sin \alpha$ and you'll get: $$P_{ABCD} -\frac{2kP_{ABCD}}{(k+1)^2} = \frac{86P_{ABCD}}{100}$$ Divide by $P_{ABCD} \not = 0$ and you'll get: $$\frac{7}{50} = \frac{2k}{(k+1)^2}$$ $$7(k+1)^2 = 100k$$ $$7k^2-86k + 7 = 0$$ Solbing it you'll get: $k_1 = \frac 17 \left(43 - 30\sqrt{2}\right)$ and $k_2 = \frac 17 \left(43 + 30\sqrt{2}\right)$. Since $k_2 >2$ the only solution is $k_1$
0.777778
$AB = CD = a$ and $BC = AD = b$
To what extent does the Law of Moses still apply?
Matthew 5:17-18 (KJV) 17 Think not that I am come to destroy the law, or the prophets: I am not come to destroy, but to fulfil. 18 For verily I say unto you, Till heaven and earth pass, one jot or one tittle shall in no wise pass from the law, till all be fulfilled. As I understand it, the Law of Moses is fulfilled in Christ. We don't make sacrifices anymore, and many other of the finer points in the Pentateuch are no longer preached. Yet, I still see people reference these books for doctrine (for example the 10 Commandments). How much of the Law of Moses still applies?
The question have at less this three answers: If you believe in the Convenant Theology, then all the laws in the Old Testament that was not abolished on the New Testament still apply. If you believe in the Dispensationalist Theology, then all the laws in the Old Testament that aren't confirmed on the New Testament don't apply. If you are catholic what the church say today. Font: - Dispensationalism Today, Charles Ryrie - Things to Come, J. Dwight Pentecost - Systemathic Theology, Wayne Grudem
0.888889
If you believe in the Convenant Theology, then all the laws in the Old Testament that were not confirmed on the New Testament still apply
Brakeman: model attribute used in file name warnings
I'm setting file name like 'abc_1.pdf' where '1' is the value of a model's attribute. But brakeman scanner take this as security issue. I need to keep track of files by referencing file name with model attribute. Can you please tell me, what is the right way to fix this security issue? Thanks.
i don't know the Brakeman gem but you can use a bijective transformation to append your referencing model attributes to the filename so Brakeman does not worry about. Or you can generate some kind of unique hashkey for your model attribute which is stored somewhere (else) along with the model attribute so you can look up later the model attribute then presenting the hashkey.
1
Brakeman is a referencing model attribute
Save and Load pictures windows 8 app
I have some trouble with saving and opening pictures in a windows 8 store app. Let me explain it: We are making an Camera app, which is supposed to saves pictures with a title and description (probably in pictures library) and load them back in to show them nicely groups. We are using Json to save the data like Title and description and (which i think is not smart) the path to the file. However i cant find out how i can load the pictures back in from the path i have. <Image Source="{Binding ImagePath}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/> This is how i load the images in from the path i have, it only works for pictures in the Assets/ folder of my project. Not for the picture library. private async Task GetSampleDataAsync() { if (this._groups.Count != 0) return; Uri dataUri = new Uri("ms-appx:///DataModel/SampleData.json"); StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri); string jsonText = await FileIO.ReadTextAsync(file); JsonObject jsonObject = JsonObject.Parse(jsonText); JsonArray jsonArray = jsonObject["Groups"].GetArray(); foreach (JsonValue groupValue in jsonArray) { JsonObject groupObject = groupValue.GetObject(); SampleDataGroup group = new SampleDataGroup(groupObject["UniqueId"].GetString(), groupObject["Title"].GetString(), groupObject["Subtitle"].GetString(), groupObject["ImagePath"].GetString(), groupObject["Description"].GetString()); foreach (JsonValue itemValue in groupObject["Items"].GetArray()) { JsonObject itemObject = itemValue.GetObject(); group.Items.Add(new SampleDataItem(itemObject["UniqueId"].GetString(), itemObject["Title"].GetString(), itemObject["Subtitle"].GetString(), itemObject["ImagePath"].GetString(), itemObject["Description"].GetString(), itemObject["Content"].GetString())); } this.Groups.Add(group); } } This is how i load my data from the json file. I don't know if this is helpful I hope it's clear what my problem is? I can provide more information if you need it. my English isn't very well, so if you have questions, i can provide answers.
For others who will find this page, i fixed it by using local folder in windows. You can access local folder with ms-appdata:///local/dfds.jpg
0.777778
You can access local folder with ms-appdata
What should I look for in a recording microphone for personal use?
I was browsing through mics on Amazon and quickly realized I was out of my depth. There are a couple closely related questions I am wondering about: Are there different types of mics for (1) singing into at a concert, (2) singing into in a quiet room, and (3) picking up sound at more of a distance (e.g., singing and playing guitar and having both recorded with the one mic)? What are they? I'm most interested in a mic for case (3). This is obviously not professional, I just want something with passable quality and not too much noise considering I'll be in a random room in a house or apartment. What kind of things should I look for in a mic to achieve that? What are the factors that most depend on price? (If it's feasible I'd like to try to fit it into my $50 contest reward.) There are a few terms I saw like "moving coil", "condenser", and "dynamic" that I saw used to describe mics. If you could touch on these and any other relevant terminology that would be awesome.
There are two (popular) types of microphones: dynamic microphones and electret/condensor mics. Dynamic microphones They work like a speaker in reverse. Sound moves a diaphragm/coil assembly. The coil moves over a magnet and a current gets induces. Hence we have voltage. Almost indestructible. YOu can literally pound nails with a Sure SM58 (fun abuse video here ) Very good at very loud sources, can be shoved in front of a Marshall stack without clipping no inherent noise on their own However, very low sensitivity. Need a LOT of amplification for low and medium level sources They are almost always "Cardoid" or "supercardiods". This makes them more resilient against feedback but it also creates a lot of artificial bass amplification for sources that are close to the mic. They tend to make the voice very "boomy" Frequency response is typically not very flat. Electret or Condenser Microphones They work by having a diaphragm moving against a statically charged electrode. Moving the diaphragm changes the electric capacity of the contraption which modulates the charge current. The current is super tiny so all microphone of these type have build in pre-amplifier that needs a power supply. This supply either comes from a battery, an external power supply box, 48V phantom supply from a mixer or interface box, or from the USB spigot. Electret are mostly omni directional but some are also cardioid or supercardiod or even switchable. We assume an omni here, They tent to have a very flat frequency response, especially if it's an omni directional microphone. Frequency response does not change with distance (no boomy voice) Tend to have good sensitivity, good for low and medium level sources Can clip at high volumes, so need to managed carefully Has inherent noise in the capsule and the pre-amp. The larger the diaphragm, the smaller the noise Fairly sensitive to feedback Due to omni character more likely to pick up environmental noise Because of the trade offs listed, most people use dynamic cardioid microphones in live situations and an omni-directional electret/condenser mic for recording. Electret are cleaner and truer to the original sound source but they need to be carefully managed in terms of placement, gain, noise, clipping, and external noise pick up. Tip: if you are into DIY projects you can build your own with a very inexpensive electret capsule (such as the Panasonic WM-61A). See https://pantherfile.uwm.edu/type/www/audio-reports/PanasonicWM-61A_OtherBinauralRigs/WM61A_Webpage_Caps_Mounts.html. These can make remarkably good mics that sound as good as commercial micd that cost 100s of $.
1
Dynamic and electret microphones
Keep rainmeter from minimizing
HI! Just been playing around with Rainmeter and I notice that if I want to go look at my desktop and I click on the bottom right square in win7 that minimizes to the desktop, the rainmeter "gadget" gets minimized as well, not letting me read what I want to see. Is there something I can configure to make it stay up? Thanks!
Try right clicking on the gadget and choosing "always on top", whilst it means it goes on all windows, it does mean that it will stay there when you click the button to go to desktop or hover on it. Apart from this, gadgets should always be visible when the desktop is shown even if the "always on top" option is not selected, so if it is not visible - it is probably an error in the gadget.
1
Select "always on top" to go to desktop or hover on gadget
Can someone explain the phrase "All is fair in love and war"?
What are its origins and what does it really mean?
I don't think anyone has addressed (more than cursorily, anyway) the part of the poster's question that asks, "What are its origins?"—so I'll focus on answering that. J. A. Simpson, The Concise Oxford Dictionary of Proverbs (1982) offers this lineage for the proverb: All's fair in love and war [1578 LYLY Euphues I. 236 Anye impietie may lawfully be committed in loue, which is lawlesse.] 1620 T. SHELTON tr. Cervantes' Don Quixote II. xxi. Love and warre are all one. .. It is lawfull to use sleights and stratagems to .. attaine the wished end. 1845 G. P. R. JAMES Smuggler II. iv. In love and war, every strategem is fair, they say. 1850 F. E. SMEDLEY Frank Fairlegh xlix. "You opened the letter!' .. 'How was I to read it if I hadn't? All's .. fair in love and war, you know.' 1972 J. I. M. STEWART Palace of Art xii. 'Do you really suppose I would tell?' he demanded coldly. 'Might do. All's fair in——.' But between Shelton in 1620 and James in 1845, an interesting alternative commentary on love and war was developing in North America. From Bartlett Whiting, Early American Proverbs and Proverbial Phrases (1977): L230 In Love and war no time should be lost 1777 Munford Patriots 451: In love and war no time should be lost. 1784 Washington Writings 28.2: Favorable moments in war, as in love, once lost are seldom regained. Martin Manser, The Facts on File Dictionary of Proverbs (2002) cites the Smedley quotation from 1850 as the first instance of the proverb in its current standard form, but then notes: The proverb was first recorded with different wording, in 1620 [presumably meaning Shelton's translation of Don Quixote]. In modern use an extra word is often added to or substituted for part of the proverb, as in "All's fair in love—an' war—an' politics" (George Ade, County Chairman, 1903). Linda and Roger Flavell, Dictionary of Proverbs and Their Origins (1993) offers this longer view of "all's fair in love and war": The assumption behind this proverb is that the end justifies the means.This has long been recognized in the theatre of war. Livy hinted at it two millennia ago: To those to whom war is necessary it is just (HISTORY c 10 BC). Courtship, too, may entail the use of any means if one is to emerge victorious and take the prize. These excesses of the heart are considered forgiveable because love has long been understood as a force which cannot be restrained: Both might and malice, deceyte and treacherye, all periurye, anye impietie may lawfully be committed in loue, which is lawlesse (John Lyly, EUPHUES, 1579). The link between love and fighting for a kingdom was already established in a proverbial form by 1606: An old saw hath bin, Faith's breach for love and kingdoms is no sin (Marston, THE FAWN). Later in the same century Aphra Behn writes: Advantages are lawful in love and war (THE EMPEROR AND THE MOON, 1677). There was also the strong contemporary influence of DON QUIXOTE by Cervantes. Publication of Part One was in 1605 and it was soon translated into English. One passage runs [in Spanish, literally translated, presumably, since this isn't Stewart's language]: Love and war are the same thing, and stratagems and policy are as allowable in the one as in the other. Rosalind Fergusson, The Facts on File Dictionary of Proverbs (1983)—same title and publisher as Manser's book above, but almost twenty years older and completely different in content—identifies several allied proverbs, though it doesn't identify where these other sayings come from: Love is lawless. Love is a game in which both players always cheat. War, hunting, and love are as full of trouble as pleasure. Advise none to marry or to go to war.
1
What is the proverb's origins?
How to create an entity with a composite primary key containing a generated value
Using Hibernate + annotations, I'm trying to do the following: Two entities, Entity1 and Entity2. Entity1 contains a simple generated value primary key. Entity2 primary key is composed by a simple generated value + the id of entity one (with a many to one relationship) Unfortunately, I can't make it work. Here is an excerpt of the code: @Entity public class Entity1 { @Id @GeneratedValue private Long id; private String name; ... } @Entity public class Entity2 { @EmbeddedId private Entity2PK pk = new Entity2PK(); private String miscData; ... } @Embeddable public class Entity2PK implements Serializable { @GeneratedValue private Long id; @ManyToOne private Entity1 entity; } void test() { Entity1 e1 = new Entity1(); e1.setName("nameE1"); Entity2 e2 = new Entity2(); e2.setEntity1(e1); e2.setMiscData("test"); Transaction transaction = session.getTransaction(); try { transaction.begin(); session.save(e1); session.save(e2); transaction.commit(); } catch (Exception e) { transaction.rollback(); } finally { session.close(); } } When I run the test method I get the following errors: Hibernate: insert into Entity1 (id, name) values (null, ?) Hibernate: call identity() Hibernate: insert into Entity2 (miscData, entity_id, id) values (?, ?, ?) 07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 0, SQLState: null 07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: failed batch 07-Jun-2010 10:51:11 org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at test.App.main(App.java:32) Caused by: java.sql.BatchUpdateException: failed batch at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247) ... 8 more Note that I use HSQLDB. Any ideas about what is wrong ?
You can use foreign key in embedded id as a separate read-only column: @Entity public class Entity2 { @EmbeddedId private Entity2PK pk = new Entity2PK(); @ManyToOne @JoinColumn(name = "entity1_id") private Entity1 entity; ... } @Embeddable public class Entity2PK implements Serializable { @GeneratedValue private Long id; @Column(name = "entity1_id", insertable = false, updateable = false) private Long entity1Id; }
0.888889
Foreign key in embedded id as separate read-only column
Is there a way I can share the 3.42 GB download of Windows 8.1 from Windows Store?
Windows 8.1 is out, and I would like to know if it is possible to share the Windows 8.1 download upgrade between different computers so that I don't have to download it over and over again? This might be helpful for people who are on a metered connection. Store is downloading 3.42 GB of data so it must be stored somewhere. Is there a way I can copy it to my other computers and start the setup so that I don't have to download it over and over again on each computer I own?
Here are the direct Windows Store ESD (encrypted ISO) links from official website (EN-UK version): Windows 8.1 x86 Windows 8.1 x64 Windows 8.1 Pro x86 Windows 8.1 Pro x64
1
Windows Store ESD (encrypted ISO)
ASP.NET membership/ automatically log existing user on
I have used facebook to allow users to log into a site. The page that manages the login will get the users facebook id and then look on the ASP.NET membership tables for a pre-existing user that has a matching ID. No match: a new user is created and logged in (no problem). A match: I want to log the user on. The problem is that I have the hashed password and I cannot use MembershipService.ValidateUser(logOn.UserName, logOn.Password) to log the user on. If I just use FormsAuthentication.SetAuthCookie, the user doesn't appear as logged in. I could set enablePasswordRetrieval to true in the web config and then just get the actual password, but I don't want to. I want this to be secure. Does anyone know a way to log a user onto ASP.NET Membership just using the user name? I have looked at the MembershipProvider class for alternative methods but I cant find any. Thanks, Oliver
You could try FormsAuthentication.RedirectFromLoginPage (http://msdn.microsoft.com/en-us/library/ka5ffkce.aspx), which sets the cookie (I believe,though you may have to manually set the cookie), and then redirect to the designated page to redirect from (specified in the configuration file for the auth settings). Essentially, after setting the cookie, you do have to do a redirect or postback after setting it, because it won't look like the application has enabled your authentication. HTH.
1
FormsAuthentication.RedirectFromLoginPage
Formal proof that $\mathbb{R}^{2}\setminus (\mathbb{Q}\times \mathbb{Q}) \subset \mathbb{R}^{2}$ is connected.
Cam anyone provide me the proof of: that $\mathbb{R}^{2}\setminus (\mathbb{Q}\times \mathbb{Q}) \subset \mathbb{R}^{2}$ is connected.
Suppose $(x,y),(a,b)\in \mathbb{R}^2\setminus\mathbb{Q}\times\mathbb{Q}$. Then either $x$ or $y$ is irrational. Suppose $x$ is irrational. Then there's a path from $(x,y)$ to $(x,b)$ that remains in $\mathbb{R}^2\setminus\mathbb{Q}\times\mathbb{Q}$, namely, the second coordinate changes from $y$ to $b$ while $x$ stays put. Now you have to get from $(x,b)$ to $(a,b)$ along a path. If $b$ is irrational, you do it the same way except that it's the $x$-coordinate that changes, from $x$ to $a$. If $b$ is rational, then you're going to need to put the "horizontal" path elsewhere than at $b$ and use two vertical paths instead of one.
0.888889
Suppose $x$ or $y$ is irrational.
Will I damage the command dial on my D5200 if I rotate it quickly?
In a Youtube video on the D5200 I saw that the guys handling the camera rotated the command dial very fast. I used to rotate the dial one jump at a time fearing that otherwise I would damage the dial or the internal circuit. Is my assumption right or wrong?
I don't know what specific model rotary wheel Nikon used in that camera, but moving it fast shouldn't cause any excessive wear. These rotary wheels are usually just rather simple mechanical switches. There are usually two separate switches. Each goes thru one complete cycle each detent, but the two are off from each other by 1/4 cycle. The fancy name for that is quadrature. With two quadrature signals, there are 4 states that get sequenced thru for each whole increment. It is quite easy to decode these two signals to keep track of the position of the wheel, regardless of what direction it is being moved in. One part of the switch usually rubs against a part of the wheel so that it is moved into and out of contact with the other part of the switch. The wear on the device is therefore mostly related to total revolutions, not how fast those revolutions are, at least not for something you can do by hand. If you spin it too fast, about the worst that is likely to happen is that the firmware gets confused and looses track of where the wheel is. It may miss increments, or even think you are spinning it the other direction. Most likely the rotaty wheel will outlast your ability to spin it, whether you spin it fast or slow.
1
rotaty rotary wheels are usually mechanical switches .
What is Google's policy about separate content on same URLs in mobile and desktop versions?
I'm currently developing a mobile version of my site where users' devices are automatically identified and then displayed either mobile or desktop view of the same URL. For usability purposes, I would like to display different information on certain URLs in mobile than desktop. For example, I'd prefer the content to be straight on first page on mobile, whereas my desktop root domain is a landing page. How will such arrangement affect Google's opinions about my site? Is is hurtful for my rankings? Or does Google separate desktop and mobile results?
You can display a mobile version using canonical and rel alternate tags , desktop version showing the alternate tag and mobile version showing the canonical tag. When serving dynamic HTML on the same URL you should use the vary HTTP header. Google explains this in detail: https://developers.google.com/webmasters/smartphone-sites/details
1
How to display a mobile version using canonical and rel alternate tags
How to allow users to choose different theme?
Some of my site users prefer a light theme, others prefer dark one. In drupal 6, is there a way to allow users to choose their favorite theme? How? Thanks
Try Themekey module. After installing this module from 'ThemeKey User Profile' configuration, enable the option for user to select their own themes, so that it will be available in user profile and user can select their own themes.
0.888889
Try Themekey module .
weird positioning problem while rotating image in Javascript
I am running into a weird positioning issue while rotating an image wrapped into a div in JavaScript. When rotating the image by either 90 or 270 degrees, the image suddenly is 50px above and 50px to the right of its parent div. For 0 or 180 degrees it's just fine. This is what I am doing: <html> <head> <script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.6.2.js"></script> </head> <body> <div id="crop_container" style="width:400px; height:400px; border:solid 1px;"> <img src="http://a8.sphotos.ak.fbcdn.net/hphotos-ak-snc6/249740_10150195623627623_506197622_7383520_7286937_n.jpg" style="display:block; position:relative; width:400px; height:400px;" /> </div> <script language="JavaScript"> var $cropContainer = $("#crop_container"); var $cropImage = $("#crop_container img"); var degrees = 90; $cropImage.css({"width":400, "height":300}); $cropContainer.css({"width":300, "height":400}); $cropImage.css({"-webkit-transform":"rotate("+degrees+"deg)","-moz-transform":"rotate("+degrees+"deg)"}); //$cropImage.css({"top":50, "right":50}); </script> </body> </html> Now when you uncommect the last css adjustment line with a correction of 50px from top and right it works just fine, but I have no clue as to why this is happening? Any advice would be greatly appreciated! Thanks! Joni
It depends on what you expect it to do. It is rotating around the midpoint of the image, not the rectangle. Midpoint placeholder: (150, 200) Midpoint image: (200, 150). Indeed, there is a 50px difference. You could change the midpoint of rotating before rotating by translating: translate(-50px, 50px) rotate("+degrees+"deg) so that the image midpoint becomes (200 - 50, 150 + 50) which is (150, 200), what you want. http://jsfiddle.net/4UUJN/2/
0.888889
Changing the midpoint of rotating before rotating
Do volcano blast changes earth's course?
Volcano blasts are one of the most powerful calamities on earth. When they blast they release large amount of mass in the air just like a jet does. Does such a blast have any effect on the course of the Earth? Does it change the Earth's orbit in any way? If not then how big a blast is needed to do it? Would a full eruption of the Yellowstone Supervolcano do it?
Shoot out a pea attached with a spring to the big lead ball. Nothing will change for the course of earth as the (minimal shifted) centre of mass of the whole system keeps it initial course it always had. If the force is so great that the spring snaps and the pea does get detached, the c.m. wouldn't change either as the recoil moment would push it back. Earth will have a wobble for a while, being dampened by releasing heat. Entropy is rising so thermodynamically sound.
1
Earth will have a wobble for a while, releasing heat
Managing without Objects in C - And, why can I declare variables anywhere in a function in C?
everyone. I actually have two questions, somewhat related. Question #1: Why is gcc letting me declare variables after action statements? I thought the C89 standard did not allow this. (GCC Version: 4.4.3) It even happens when I explicitly use --std=c89 on the compile line. I know that most compilers implement things that are non-standard, i.e. C compilers allowing // comments, when the standard does not specify that. I'd like to learn just the standard, so that if I ever need to use just the standard, I don't snag on things like this. Question #2: How do you cope without objects in C? I program as a hobby, and I have not yet used a language that does not have Objects (a.k.a. OO concepts?) -- I already know some C++, and I'd like to learn how to use C on it's own. Supposedly, one way is to make a POD struct and make functions similar to StructName_constructor(), StructName_doSomething(), etc. and pass the struct instance to each function - is this the 'proper' way, or am I totally off? EDIT: Due to some minor confusion, I am defining what my second question is more clearly: I am not asking How do I use Objects in C? I am asking How do you manage without objects in C?, a.k.a. how do you accomplish things without objects, where you'd normally use objects? In advance, thanks a lot. I've never used a language without OOP! :) EDIT: As per request, here is an example of the variable declaration issue: /* includes, or whatever */ int main(int argc, char *argv[]) { int myInt = 5; printf("myInt is %d\n", myInt); int test = 4; /* This does not result in a compile error */ printf("Test is %d\n", test); return 0; }
c89 doesn't allow this, but c99 does. Although it's taken a long time to catch on, some compilers (including gcc) are finally starting to implement c99 features. IMO, if you want to use OOP, you should probably stick to C++ or try out Objective C. Trying to reinvent OOP built on top of C again just doesn't make much sense. If you insist on doing it anyway, yes, you can pass a pointer to a struct as an imitation of this -- but it's still not a good idea. It does often make sense to pass (pointers to) structs around when you need to operate on a data structure. I would not, however, advise working very hard at grouping functions together and having them all take a pointer to a struct as their first parameter, just because that's how other languages happen to implement things. If you happen to have a number of functions that all operate on/with a particular struct, and it really makes sense for them to all receive a pointer to that struct as their first parameter, that's great -- but don't feel obliged to force it just because C++ happens to do things that way. Edit: As far as how you manage without objects: well, at least when I'm writing C, I tend to operate on individual characters more often. For what it's worth, in C++ I typically end up with a few relatively long lines of code; in C, I tend toward a lot of short lines instead. There is more separation between the code and data, but to some extent they're still coupled anyway -- a binary tree (for example) still needs code to insert nodes, delete nodes, walk the tree, etc. Likewise, the code for those operations needs to know about the layout of the structure, and the names given to the pointers and such. Personally, I tend more toward using a common naming convention in my C code, so (for a few examples) the pointers to subtrees in a binary tree are always just named left and right. If I use a linked list (rare) the pointer to the next node is always named next (and if it's doubly-linked, the other is prev). This helps a lot with being able to write code without having to spend a lot of time looking up a structure definition to figure out what name I used for something this time.
0.666667
c99 doesn't allow a pointer to a struct as their first parameter .
Is an old mtb with replaced gear safe to buy?
I believe this question to be on topic for this site, I want it to be more factual based than opinion, another similar question is this one. If its not feel free to close it. I am looking at buying an older (10 yrs old) Giant NRS 1 MTB, it has very good reviews for the frame especially, but other parts have been replaced (it has a new front wheel, cables etc.). Should I be worried that other parts will be about to fall off, or are replacements a good thing? EDIT: Ok so the wheel was replaced due to hitting a stump at night time, the cables were getting old, it has had plenty of action, but was well looked after. The rear sus has a tiny bit of play in the top bush (not enough to realise when riding) It also has a leaking front fork, not a big issue (probably new seal, or not worry), but makes me wonder if it is worth it, will cost around $400 US ish, do you think it will have other issues? cheers in advance!
Aluminum fatigues. A 10 year of bike with a lot of miles could be getting towards the end of it life. It has a modern headset. Full suspension has come a long way in 10 years. But 26" wheels. I would rather have a hard tail 29". You would have to judge the parts based on inspection. With a leaky fork I would not do it period. How do you know it is not a big issues? Do you have a quote that it is a cheap repair? To me that is not the kind of bike you put a lot of money into.
0.777778
How do you know it is not a big issue?
What is a "strictly positive distribution"?
I am reading Judea Pearl's "Causality" (second edition 2009) and in section 1.1.5 Conditional Independence and Graphoids, he states: The following is a (partial) list of properties satisfied by the conditional independence relation (X_||_Y | Z). Symmetry: (X_||_ Y | Z) ==> (Y_||_X | Z). Decomposition: (X_||_ YW | Z) ==> (X_||_Y | Z). Weak union: (X_||_ YW | Z) ==> (X_||_Y | ZW). Contraction: (X_||_ Y | Z) & (X_||_ W | ZY) ==> (X_||_ YW | Z). Intersection: (X_||_ W | ZY) & (X_||_ Y | ZW) (X_||_ YW | Z). (Intersection is valid in strictly positive probability distributions.) (formula (1.28) given earlier in the publicatiob: [(X_||_ Y | Z) iff P(X | Y,Z ) = P(X | Z) ) But what is an "strictly positive distribution" in general terms, and what distinguishes a "strictly positive distribution" form a distribution that is not strictly positive?
A strictly positive distribution $D_{sp}$ has values $D_{sp}(x)>0$ for all $x$. This is different from a non-negative distribution $D_{nn}$ where $D_{nn}(x) \geq 0$.
1
a strictly positive distribution $D_sp$ has values for all $x$
Bulk exporting/archiving collections in Lightroom
Is there any way to export images from my collections, where the images are automatically placed into a folder tree that mimics their collections? I'm not comfortable with having all that organization data locked away in Lightroom -- I switch computers a lot and oftentimes data sidecars like Lightroom's DB get lost in the shuffle. I'd like to export all my images into folders that can then be fed into Crashplan, etc. Ideally I want it to archive only images in each collection that match a Smart search criteria, like 4+ stars. jF's Collection Publisher plugin looks nice but it has its own collection tree that must be maintained separately. This solution is not DRY (Don't Repeat Yourself) enough for me: I don't want to maintain two separate hierarchies of collections. EDIT: To clarify, let's assume I have images sorted in collections as such: < Collection root > |- California | |- Surfers | |- Hipsters | |- Beaches |- Holland |- Windmills |- Stroopwaffels |- Coffeeshops |- Grachten I am looking for something that exports images into a folder tree identical to the one above, without any extra maintenance or work. So JPG or TIFF files would be exported/published to: /Users/tom/Photography/California/Surfers /Users/tom/Photography/California/Hipsters /Users/tom/Photography/California/Beaches /Users/tom/Photography/Holland/Windmills /Users/tom/Photography/Holland/Stroopwaffels /Users/tom/Photography/Holland/Coffeeshops /Users/tom/Photography/Holland/Grachten In accordance with the collections they live in in LR. jF's plugin is nice but it works from its own collection tree, which makes it unsuitable for this kind of request.
First, note that any Export in Lightroom is a RAW conversion***. So, attempting to get organization data from an export will result in getting that data into the JPG, but losing it in the RAW. A better solution is to use Smart Collections, and have them be generated on metadata that can be associated with both RAW and JPEG. Collections are convenient to create via drag and drop, so creating Smart Collections involves more work. So I create Collections first, then create metadata tags for those images in the Collection, then create a Smart Collection from the tags, I then delete the Collection. This way, XMP sidecars associated from your RAW images contain the metadata for another application to create equivalent of Smart Collections later, and your JPG images also contain this information in IPTC tags. ***Original JPEGs won't get RAW conversion of course
0.888889
Trying to get organization data from an export in Lightroom is a RAW conversion
Could Belief in Little Fears: Nightmare Edition cause the dark side of the moon to really be dark?
I'm writing an episode which involves a plot by the monster Vanish involving possessing the dark side of the moon (if you don't know, his power is to possess shadows). I was going with the fact that the term "the dark side of the moon" would cause enough children to believe that it really was dark for Belief to make it so, but I'm not entirely sure that Belief works that way. Does it?
It's been a long while since I played Little Fears and I never did GM it, but from what I remember Belief was a child's main defensive thing. It also had it's negative side such as holding your breath when riding through a tunnel, or lifting your feet when riding over rail road tracks, or not stepping on cracks in the sidewalk. All of which have some form of negative consequence which can have a regional component in some cases. Judging by your wording of the question, "would cause enough children to believe that", it sounds you may want to impose a threshold of some kind on the plot. From what I remember, you don't need to go that far. Only one believer would be needed to make it happen. But children that didn't believe, say because they never heard of the possibility, would not be subject to the effect. The beautiful thing is that once a group of children hear about something, some of them will believe. A real life example of that being a young sibling of my friend believed I had a battery in my big toe. Why? I said I did. It was that simple. In the same way, agents of Closetland could spread negative believes that serve one of the seven kings or whatever master the agent follows. If you get to them young enough they will believe some really wild stories. Have fun with Little Fears, I may have to go looking for it again.
0.777778
"would cause enough children to believe that"
Can I use Windows Server 2008 R2 as a workstation?
I would like to know if I can temporarily use Windows Server 2008 R2 as a workstation on my laptop? My laptop is an ASUS M51Va The reason for this is that I am attending on a Microsoft MCSA courses and I want to practice the trainings at home so that I can learn more. By using it as a workstation I mean will it be possible to use it to watch movies or play games like I do on windows 7? Lets say for example can i install a media player like VLC or install Warcraft TFT?
For the most part you should be able to play games and watch movies, although some programes will not run on a server machine, for example, some anti-virus products will detect that you are running on a server and whine/refuse to install. You will also need to set up other services such as the Windows Audio and Search but overall you shoudln't have any problems. Also, consider a dual-boot setup, so Server 2008 plus your current OS, or take a look at VirtualBox for Virtualisation, as you mentioned it is only a tempoary setup.
1
VirtualBox for Virtualisation
ListView OnItemClickListener is not listening
I checked all the previous questions regarding this issue , but none of them are helpfull to me . My listview is not responding , i tried changing this list.setOnItemClickListener(new ContactsListItemClickListener(this)); to list.setOnItemClickListener(this); by making my PrioritiseContacts activity just imeplement OnItemClickListener , but then too its not working . The activity is successfully running , but i am unable to listen for listclick events. How to correct this? Here is my class : public class PrioritiseContacts extends Activity implements OnClickListener { private ListView list; // list of contacts with name private List<Contacts> contactsList; private Controller controll; private ContactListAdapters adapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.select_contacts); controll = new Controller(); contactsList = controll.fetchContacts(this); // call the adapter to set the list view layout adapter = new ContactListAdapters(contactsList, this); list = (ListView) findViewById(R.id.lv_contacts); // set the adapter to list list.setAdapter(adapter); list.setOnItemClickListener(new ContactsListItemClickListener(this)); // inflate the list of contact } @Override public void onClick(View arg0) { Toast.makeText(this, "clicked", 1000).show(); } class ContactsListItemClickListener implements OnItemClickListener { private Context c; public ContactsListItemClickListener( PrioritiseContacts prioritiseContacts) { this.c = prioritiseContacts; } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Toast.makeText(c, "Clicked", 1500).show(); System.out.print("clicked"); } } } My select_contacts xml : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000" android:orientation="vertical"> <TextView android:id="@+id/tv_select_contacts" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:text="Choose Contacts" android:textColor="#fdfdfd" android:textSize="30dip" android:gravity="center" > </TextView> <ListView android:id="@+id/lv_contacts" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp" android:cacheColorHint="#00000000" android:clickable="true" android:focusable="true" android:divider="@android:color/transparent" android:dividerHeight="10.0sp" android:scrollbars="none" > </ListView> </LinearLayout> And this is my adapter's getview() : @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; // layout infklater to inflate the post list view LayoutInflater inflater = (LayoutInflater) context .getSystemService(Activity.LAYOUT_INFLATER_SERVICE); if (convertView == null) { view = inflater.inflate(R.layout.contacts_list_view, null); } Contacts c = contactList.get(position); // set text views in contact lists // Typeface custom_font = // Typeface.createFromAsset(context.getAssets(),"fonts/calibril.ttf"); TextView name = (TextView) view.findViewById(R.id.tv_contact_name); // date.setTypeface(custom_font); name.setText(c.getName()); TextView number = (TextView) view.findViewById(R.id.tv_number); // title.setTypeface(custom_font); number.setText(c.getPhone()); ImageView contact_image = (ImageView) view.findViewById(R.id.iv_single_contact); // hut.setTypeface(custom_font); if(c.getContactImage() != null) contact_image.setImageBitmap(c.getContactImage()); else contact_image.setImageDrawable(view.getResources().getDrawable(R.drawable.ic_contact_picture_2)); return view; } My contacts_list_view xml : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl_post_list" android:layout_width="match_parent" android:layout_height="50dip" android:background="#000000" android:gravity="left" android:orientation="horizontal" android:paddingBottom="2dp" android:paddingTop="2dp" > <ImageView android:id="@+id/iv_single_contact" android:layout_width="70dp" android:layout_height="fill_parent" android:layout_weight="0.05" android:padding="2dp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.87" android:orientation="vertical" > <TextView android:id="@+id/tv_contact_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#000000" android:gravity="left" android:paddingLeft="2dp" android:text="Contact Name" android:textColor="#fdfbfb" android:textStyle="bold" /> <View style="@style/Divider" /> <TextView android:id="@+id/tv_number" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="sans-serif-thin" android:gravity="left" android:text="this is number" android:textColor="#fdfbfb" android:textSize="10dp" android:textStyle="bold" /> </LinearLayout> <CheckBox android:id="@+id/cb_contact" android:layout_width="70dp" android:layout_height="fill_parent" android:layout_weight="0.05" android:padding="2dp" /> </LinearLayout>
If any row item of list contains focusable or clickable view then OnItemClickListener won't work such as for checkbox or button etc in the row item.There are two solution: 1. row item must be having param like android:descendantFocusability="blocksDescendants" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:baselineAligned="false" android:descendantFocusability="blocksDescendants" android:gravity="center_vertical" > // your other widgets here </LinearLayout> 2. Set given two attributes to false like android:focusable="false" android:focusableInTouchMode="false" For example if there is any checkbox or button or image in the row item then <CheckBox android:id="@+id/fav_check_box" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="false" />
0.666667
OnItemClickListener doesn't work for checkbox or button etc in row item
Why can't my C++ compiler deduce template argument for boost function?
I define a method like so: template <class ArgT> void foo(ArgT arg, ::boost::function< void(ArgT) > func) { func(arg); } and use it like this --for instance--: foo(2, [](int i) -> void { cout << i << endl; }); Why can't the compiler deduce the type since it's definitely an int? I get 'void foo(ArgT,boost::function<void(ArgT)>)' : could not deduce template argument for 'boost::function<void(ArgT)>' from 'anonymous-namespace'::<lambda0>'.
You want a conversion from the lambda function to boost::function<void(ArgT)> where ArgT is to be deduced. As a general rule, you cannot have type deduction and conversion in the same argument of a function: no conversions take place when deducing a template parameter. The reasoning behind this is as follows. There are three types involved here: (1) the template parameter, (2) the function parameter type, (3) the passed object type. Two of the types (1 and 2) can be deduced from one another, but both are unknown. If the compiler can assume 2 and 3 are the same type, the problem is solved, but if all the compiler knows is that 3 can be converted to 2 there could be any number of possible solutions, and the compiler is not expected to solve the problem. In practice we know that in this particular case there is only one possible solution, but the standard does not make a distinction between cases. The rule above applies in all deducible contexts, even if the template parameter can be deduced from another function parameter. The solution here is make the relevant function parameter a non-deducible context, ie a context in which the compiler will never attempt to deduce the template parameter from the function parameter. This can be done as follows: template <class T> struct identity { typename T type; }; template <class ArgT> void foo(ArgT arg, typename identity<::boost::function<void(ArgT)>>::type func) { func(arg); }
0.888889
Deducing ArgT from lambda function
Should I tell other interviewers where else I've interviewed?
I am currently travelling for faculty interviews. Some professors and other interviewers have asked me where else I have interviewed. Should I tell interviewers where else I've interviewed? Intuitively I would like to give them less information, but I also don't want to appear guarded and defensive as a person, either.
Some professors and other interviewers have asked me where else I have interviewed. Should I tell interviewers where else I've interviewed? Yes, it is very likely in your best interests. If you have other interviews at comparable schools, then you will benefit from saying so. If you don't, then it's not so clear. However, departments will assume your job search is not going well if you are reluctant to address the issue and they haven't heard impressive rumors about your interviews, so avoiding discussing interviews won't really help. Instead of saying something awkward like "I'd rather not talk about that", it's better to be up front and optimistic. "This is my first interview" is better than "This is my only interview so far". Here are a few reasons why telling about other interviews can help your case: As a general rule, people want something more if they know other people also want it. Valuing a second opinion is rational behavior. Even when it doesn't change the outcome, competition can speed things up. If a search committee member is trying to make an offer and still needs some final committee or administrative approval, it's helpful to be able to say "Let's move fast, since she is also interviewing at X, Y, and Z, and we'd like to make a good impression by coming up with the first offer." If it's too late for that, they can say "She already has an offer from X, so we need to act before she decides." In principle, you could hurt your chances if you list a lot of schools typically considered much more desirable (which could make the school you are currently interviewing at feel they would just be wasting their time trying to compete). However, in this case you are probably already in trouble, since the rumors of your busy interview schedule may already worry the search committee. Instead of trying to cover things up, it's better to acknowledge that you have these other interviews. If you are worried about this risk, you can address it by making your interest clear throughout the interview.
0.888889
Should I tell interviewers where else I've interviewed?
Calculating pH of diprotic and amphoteric solutions
I am trying to understand this problem and its corresponding solution (complete solution not shown) First off, from the above one can see that the equilibrium constants when $\ce{H2ASO4-}$ donates and receives a proton are as follows: \begin{aligned} \ce{H2AsO4 &<=> HAsO4^{2-} + H+} & K_2 &= 1.1 \cdot 10^{−7}\\ \ce{H2AsO4- + H+ &<=> H3AsO4} & K_{-1} &= 1.6 \cdot 10^{2}\\ \end{aligned} However, if this is an amphoteric substance as the solution claims, shouldn't both $K_a$ values be comparable? It seems logical that if it is able to act as both an acid and a base, the equilibrium constants should at least be similar to each other. Instead, one is several order of magnitudes larger than the other? Why can this be true and $\ce{H2ASO4-}$ still be an amphoteric substance? Next, how did they arrive at the statement We approximately have the equality relation: $$\ce{[H3AsO4]} = \ce{[HAsO4^{2−}]}$$ What is the evidence that shows this to be true? Isn't the $K_a$ value of the basic reaction ($1.6 \times 10^2$) much larger than that of the acidic reaction? Why should the concentrations be equal? Finally, let's say you are calculating the pH for the diprotic substance $\ce{H2S}$, which undergoes the following diassociations: $$\ce{H2S <=> H+ + HS-}$$ $$\ce{HS- <=> H+ + S^{2-}}$$ To find the pH you would assume that the first reaction is dominant, and that the effects of the second reaction consuming $\ce{HS-}$ are minimal, and then calculate the pH from there — right? However, why can't you treat $\ce{HS-}$ as an amphoteric substance (because it can both gain and lose a proton) and then calculate the pH as you would for an amphoteric substance (as seen in the image at the beginning)?
First, I have read that $\ce{H2AsO4-}$ is a amphiprotic substances in that the dominant reactivity is $$\ce{2H2AsO4- <=> H3AsO4 + HAsO4^{2-}}$$ However, this also seems to be a polyprotic substance. The two terms - amphiprotic and polyprotic - aren't mutually exclusive. Amphiprotic substances can simply behave as both Bronsted-Lowry acids and bases in that they can both give up and release hydrogen protons. Polyprotic acids have multiple protons to donate. For example, phosphoric acid is triprotic. Often times amphiprotic substances will be polyprotic. By nature of being able to lose multiple protons, these substances are also able to gain multiple protons. Why is one $K_a$ value so much larger than the other? If this were a amphoteric substance shouldn't the $K_a$ values for both be comparable? Good observation. This lies with Coulomb's law. Think about it. A neutral molecule kicks off a hydrogen proton. Now you have the first conjugate base. The first conjugate base is negatively charged. It also attempts to kick off a proton. Which do you think is easier? Clearly the first process is. Remember that oppositely charged particles attract. This explains why $K_{a1}$ values for polyprotic molecular acids are generally significantly larger than corresponding $K_{a2}$ values. Just because the $K_a$ values differ by several orders of magnitude doesn't mean the ion/molecule can't be amphiprotic. Next, I researched how to calculate the $\mathrm{pH}$ value for amphiprotic substances, and I found this page that details how to do so, and the end result is that the $\mathrm{pH} = \sqrt{K_1 K_2}$. Why is the $\mathrm{pH}$ independent of the concentrations? First, amphiprotic substances don't have $\mathrm{pH}$ values by themselves. In solution, then yes. Further, I also found another page that gets to the same result in a different manner. They start by saying: We approximately have the equality relation: $$\ce{[H3AsO4]} = \ce{[HAsO4^{2−}]}$$ Regarding the validity of the quoted statement: just note the main reaction stoichiometry. And the magnitude of the main reaction's K. The main K can be found through dividing the Ka of the reactant acid by the Ka of the product acid. \begin{aligned} \ce{H2AsO4^{−} + H2AsO4^{−} &<=> H3AsO4 + HAsO4^2-}\\ K_\mathrm{rxn} &= \frac{K_a(\ce{H2AsO4^{−}})}{K_a(\ce{H3AsO4})}\\ \end{aligned} Next, why can't this method of calculating pH in amphoteric acids be used for diprotic acids? I found another page that details how to do so but even though the reactions are essentially similar to those for amphiprotic acids, the end result is different. Why does the same line of reasoning as used for deriving the formula for amphoteric substances fail for diprotic/polyprotic acids? For diprotic acid, just keep $K$ value magnitudes in mind. This statement applies to diprotic and polyprotic acids: $$K_{a2}(\ce{H3AsO4}) = \ce{[HAsO4^{2−}]}$$
0.777778
How to calculate pH in amphoteric acids?
What is difference between SPContext.Current.Web.URL and SPContext.Current.Site when using SPSite object?
SPSite spsite1=new SPSite(SPContext.Current.Web.URL); SPSite spsite2=SPContext.Current.Site; What is the difference and when do we decide which one to use? I feel both give us the site collection object. Example: SPWeb spweb=spsite1.RootWeb; will mean same as spsite2.RootWeb; Then why are there 2 ways to do it?
SPSite spsite1=new SPSite(SPContext.Current.Web.Url); will give you SPSite object. But it will be site collection object only when SPContext.Current.Web.Url is that of root web. If the web object is that of a sub site then SPSite object won't be a site collection object. The second statement SPSite spsite2=new SPSite(SPContext.Current.Site); is wrong because there is no overload of SPSite which has SPSite as parameter. UPDATE If the intention is to get the rootweb then second is a better way of doing it as you are not instantiating a new SPSite object. Moreover, in the first case you will need to dispose SPSite object as you are creating a new one compared to second in which SPSite is retrieved through SPContext which should not be disposed explicitly.
1
SPSite spsite1=new SPSite(SPContext.Current.Web.Url)
Which part of the sentence can decide the meaning of "for"?
The following sentence which have the same sentence construction, but why do the meanings of "for" in them vary? The entrepreneur /has responsibility /for any risk involved. He /has too much money/ for a young man. I /have free advice /for you. I /have two hours/ for a rest. Many new trains /have space /for wheelchair users. We /have no real, objective, scientific evidence /for our belief. The sentences above have the same sentence construction, but the meaning of "for" in them vary. I don't know which part can decide the meaning of "for".
The structure in question is not the macro structure of the sentence, but rather, the patterns to the left and right of the word "for". Accountbility: The entrepreneur has responsibility ► any risk involved. ( ► = "for" ) Judgement of what can be expected for someone: He has too much money ► a young man. Who is intended to have something. I have free advice ► you. Purpose or function/ Also indicates purpose of time, money, or space or time I have two hours ► a rest. Purpose or function / Also indicates purpose of time, money, or space or time Many new trains have space ► wheelchair users. In support of somebody/something We have no real, objective, scientific evidence ► our belief. This is similar to "operator overloading" in software programming: Note that 5 + 2 = 7 but "Hello " + "world!" = "Hello world!". The meaning of the plus sign changes depending on what it is "given to it" (aka "context"). The question remains, "How does one go about learning these usages?" There must be some way to systematically analyze the left/right words in order to determine which meaning of "for" is being used. This is probably best answered by an ESL speaker who has mastered this usage. Please feel free to comment.
1
How does one go about learning these usages?
Is it necessary to know initial y velocity to solve this projectile motion problem?
A marble is launched horizontally off a 93.0-cm high table causing the marble to land on the floor 1.85 m from the base of the table. a.) How long was the ball in the air? b.) With what velocity must the marble have left the tabletop? Wouldn't another piece of information be needed to solve this problem? Is it implied the initial y velocity is 0?
Yes it it implied that the $y$-component of the initial velocity is zero because the problem states that "the marble is launched horizontally."
1
"the marble is launched horizontally"
What table tools/packages do you use?
Making tables in LaTeX can be painful. All you need is a semi complex table with cells that have to span multiple rows/columns. What tools do you use to get around this complexity? Tabular? Tabularx? Are there others?
Using AUCTeX in Emacs also allows for easy editing of tabular enviroments in LaTeX. Here's a brief illustration/explanation I worked up: http://babbagefiles.blogspot.com/2011/01/latex-table-manipulation-using.html Preview:
0.888889
Using AUCTeX in Emacs also allows easy editing of tabular enviroments
How can I open a window on a different monitor?
With multiple monitors, I have so far been dragging windows manually around. Is there a way to make a window open on a specific screen in a dual-head setup? (Not to be confused with multiple X server displays.) Something like: SCREEN=2 firefox or open-in-screen 2 firefox. If it matters, my environment is KDE using the KWin window manager. KWin window rules can only match some properties like title, but I could not find an environment variable as filter. The secondary display extends the primary screen: $ xrandr -q Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 32767 x 32767 LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 382mm x 214mm 1600x900 60.1*+ 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 connected 1920x1080+1600+0 (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.0* 50.0 59.9 1920x1080i 60.1 50.0 60.0 1680x1050 59.9 1280x1024 75.0 60.0 1440x900 59.9 1280x960 60.0 1280x720 60.0 50.0 59.9 1024x768 75.1 70.1 60.0 832x624 74.6 800x600 72.2 75.0 60.3 56.2 720x576 50.0 720x480 60.0 59.9 640x480 75.0 72.8 66.7 60.0 59.9 720x400 70.1 DP1 disconnected (normal left inverted right x axis y axis)
This depends on how your dual-monitors are setup. If you are using XINERAMA to make both displays look like one to X, then you would use the -geometry option to ask applications to appear at a specific location. If you have the displays setup as different screens then you will use the DISPLAY to achieve this. Give these a try: $ DISPLAY=0.0 xterm & $ DISPLAY=0.1 xterm & If your monitors are screen 0 and 1, this should spawn an xterm on each monitor.
0.888889
XINERAMA displays are setup as different screens
Dried apricots smell of alcohol?
I recently opened a container of store-bought dried apricots and they smell vaguely of fermentation/alcohol. I've never noticed this before. They taste fine, but should I be concerned? Do they need to be used soon? Worst-case, would I end up sick, or just tipsy?
I've had apricots that smell vaguely like alcohol before, especially the ones that are not completely desiccated but are still plump and only dried to about half or so of their original volume. I've never had problems eating them and haven't had them go bad.
1
apricots that smell vaguely like alcohol are still plump and only dried to about half or so of their original volume
Silverlight: Returning value from synchronous method using Rx
I am writing a simple Silverlight application and WCF Service. I want to create a synchronous method that return a value. The method itself, call an asynchronous method from WCF Services. After I call asynchronous method, I want to get it value, and return to sender. I hear that Rx can solve this kind of problem. This is my code : private void btnCreate_Click(object sender, RoutedEventArgs e) { string myResult = getMyBook(txtBookName.Text); MessageBox.Show("Result\n" + myResult); // myResult will be use for another purpose here.. } // I want this method can be called anywhere, as long as the caller still in the same namespace. public string getMyBook(string bookName) { Servo.ServoClient svc = new ServoClient(); string returnValue = ""; var o = Observable.FromEventPattern<GetBookCompletedEventArgs>(svc, "GetBookCompleted"); o.Subscribe( b => returnValue = b.EventArgs.Result ); svc.GetBookAsync(bookName); return returnValue; } When I click btnCreate, myResult variable still empty. Is that something wrong with my code? Or maybe I am just don't understand with Rx concept? I am new to Rx. My goal is : I need to get the result (myResult variable) from asynchronous method, and then used in later code.
This is more suited to the async/await keywords than Rx. Rx is primarily for managing streams of data, whereas in this case all you want to do is manage an asynchronous call synchronously. You could try using Rx like so: public string getMyBook(string bookName) { Servo.ServoClient svc = new ServoClient(); svc.GetBookAsync(bookName); var o = Observable.FromEventPattern<GetBookCompletedEventArgs>(svc, "GetBookCompleted"); return o.First().EventArgs.Result; } However, if GetBookAsync raises the event before you subscribe, the thread will block forever. You could mess around with .Replay() and .Connect() but you should probably just use async/await!
0.777778
Rx is more suited to async/await keywords
No value for $TERM and no -T specified
I recently upgraded (with apt-get dist-upgrade) my Kubuntu and Lubuntu Linux boxes, and now every time I log into one of these machines, I get this message: tput: No value for $TERM and no -T specified Here is a screenshot of the exact message: This happened on both my Lubuntu machine and Kubuntu machine, and it wasn't a problem until after I upgraded; so I suspect that it was not user error. How can I fix this? UPDATE I have tracked this down to my .bashrc file, which is getting called by my .profile file. Though, the fact that my .bashrc file now runs when I do a GUI login whereas it didn't before I upgraded is a bit weird. And no, I haven't modified my .bashrc file or my .profile recently. Also, bash isn't my default shell. The problem is that I am calling tput in my .bashrc file to set up variables for use in adding color to the prompt. But at the (inappropriate) time when my .bashrc file now gets run, $TERM is not set. fgRed=$(tput setaf 1) ; fgGreen=$(tput setaf 2) ; fgBlue=$(tput setaf 4) fgMagenta=$(tput setaf 5) ; fgYellow=$(tput setaf 3) ; fgCyan=$(tput setaf 6) fgWhite=$(tput setaf 7) ; fgBlack=$(tput setaf 0) bgRed=$(tput setab 1) ; bgGreen=$(tput setab 2) ; bgBlue=$(tput setab 4) bgMagenta=$(tput setab 5) ; bgYellow=$(tput setab 3) ; bgCyan=$(tput setab 6) bgWhite=$(tput setab 7) ; bgBlack=$(tput setab 0) Updated question: How should I fix this? Should I set $TERM myself? Or should I just not set these variables if $TERM is not set? UPDATE 2 One solution I tried was to check whether $TERM was set. But this didn't seem to work; I still got the same error message. Here's the code: if [ ! "$TERM" = "" ]; then #Do stuff here fi So apparently $TERM was set, but tput still concluded it wasn't.
If you do this if tty -s then : # your tput commands fi It will fix your problem. Without the -s option tty will either display your tty or write "not a tty"
0.888889
if tty -s then : # your tput commands
C# & VS error: "make sure that the maximum index on a list is less than the list size"
I faced the error mentioned in the title when doing my homework, and simply can't find a way to remove it. Here is the method that I have this problem with: public static double LaskeMiidi(double[] luvut) { double ka = Keskiarvo(luvut); double miidi = luvut[0]; for (int i = 0; i < luvut.Length; i++) { if (luvut[i] - ka < luvut[i + 1] - ka) // The line error points to! { miidi = luvut[i]; } else { miidi = luvut[i + 1]; } } return miidi; } So basically the problem is that when I say luvut[i + 1], at some point this index might become more than the length of the array is. I just can't figure out any ways to solve this problem, since I'm only a beginner with programming.
Yes, this is the problem: for (int i = 0; i < luvut.Length; i++) { if (luvut[i] - ka < luvut[i + 1] - ka) When i is luvut.Length - 1, then i + 1 will be luvut.Length - and therefore an invalid index. (For an array of length x, the valid indexes are 0 to x - 1 inclusive.) You probably want to end one iteration earlier: for (int i = 0; i < luvut.Length - 1; i++) That way i + 1 will still be a valid index in the array - both in the if condition and in the body of the else clause.
0.888889
if i + 1 is invalid index in array of length x
Search option is not visible in Chrome's Developer Tools
I remember that there used to be a "Search" option in the developer section of Google chrome browser, for searching the user entered keyword in CSS or JavaScript files of the running website, which is not visible now. How to make it visible again. I checked all settings but can't find anything related to it.
If you hit Ctrl+F from the Developer tools, you get a search box where you can search for keywords within source. Hitting Ctrl+Shift+F brings up a dialog to search through all the sources of the website.
0.777778
Hitting Ctrl+Shift+F from Developer Tools
Where can I eat dishes that feature in western countries' Chinese restaurants?
... apart from western countries like the Australia or the USA themselves. During my visit to Taiwan, I wasn't able to find the dishes I'd typically encounter in a Chinese restaurant in Australia or the United States, such as sweet and sour pork, honey chicken, Mongolian lamb/beef, and fried ice cream. I have two main theories on why this is. One is that Chinese restaurant food is totally made up, and has no similarity with food anywhere in the world. In which case, I'd better give up trying to find the right location. This seems to be the case with fried ice cream, which Wikipedia suggests is an artificial modern invention. The other is that maybe I visited the wrong location. China is a big place, after all. Perhaps visiting another area, such as Inner Mongolia, would find me what I'm looking for, with dishes either the same as, or the un-modified version of what is served in western countries' Chinese restaurants. The Wikipedia article on Chinese restaurant mentions: There has additionally been a consequential component of Chinese emigration of illegal origin, most notably Fuzhou people from Fujian Province and Wenzhounese from Zhejiang Province in Mainland China, specifically destined to work in Chinese restaurants in New York City, beginning in the 1980s. As Fujian province is right next to Taiwan, and has had a major influence on it, it seems plausible that if some of the "Chinese restaurant" dishes were coming from Fujian, I would have seen them in Taiwan, but I didn't. Where, if anywhere, can I find the dishes that feature in western countries' Chinese restaurants? Also, how should I identify the right kind of eatery in those countries?
Nowhere in China. American Chinese cuisine (and its relatives in Australia, Europe, etc) is heavily adapted for Western tastes: "Chinese-American cuisine is 'dumbed-down' Chinese food. It’s adapted... to be blander, thicker and sweeter for the American public" Some dishes are localized versions of actual Chinese dishes (eg. Kung Pao chicken, which completely lacks the málà kick of the Sichuanese original), many were created in America (fortune cookies, "Mongolian beef", etc). The Wikipedia article above has a good list of both. Also, I've eaten a lot of "real" Fujianese (Hokkien) food in Singapore, where they're the single largest dialect group, and I can assure you that neither Fujian nor Hakka cuisine bears the slightest resemblance to Panda Express. Incidentally, this phenomenon is by no means unique. For example, Indian Chinese is what happens when Chinese and Indian cuisines collide, in Japan you can try out heavily Japanized Western dishes (yōshoku) like "omelette rice", and everybody has bastardized the poor Italians. Of course, things get really interesting when these get re-exported back to the home country, which is why you can now find American Chinese food in Shanghai!
1
Chinese-American cuisine is 'dumbed-down' Chinese food
Windows 7 batch search for email addresses
Thanks in advance for your help. I have to do a task on my office computer which means I can't install any additional software, so I think a batch file might be the easiest way to do this even if it's not the most efficient (although I welcome other solutions that I might be able to do without installing software on my office computer). Also, please keep in mind that I have very little programming experience in your answers :) Basically, I have a folder with a series of subfolders in it, each of these full of files of various types (text, emails, text-based pdfs, word docs). I also have a text file (or an excel column) with hundreds of email addresses in it. I want to use a batch file (or similar method) to run through each email address in the list and search against the contents of the various files in each folder like Windows Search does. Files which contain the search phrase should automatically be moved to a prespecified folder (possibly having to be renamed or put in a new subfolder as many of these files might have the same name). In the end, we should have one folder (as well as its subfolders) which contains no files which have any of the email addresses from the list in their contents, and another folder which only has files that has content containing the email addresses in their files (these can be in subfolders, or renamed, or whatever is most convenient, just not deleted). (Since the list of email addresses is in Excel, another option I could entertain would be using some sort of VBA macro if that is capable of searching the contents of files within a folder recursively.) I hope that this makes sense and I'm happy to clarify if it doesn't. Again, thanks for any help you can provide!
VBScript - Google for "VBscript search file contents" Results such as http://www.codeproject.com/Questions/524842/VbscriptplusToplussearchplusforplusaplusstringplus should help. Also if you're having trouble with the recursive folder search part http://blogs.technet.com/b/heyscriptingguy/archive/2004/10/20/how-can-i-get-a-list-of-all-the-files-in-a-folder-and-its-subfolders.aspx might help. VBScript is nearly identical to VBA. That code can probably be modified to run inside Excel as a macro if you'd like. I'd recommend using FileSystemObject and TextStreams instead of native VBA file operations if you might be dealing with unicode files.
0.777778
Google for "VBscript search file contents"
how to send a mail by telnetting through some SMTP server?
I wanted to send a mail by telnetting through smtp server "telnet smtp_Server 25" and want to send mail. How is it possible.. Also, please share something about CISCO products and what kind of software they use in their products. If i wanted to gain some insight knowledge, where should go to.. Thanks..
Your ISP usually provides you with one you can access, if not - at least they'll have a relay you can authenticate and send e-mail through from an smtp server you set up yourself.
1
ISP can authenticate and send e-mail via smtp server
How long before ASP.NET MVC becomes widely used in industry?
I am trying to decide whether to learn ASP.NET MVC (or to spend the time learning another technology that interests me). I know that it is an elegant framework, but I am trying to assess my future job opportunities if I invest in this skill. In your estimation, how long is it going to be before demand for ASP.NET MVC developers rivals that for developers in the other top web dev frameworks? Is it a matter of a year? 2 years? 3+? On a related note, do you see use of ASP.NET MVC surpassing classic ASP.NET in the foreseeable future? Scott Guthrie says the two will exist side by side, but I'm curious just how much of the mind share ASP.NET MVC is expected to grab. I know this is a speculative question; I'm just interested in your subjective hunches.
I think both options will be around for a long time. The current trend seems to be towards RESTful applications etc and I expect MVC to gain in popularlity. However some projects are more suited for the existing webforms style whilst others will greatly benefit from MVC. MVC is great and to learn the basics is not going to take long. Go through the tutorials on Scott Guthries blog (although some of the early stuff is out of date and syntax has changes) MVC does have some disadvantages: MVC does not use viewstate. This has positive (smaller pages, faster, cleaner model) and negative points. Although not impossible it is trickier to develop items such as controls that need to maintain state e.g. a paging datagrid etc Many companies already have an investment in existing webforms technologies
0.888889
MVC does not use viewstate
Conversant, CNAME, Cookies, and PCI complaince
We have been asked to evaluate Conversant Tracking. http://www.conversantmedia.com/solutions/enterprise-solutions From what I can tell its pretty straight forward tracking, like google re-marketing, you pass them the information you want to via some javascript, and they target your visitors with targeted ads you have set up. The main issue I have is they require us to point two cnames at their system to allow for "First Party Cookies". I know this means all cookies would have to be changed to www.foobar.com, instead of foobar.com, to avoid any issues with information being possible exposed to their end. But more I was wondering what type of attacks this could open us up to if they had a security issue, if this is more or less secure than google's re-marketings model, and what issues could this cause for us with PCI compliance? PS We use Braintree and Braintree.js so we are just covered under PCI for handling of Tokens, if that matters at all.
Cookies that are used to maintain session state must have a limited scope. Using JavaScript track users by their session id, means you can't use the httpOnly cookie flag. Scoping cookies to *.foobar.com means that XSS on *.foobar.com could compromise this cookie value. Or to put this another way, if a session id is scoped to *.foobar.com and doesn't have the httpOnly flag, then every domain on *.foobar.com is permitted to compromise a session using XSS. In the context of PCI compliance, this specific design would greatly expand the attack surface that needs to be regularly validated. One solution is to use another randomly generated token for the purposes of tracking users, and then protect the authenticated session id as a separate cookie value.
0.777778
Scoping cookies to *.foobar.com
Is "Pick up those blocks" grammatically incorrect?
I had someone correct me today as I instructed my child to "pick up those blocks." This person insisted that it should just be: Pick up those. since "those" is already plural. Is this person correct?
The English demonstratives—this, that, these, and those—can all be used as either adjectives (“Those blocks are square”) or pronouns (“Those are square”). Also, how would you distinguish “those blocks” from “those dolls” if you could only say “those”?
1
How would you distinguish “those blocks” from “Those dolls” if you couldn’t only say
Given Ohm's law, how can current increase if voltage increases, given fixed resistance?
According to Ohm's law, V=IR (voltage equals current times resistance). So if the voltage increases, then the current increases provided that the resistance remains constant. I know that Voltage or potential difference means work done per unit positive charge in bringing that charge from one point to another. So according to Ohm's law, if the work done per unit charge increases then current will increase. How can this be true? Point out my mistakes.
how can this be true? If we connect 1.5V cell to a 10 ohm resistor, the current is, by Ohm's law, 0.15A and the power delivered to the resistor by the cell is 0.225W. Now, connect a 9V battery in place of the 1.5V cell. The current is now, by Ohm's law, 0.9A and the power delivered to the resistor is now 8.1W. The 9V battery must deliver far more power to the resistor than the 1.5V cell does. There's nothing mysterious here. Why do you think the current should not increase if the voltage increases?
1
Why do you think the current should not increase if the voltage increases?
Is there added value in having your own presentation layout and using it consistently?
From the perspective of a Ph.D. student, how much of an added value is it to have your own presentation slides layout, that is used consistently throughout your Ph.D. conference presentations and other talks (and possibly throughout your academic career afterwards)? Here is one such example from the Computer Science community. This as as opposed to using existing Beamer templates with LaTeX, or built-in PowerPoint templates, or simply preparing each presentation on its own (without a specific layout). A couple of axes I can think along: Creating a signature layout that distinguishes one in their community Ease of preparation of presentations (especially over time), maybe overcoming constraints with existing templates. Note that I am not concerned with the question of content, but just design and layout.
Yes. If you're like me you'll never like everything about a standard layout, and you want your tools to disappear as quickly as possible when creating content. Noticing something in your slides that you want to change (bullet type, or title colour, or whatever) is the easiest way to get distracted from doing so. Having a standard layout for your own work means you have to spend the least amount of time worrying about the formatting.
0.888889
Noticing something in your slides that you want to change
Adding static route through group policy
We are trying to add a static route across all of our end user machines, we have setup a GPO object under Computer configuration > Policies > Windows Settings > Scripts (startup/shutdown) > Startup. The command in the batch file is: route add 172.17.10.0 mask 255.255.0.0 172.16.12.100 -p We have then rebooted/forced group policy to update and upon running a 'route print' in command line there is no route added, however adding a route through command line works perfectly.
According to some documentation I found, Routes added by using the -p option are stored in the registry under the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip \Parameters\PersistentRoutes Perhaps you could just use Group Policy Preferences to set the appropriate entries directly in the registry?
0.666667
Routes added by using the -p option are stored in the registry
What is Cold Iron actually?
It came up in Dresden Files, but is not limited to that game, you can find the term in DnD as well. I would like to know what it means. If you look for Cold Iron on Wikipedia, you only get iron: "Cold iron is a poetic and archaic term for iron." This would imply everything made mostly from Fe is cold iron. Clearly, this is not the case, in every game Cold Iron is something special, the every day sword is not made out of it. The Dresden Files rulebook is not very specific about it: something that anyone could reasonably get access to, but usually doesn’t carry on them (like cold iron) page 185. What is cold iron? How do I create cold iron? How do I get cold iron? To make the question easier to understand, compare Cold Iron to Holy Water. You know how it is different from usual Water, you know how you get it or create it.
“Cold iron” historically is just a poetic way of saying “iron.” Worked iron (including steel) is traditionally something that the fairy folk shy away from, and many fantasy works have embraced this—but each does it their own way. The Dresden Files universe is a very practical and down-to-earth place when it comes to magical reagents. In a world where magic is about faith and effort, where ritual is just a convenient way to focus one's will, you don't have to do anything in particular to make iron nasty for the fey. Iron and fairies just don't mix: pretty much any iron/steel will make the fey folk unhappy. (By contrast D&D 3.5 says cold iron is special stuff, defined both by where it’s mined and how it’s forged. We could speculate about whether that's more due to flavour or balance, but I digress.) The very presence of iron in any form is uncomfortable for Dresden Files fey, and bringing steel into a fey demesne is profane, but most people don’t casually carry enough iron to be a convenient weapon against the fey. Wounds inflicted on fairies by iron weapons—including nails, boxcutters, and steel-jacketed bullets—are slow to heal, and are spiritual as well as physical. You could also try hitting one with your car, or using a staple gun--neither of which are designed for precision violence. If this seems imbalanced, well. It is. DFRPG is more narratively balanced than it is mechanically. Since fey find iron so offensive, they go on the offensive when confronted with it. Possessing an iron weapon has major drawbacks in a fey-heavy campaign, because it makes you a target for suspicion and possibly pre-emptive elimination. But--remember that your average handgun bullets don't have steel jackets. …the fairies are very glad we’re using so much more plastic these days. (There is also a real-world forging technique called “cold forging.” It means the metal wasn’t heated as much as many techniques call for, and the resulting piece has different qualities of hardness than a hot-forged piece. This is irrelevant to DFRPG’s definition of cold iron, though other settings sometimes mean this when they talk about “cold iron.”)
1
The Dresden Files universe is a very practical and down-to-earth place when it comes to magic reagents
What is the difference between 'inclination' and its varieties; that is 'tendency - propensity - disposition - inclination - proclivity'?
As someone who is at (near-)native level of English, I know all of these words, but as I'm not immersed in an area where use of English is prevalent, (as of now I am living in the Netherlands,) I don't encounter these words often enough to start seeing obvious patterns between the differences, and the dictionaries I have used didn't help. I have some general ideas, although I have general ideas on the meaning of some of the words. Propensity seems to be a 'natural' inclination, i.e. "Man has the propensity to be selfish", and disposition seems to be related to opinions as in "He has a disposition to agree with those that are close to him." I don't have the faintest idea about the differences between the other three words that are left though. Could anyone care to explain this all to me?
To me they're all equally useful synonyms to a large degree. I would say that in a formality ranking from informal (i.e. speech with a friend) to formal (e.g. political obfuscation) they would go in this order: tendency > inclination > disposition > propensity > proclivity So, these would all be mostly equivalent phrases: J has a tendency to waffle (or J tends to waffle) J is inclined to waffle J is (frequently) disposed to waffling J has a propensity to waffle J has a proclivity to waffle Some further notes: I wouldn't use proclivity in speech, and rarely in writing, unless trying to be 'clever' for some particular reason, but that's just me. See George Orwell's essay 'Politics and the English Language' for more on this. Disposition is one of those words that has a lot of uses and meanings: and as such its use can obscure meaning. If you ever see it in business contracts or legal documents double-check exactly what is meant!
1
Disposition is one of those words that has lots of uses and meanings
Interaction of the Cold extraordinary ability and Grapples
According to the Cold[EX] ability of an Ice Golem An ice golem's body generates intense cold, dealing 1d6 points of damage with its touch. If a Golem were to initiate a grapple, would this ability trigger dealing damage to grappled target? If so, would this be on the Golem's turn, on the target's turn, or on both turns?
Rules as Written It may seem that way, but the ability further clarifies how it works: Cold (Ex) An ice golem's body generates intense cold, dealing 1d6 points of damage with its touch. Creatures attacking an ice golem with unarmed strikes or natural weapons take this same cold damage each time one of their attacks hits. So two things happen because of this ability: The golem slam attacks deal an additional 1d6 cold damage, that can be seen on his stat block: Melee 2 slams +9 (1d6+3 plus 1d6 cold) And the ability specifies that anyone attacking the golem with unarmed or natural attacks will take 1d6 cold damage. If it also worked against grapple attempts with barehands, it should specify so. If a simple touch would also cause that damage, the ability would make that clear, because it would also affect casters trying to deliver touch spells. As written, all rules must be clear how an ability should work or not, anything that isn't clear is left for each GM to decide, which brings us to... Rules as Intended Though the ability's wording is clear that simply touching it shouldnt cause the extra damage to you, that is clearly not how it is intended to work. But i simply believe nobody asked themselves What would happen if someone tried to grapple this guy? during the development process. A fine example of that are Fire Elementals and their Burn ability. What should happen when you hug a big ball of flames? You should hurt yourself in the process, and most likely catch on fire. Personally, this is how i would rule it on my table. If a Golem were to initiate a grapple, would this ability trigger dealing damage to grappled target? Now, if a fire elemental or ice golem initiated a grapple, RaW it wouldnt deal an extra damage, because you can attack the grappled target with a unarmed, natural weapon or light/1handed weapon, that should deal the ice damage. But RaI, it would be really nasty to get your arm/leg freeze while being punched in the face by ice blocks. Golems hardly would initiate a grapple due to their intelligence score, but i could see a fire elemental doing so to bring a burning death to their foes. If so, would this be on the Golem's turn, on the target's turn, or on both turns? On the golem's turn if he initiated the grapple, on the grappler's turn if the golem is grappled.
1
How can a Golem initiate a grapple?
100% Rye Pizza Base Recipes?
I'm looking for a 100% rye pizza base recipe. The recipes I can find all combine the rye with other flours (typically wheat based). I know it is possible to create 100% rye based pizza bases as I know of one pizza place in town that sells them. I understand that they had to do something special to keep the pizza base from falling apart. I don't mind experimenting a bit to find a recipe that works, but I could use some ideas on where to start - what sort of ingredients might bind the rye so that it doesn't crumble as a thin pizza base and maintains a low glycemic index for my diabetic wife. The only dietary requirements would be that the various ingredients maintain a low glycemic index or a specific ingredient with a high glycemic index can be counteracted by some other ingredient. And only using rye flour.
You need to work rye flour much longer than ordinary flour for the gluten to start binding the dough. I use a hand beater with dough hooks and start off with a very moist mix that includes olive oil and egg. Let it rise for a few hours then work more rye into the dough by hand kneading until it is nice and springy.
1
rye flour is a very moist mixture of olive oil and egg
Important non-technical course for programmers?
What kind of non-technical training course do you suggest for a programmer? Example could be public speaking course, presentation skill, English, business writing, or anything not related to programming or software engineering itself.
It dances on the line between technical and non-technical, but if your school offers something along the lines of Human-Computer Interaction (HCI) or anything else related to user interface design, jump on it. That's some valuable stuff right there.
1
Human-Computer Interaction (HCI) or anything related to user interface design
If Tumors have lots of mutations in them how is it the immune system can't detect them?
If a cancerous tumor has a lot of mutations in them why can't the immune system detect them? If a person has cancer could this somehow alter the person's immune system so it doesn't function effectively to detect greatly mutated cells? Does the fact that a tumor is 'made' of 'mutated' non-foreign human cells help it to be undetectable?
Great question and in part, you are correct. However, you must also remember that this greatly depends on what genes have undergone mutation. In the case of cancer, it's usually either a gene that regulates cell proliferation rates, induces programmed cell death or helps to repair damaged DNA. When one (or all) of these genes is mutated, the cell constantly proliferates and/or does not die when it is "programmed" to do so or cannot repair mutations to it's DNA, thus creating a cancerous tumor. Now, on to the immune system. The reason a persons immune system does not target and kill it's own cells is because of a certain set of genes that is specific to each and every person called Major Histocompatibility Complex (MHC). These genes encode specific cell surface molecules that the immune system cannot produce antibodies to bind to because they are "locked", if you will (see, the immune has a sort of built-in list of genes that code for antibodies that bind to different sequences of molecules (that's how you develop immunity and fight pathogens), the genes that code for the specific molecules that your cells have on their surface are just not on that list.) In order for a person's immune system to recognize cancerous cells as a pathogen and destroy them, the cancer cell's MHC genes would also need to be mutated drastically. For instance, breast cancer is usually caused by a mutation in the BRCA1 or BRCA2 genes. These genes assist in DNA repair. Even if this mutation happens, these cells still have the same MHC as the rest of the cells in your body because BRCA1 and BRCA2 don't really have much to do with MHC. Because of this, the immune system does not recognize the cancerous cells as a threat and is unable to destroy or even detect them. I hope this answers your question. CDB
1
a person's immune system does not recognize cancerous cells as a pathogen
UIView should catch tap event but pass on moving events
I have two views, one above another as a child. View1--->View2 (View1 has View2 as a child) How can I code this functionality? 1) if user TAPed on View2 - so the proper message tapped: sent to View2; 2) if user just moving finger over the View1(including View2) - events passed to View1 so it can handle touchesBegan: and so on. So what I am trying to code is make one function "[View2 tapped:...]" if touch was short, and another function([View1 touchesBegan:..] and so on) if touch is moving. In my case if I move finger over View2 - it never passes events to View1. P.s. I did not rewrite hitTest or anything.
You should look at UIGestureRecognizers. One of them is UITapGestureRecognizer - catches taps on targeted UIView. It's very simple to use. Look Apple documentation.
1
UIGestureRecognizer catches taps on targeted UIView
Rice gets burnt and watery
I am following the recipe of the rice I am making which is: Add 2 cups of water and heat Add 1 teaspoon of salt and 1 teaspoon of butter Add 1 cup of rice then wait for 18 to 20 minutes and it should be ready to serve. But the problems with this are: The rice is always watery It is flavorless Some rice gets burnt and makes it really hard to clean the pan
I have a bullet proof method which many chefs may not like. 1 cup rice to 2 cups water. In a bowl with no lid and microwave for 12 - 15 min until no liquid is left. Leave to stand and fluff with a fork.
0.888889
1 cup rice to 2 cups water
Detect user device and assign different jquery (desktop / mobile(ipad)) in js/ jquery?
<script src="jsv3/jquery.js"></script> <!--<script src="jsv3/jquery.mobile-1.2.0.min.js"></script>--> Currently I have insert script for desktop version only because I found that declare two jquery will occur error. Are there any way to check the device type and select different jquery plugin for corresponding device? Thanks
if (navigator.userAgent=="<type>"){ //check your device type var fileref=document.createElement('script') fileref.setAttribute("type","text/javascript") fileref.setAttribute("src", filename) } HTH
0.888889
//check device type var fileref=document.createElement('script')
Why Ionic compounds dissolve into water
First, I would like to say that I understand the basic idea of disassociation and solubility. However, as I study intermolecular forces I feel like this basic Idea is being challenged. My understanding from basic chemistry is that ionic bonds are much stronger than covalent bonds, due to the actual exchange of electrons and the formation of cations and anions, causing an attractive force between the opposite charges to "hold" the compound together. When explaining solubility with IMF theory, however, I fail to understand how the IM forces present in water--dipole-dipole, H-bonds, and dispersion--are able to overcome that attraction between the cation and anion present in the ionic bond; because, I was under the impression that actual bonds are always stronger than IMF bonds. So, for instance, does it not infer that if, say, Sodium Chloride is placed into water, and the attraction of the h-bonds in water cause the NaCl to essentially break apart into ions, that the inherent attractions between cations and anions in an ionic compound are weaker than the attraction force of the h-bond water molecule?
It's not that ionic bonds are weaker than hydrogen bonds, but that the energy cost of breaking the ionic bonds is well compensated by the gain in solvation energy when you put NaCl in solution. Solvation energy drives the spontaneity of this dissolution process, because of entropic considerations.
1
ionic bonds are weaker than hydrogen bonds, but the energy cost of breaking them is well compensated by the gain in solvation
How to retrieve datetime from database in Drupal?
How do I retrieve a DateTime column from my MySQL database using Drupal Database API + PHP. The DateTime format is in YYYY-MM-DD HH:MM:SS(2013-02-20 23:59:59). I want to retrieve all the rows in the database that match a specific date, and then store the hour inside an array. For example, I want to grab all the data from January 1, 2013. I then only want to store hours 00:00 to 23:59 inside my array, not the entire date. I do not want to use any modules to accomplish this.. because I need to code it inside my custom module. Thanks for your help! Current Code: $query = db_select('Project', 'p'); $query->fields('p', array('submissions', 'date_time')); $query->condition('p.user_id', $user->uid); $results = $query->execute()->fetchAll(); foreach($results as $r) { $rows[] = array(strtotime(date("H:i:s", $r->date_time))*1000, $r->submissions); } I plan to display the data on my Flot line graph.
The code below works for me for fetching a group, so you can quickly adapt it for your own purpose. $query = db_select('og') ->fields('og', array('etid')) ->condition('gid', $gid,'='); $results = $query->execute(); $result = $results->fetchAssoc();
0.888889
db_select ->fields('og', array('etid'
How do I add userpoints directly to the database?
How can I add points directly to the User Points database? I have a quiz site and would like to use the User Points module to store quiz scores, instead of creating something from scratch. I have created a taxonomy "Quiz" for such points. Every quiz ends by showing the score made (between 0 to 100 depending on how many answers they got right). I would like to go on and store this in the userpoint database. I am using the following code but m getting 2 error messages: Notice: Undefined variable: user in ... Notice: Trying to get property of non-object in .... The code I am using is the following one: $params = array ( 'uid' => $user->uid, 'description' => 'Totals points from quizes', 'points' => $percentage, 'tid' =>127, ); userpoints_userpointsapi($params);
Userpoints has an API. See especially userpoints_userpointsapi() Something like this: userpoints_userpointsapi(array('uid'=>$some_user, 'points'=>9000)); You might also be interested in the Quiz module which supports Userpoints.
0.888889
Userpoints has an API
Sharing JavaScript model code between server and client, is this approach valid?
I'm beginning learning Node.js and Backbone. I'd like to share some code between the server and the client (related to [1] and [2]). More in deep: Share defaults values for a model. Defaults are used to populate forms (client-side), while they are enforced server-side Share validation rules in order to be DRY and perform client/server validation Share instance methods So my idea is to use a factory object to encapsulate common code (defaults, validation rules, public instance methods) and adapt the factory object based on the environment (Node.js or AMD module). This code is quick&dirty and may not work. Is this a good approach or just a waste of time? (function (factory) { if (typeof exports === 'object') { // Node.js var config = require('../config/config.json'), Sequelize = require('sequelize'), _ = require('underscore'); var User = { receiveSms: { type: Sequelize.BOOLEAN, allowNull: false }, receiveNewsletter: { type: Sequelize.BOOLEAN, allowNull: false } }; // Add defaultValue for each returned by _.each(factory.defaults, function (value, key) { if(_.has(User, key)) { User[key].defaultValue = value; } }); module.exports = function () { (new Sequelize(config.database, config.username, config.password)) .define('User', User); }; } else if (typeof define === 'function' && define.amd) { // AMD define(['backbone', 'uderscore'], function (Backbone, _) { return Backbone.Model.extend(factory); }); } }(function () { return { // To be adapted defaults: { receiveSms: false, receiveNewsletter: true } } }));
Personally, I would steer away from requirejs as it requires you to rewrite your modules to fit their spec, which will eventually become defunct as the Ecmascript standard evolves. For the time being, I would advise looking into the 'gulp' streaming build system. Using it, you'll find it extremely easy to pipe your shared js scripts into a publicly accessible directory, which can then be loaded from the client-side. A common technique for converting node js modules into browser scripts is using 'browserify' - magic! Process: gulp.src > gulp-browserify > gulp.dest > ??? > Profit. Further reading: http://viget.com/extend/gulp-browserify-starter-faq
1
'gulp' streaming build system for node js scripts
abelian higgs vortices
Dear fellow mathematicians, during some gauge-theoretic explorations I've stumble upon a recent paper by Nick Manton on Abelian higgs vortices where he studies Abelian higgs "vortices" on hyperbolic surfaces. Does anyone have any historical knowledge of whether the word vortex in this context have any connection with point vortices from fluid dynamics?
I expect that this terminology came from an analogy of an analogy. Quoting from Quantum Field Theory of Anyons, by Fröhlich and Marchetti (1988), "Particles with real spin and intermediate statistics have been called 'anyons' by Wilczek [1]. He suggested that electrically charged magnetic vortices, occuring in certain Higgs models, may be examples of such particles." So certain types of anyons can reasonably be, and have been, called vortices. I looked at the Manton paper, but didn't understand it at all; however, my guess is that the things Manton is calling vortices are related to the electrically charged magnetic vortices mentioned above (and if you consider these just mathematically and not physically, there is no apparent reason that they should be called vortices). I would welcome corrections from anyone with better knowledge of the historical record (my answer came from knowing about the anyonic vortex terminology and Google).
0.333333
Quantum Field Theory of Anyons, by Fröhlich and Marchetti (1988)
Access control Service and Azure Websites Could not load System.IdentityModel.Services
I've created an ASP.NET MVC 4 app using visual studio 2012 RC on Windows 8 release preview. I downloaded and installed the WIF toolkit and used the "Identity and Access" option in the solution menu to add my Access Control Service metadata endpoint. Tested locally and all is well. When I deployed to my free azure website however I get the yellow screen saying "Could not load file or assembly 'System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified." These assemblies aren't referenced in the project, so I added them, sent to output to the bin folder and redeployed. I then got a message about the assembly probably being tampered with. Does anyone know how to overcome this? EDIT Adding local causes this error Could not load file or assembly 'System.IdentityModel.Services' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) In the web config the module is deinfed as <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules> <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" /> <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" /> </modules> </system.webServer> Thanks
I think this is a known issue in Azure, you'll need to use a start-up script that runs gacutil.exe to register the IdentityModel.dll. Follow the steps here: http://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/ Edit: My bad, I thought you were talking about a Web Role. As astaykov said, you can't have start-up tasks in Web Sites. Well maybe this'll help somebody else out :-)
0.777778
Start-up script in Azure
Correlating /var/log/* timestamps
/var/log/messages, /var/log/syslog, and some other log files use a timestamp which contains an absolute time, like Jan 13 14:13:10. /var/log/Xorg.0.log and /var/log/dmesg, as well as the output of $ dmesg, use a format that looks like [50595.991610] malkovich: malkovich malkovich malkovich malkovich I'm guessing/gathering that the numbers represent seconds and microseconds since startup. However, my attempt to correlate these two sets of timestamps (using the output from uptime) gave a discrepancy of about 5000 seconds. This is roughly the amount of time my computer was suspended for. Is there a convenient way to map the numeric timestamps used by dmesg and Xorg into absolute timestamps? update As a preliminary step towards getting this figured out, and also to hopefully make my question a bit more clear, I've written a Python script to parse /var/log/syslog and output the time skew. On my machine, running ubuntu 10.10, that file contains numerous kernel-originated lines which are stamped both with the dmesg timestamp and the syslog timestamp. The script outputs a line for each line in that file which contains a kernel timestamp. Usage: python syslogdriver.py /var/log/syslog | column -nts $'\t' Expurgated output (see below for column definitions): abs abs_since_boot rel_time rel_offset message Jan 13 07:49:15 32842.1276569 32842.301498 0 malkovich malkovich ... rel_offset is 0 for all intervening lines ... Jan 13 09:55:14 40401.1276569 40401.306386 0 PM: Syncing filesystems ... done. Jan 13 09:55:14 40401.1276569 40401.347469 0 PM: Preparing system for mem sleep Jan 13 11:23:21 45688.1276569 40402.128198 -5280 Skipping EDID probe due to cached edid Jan 13 11:23:21 45688.1276569 40402.729152 -5280 Freezing user space processes ... (elapsed 0.03 seconds) done. Jan 13 11:23:21 45688.1276569 40402.760110 -5280 Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done. Jan 13 11:23:21 45688.1276569 40402.776102 -5280 PM: Entering mem sleep ... rel_offset is -5280 for all remaining lines ... Jan 13 11:23:21 45688.1276569 40403.149074 -5280 ACPI: Preparing to enter system sleep state S3 Jan 13 11:23:21 45688.1276569 40403.149477 -5280 PM: Saving platform NVS memory Jan 13 11:23:21 45688.1276569 40403.149495 -5280 Disabling non-boot CPUs ... Jan 13 11:23:21 45688.1276569 40403.149495 -5280 Back to C! Jan 13 11:23:21 45688.1276569 40403.149495 -5280 PM: Restoring platform NVS memory Jan 13 11:23:21 45688.1276569 40403.151034 -5280 ACPI: Waking up from system sleep state S3 ... The final lines are from a bit further down, still well above the end of the output. Some of them presumably got written to dmesg's circular buffer before the suspend happened, and were only propagated to syslog afterwards. This explains why all of them have the same syslog timestamp. Column definitions: abs is the time logged by syslog. abs_since_boot is that same time in seconds since system startup, based on the contents of /proc/uptime and the value of time.time(). rel_time is the kernel timestamp. rel_offset is the difference between abs_since_boot and rel_time. I'm rounding this to the tens of seconds so as to avoid one-off errors due to the absolute (i.e. syslog-generated) timestamps only having seconds precision. That's actually not the right way to do it, since it really (I think..) just results in a smaller chance of having an off-by-10 error. If somebody has a better idea, please let me know. I also have some questions about syslog's date format; in particular, I'm wondering if a year ever shows up in it. I'm guessing no, and in any case could most likely help myself to that information in TFM, but if somebody happens to know it would be useful. ..Assuming, of course, that someone uses this script at some point in the future, instead of just busting out a couple of lines of Perl code. Next: So unless some welcome revelation is unto me given by one of You, my next step will be to add a function to get the time skew for a given kernel timestamp. I should be able to feed the script one or a set of syslogs, along with a kernel timestamp, to get an absolute timestamp. Then I can get back to debugging my Xorg issues, which escape me at the moment.
Since you noted the time skew changing during suspend/resume, I'll note this is documented in at least one place. The dmesg(1) man page says: The time source used for the logs is not updated after system SUSPEND/RESUME. I couldn't find a way to make the kernel keep these timestamps in sync with wall time.
1
Time skew changing during suspend/resume
drive 3 phase induction motor with only DC (not pwm) thru each phase
I've been researching making a driver for a 3 phase induction motor powered by DC source using PWM to approximate sine waves in each phase. However, the switching speeds of the PWM signal for the rotational speed I want is difficult to obtain with hobby microcontroller boards like the arduino. Can I just switch the DC directly thru each phase at the correct time only twice per cycle ? Essentially I would be approximating a sine wave with only 2 different voltages thru the coils, ie: +V and -V (using H bridge circuitry here) Will this create enough of a rotating magnetic field that sufficient current is induced in the rotor cage ? What will be the losses in power / efficiency for this, or any other drawbacks for this system ? The bonus is greatly simplified drive electronics.
You may be considering a simple 3phase AC inverter design or a powerful high torque variable frequency drive (VFD) electronics. Your choice depends on detailed specs including torque vs speed and budget. In both cases, a square wave would not be desireable as the eddy current losses would be excessive so multi-level low impedance drive is needed to appropximate the sine wave.
1
Multi-level low impedance drive is needed to appropximate sine wave
can i make an outlined path thicker in illustrator?
i have downloaded some svg icons form the web which are all outlined paths. In illustrator i would like to make those paths thicker. Is there a way to do this? I know when a line is still in stroke-mode you can just adjust the size of the stroke, but once this has been converted to outlines i don't know if this is still possible? thx
Since the outlined art consists simply of filled objects, the intuitive solution would be to add an exterior stroke of the weight of half the amount you wanted to increase the initial stroke. For example, if the outlined stroke was 1pt, and you want to change it to a 2pt line, you would add a 0.5pt exterior stroke to the outline. However, some caveats I can think of off the top of my head: Adding strokes to unjoined outlines will add weight to the ends, while with path stroke behaviour, the stroke is capped at the endpoints by default It's a lot harder to reduce the weight of the stroke after it's outlined. Luckily, you want only to thicken it, so you don't really have to worry about this. There's probably others — working with outlines when you want paths is never ideal. Nonetheless, the short answer is yes, it is entirely possible. You just have to be a little craftier.
1
Adding an exterior stroke of the weight of half the amount you wanted to increase the initial stroke
How does Charlie deduce Myra is Mrs Kieslowski?
In Seven Psychopaths Charlie (Woody Harrelson) comes to the hospital to find Mrs Kieslowski. He finds a patient- who we know is Myra Kieslowski- but wrongly assumes that because she is black it cannot be her. He then tells her how he is looking for Mrs Kieslowski because her husband has stolen his dog. In the course of the subsequent conversation, he comes to realise that she is the woman he's looking for. But I can't understand how. Here's the discussion between Charlie and Moyra. Myra: I'm sure Mr. Kieslowski will take good care of your dog and get it back to you safe. He always seems like a sweet man when he comes in. Charlie: He come visit her a lot? Myra: Every day- Charlie: What kind of times every day? Myra: Different times, you know. And not every day. He misses a day now and then. Charlie: Oh. yeah? He been in today? Myra: Yeah. He came in earlier this morning, about 10:00 or so. Charlie: So the Polack married a n*gger, huh? How did Charlie deduce this, from the conversation? Was it just the fact that Myra seemed too eager to convince him that Charlie had already missed Mr Kieslowski's visit and was wasting his time waiting? In which case, why did she say he visited every day?
The dialogue you cite actually comes after Myra sees Hans through her window and after she already talked a little bit with Charlie about Mrs Kieslowski. She was quite sure she could drag the whole situation out a bit, just playing her roommate and waiting what happens. But once she saw Hans walking to the hospital to visit her, she became increasingly nervous, knowing that Charlie was looking for him and the time ran short. And nervous as she got, she suddenly brought the conversation to Mr. Kieslowski herself, which is where your quoted dialogue starts. And I think this is exactly the point where Charlie at least starts to get suspicious about her. I think this can be perceived in his behaviour, since after she said that, he suddenly starts to stop his little playing around with the wheelchair he sits in and turns around to look straight at her, getting nearer and nearer to her. And at this point he starts to interrogate her a bit more about Mr Kieslowski and his visiting times. Maybe he already guessed it at this point or he just had a suspicion. But it surely didn't help Myra that she got increasingly nervous and started beating around the bush with stuff like "Different times, you know, not every day" (after previously saying a pretty definite "Every day"). So to sum up, I would say at the point Myra brought the conversation to Mr Kieslowki (so at the start of your quoted dialogue section) Charlie definitely got suspicous about her and his supicion was manifested by her nervous behaviour during the further conversation. Maybe he even wasn't 100% sure before his "n--ger" comment. But he was at least sufficiently sure enough and Myra certainly didn't deny it.
0.888889
Myra brought the conversation to Mr. Kieslowski and his visiting times .
BJT switch connections
If an NPN BJT is being used as a switch, why is the load usually connected between +Vcc and collector? How is the performance affected if the load is connected between emitter and ground?
I think you will see the problem yourself if you remember that for an NPN transistor to pass large currents from the collector to the emitter you must cause current to flow into the base terminal. Because there is a PN junction between the base and the emitter, it is therefore necessary to raise the voltage of the base terminal about 0.6V above the voltage of the emitter terminal. Don't make the mistake of thinking that you just need to bring the base to a voltage about 0.6V above ground. That's a common misconception because you usually see the NPN transistor used with its emitter tied to ground. You can also think of this from the emitter's point of view. If the voltage at the emitter starts to rise for some reason then the transistor will stop conducting current once the emitter voltage rises to about 0.6V below the base voltage. So, the emitter voltage can't ever be higher than the base voltage when the transistor is conducting. Now, think about the voltage you are using to turn the transistor on and off. The emitter voltage must always be lower than that voltage.
0.666667
If a NPN transistor passes large currents from the collector to the emitter, it is necessary to raise the voltage of the base terminal
What's the difference in meaning between "emigrate" and "immigrate"?
What's the difference between emigrate and immigrate? They seem to have the same definitions in the dictionary but they are antonyms...  
The "e" in emigrate is short for "ex", which means "out". You see it in words like exit (to leave), expire (out of breath >> out of time >> death), exterminate (to drive out). The "im" in immigrate is a variant of "in", which means in. You see it in words like internal (inside), insinuate (to curve in), input (that which is put in). This "in" should not be confused with the other "in" which means "not", used in such words as indiscriminate, incapable, and insatiable. So, to emigrate means to exit a location. To immigrate means to come into a location.
1
"e" in emigrate is short for "ex", which means "out"
ASP.NET Entity Framework Filter results by currrent user
I am using Visual Studio Express 2013 and am creating simple CRUD pages using the Enitity Framework 6 I have also implemented the social login so I am logged in via google plus My problem is that I want to filter the results of a table to only show the results of the logged user. I can identify the logged user by calling this in the controller ViewBag.CurrentTestUserId = User.Identity.GetUserId(); and I can call this on my view page but I am struggling to filter the dataset below to show only the data for the logged in user // GET: /Test/ public ActionResult Index() { var tests = db.Tests.Include(t => t.AspNetUser); return View(tests.ToList());
you can apply the where clause filter on the linq query to tests. use the right column names for AspNetUser table etc. // GET: /Test/ public ActionResult Index() { var userId = User.Identity.GetUserId(); var tests = db.Tests.Where(t=>t.AspNetUser.UserId == userId); return View(tests.ToList()); }
0.777778
where clause filter on linq query
Modal Popup not Closing if multiple Modals are present
I have three different controllers and views From Screen when button is clicked Modal1 opens $modal.open({ templateUrl: 'abc.html', controller: 'abcCtrl', size: 'lg', scope: $scope, }); In modal1 there is next button so on Click of Next Button Want to close Modal1 and open Modal2 $scope.validate = function(isValid) { if (!isValid) { $scope.errors = 'Please fill-up required fields'; } else { $scope.errors = ''; $modal.open({ templateUrl: 'Payment.html', controller: 'PaymentCtrl', size: 'lg', scope: $scope, }); } }; In modal2 there is next button so on Click of Next Button Want to close Modal2 and open Modal3 $scope.placeOrder = function() { $scope.cart.abc().then(function(result) { $modal.open({ templateUrl: 'orderSummary.html', controller: 'SummaryCtrl', size: 'lg', scope: $scope, resolve: { items: function() { return result.data; } } }); }, function(err) { //error msg }); }; If I add $modalInstance.close to Modal1 while Opening another modal that is Modal2, Modal1 is Closed and Modal2 is Opened But none of the buttons work. Modal3 doesnt get opened Don't Know the actual issue what is happening. Please help me. Thanks in advance.
From Main Controller First Open Your Modal1,on Close of Modal1 i.e var modalInstance = $modal.open({ templateUrl: 'abc', controller: 'abcCtrl', size: 'lg', scope: $scope, }); modalInstance.result.then(function(result) { $scope.def(); }, function(err) { // }); $scope.def = function(){ //open another } call another function and in that function open another modal and similarly you can do.
0.888889
Open Modal1 on Close of Modal
Flushing coolant after driving only with water in
If I drive my truck for 30 min with just water in my system, would it be equivalent to just flushing it stationary (the proper way to flush it)? IOW, if I just drive around with a clean water refill in the coolant system instead of keeping the truck in place and then draining, would it be an okay way to flush?
It would make no difference if you are standing still or driving the vehicle. You want to ensure you have the heater wide open when you do it to ensure you are getting the old fluid from the heater core as well as the engine. Driving the vehicle around will probably allow the process to happen a little faster, as you engine will get up to operating temperature faster. The real thing you are trying to accomplish is to get the thermostat open to allow everything to circulate.
0.888889
Getting the heater wide open to allow everything to circulate
Should we allow or avoid non-standard pronouns?
This question brings up an important question: Do we want to allow or avoid the use of non-standard English such as the words zie and zir as non gender specific pronouns on this site?
No. English has a singular they and it's fine for situations where the gender of a person is unknown. It has a long history of usage, and is very logical compared to you that is also available for both singular and plural usage. Singular they is a standard way to refer to someone in a gender-neutral way.
0.888889
No. English has a singular they