Posts

install - Installing scipy for python 2.7 -

i cannot seem scipy working python 2.7 on 32 bit windows xp platform. i'd rather not build own copy. know find installer it? tried site , didn't work. download here . i'm not sure site referred to, start at: http://www.scipy.org

jQuery scrollLeft -

i looking @ tutorial @ http://jqueryfordesigners.com/jquery-infinite-carousel/ . tried creating similar myself understanding, turned out more complex thought. how use scrollleft? i created simple fiddle test http://jsfiddle.net/sryku/2/ <div id="carousel"> <div class="wrapper"> <ul> <li><a href="#">test link 1</a></li> <li><a href="#">test link 2</a></li> ... css #carousel .wrapper { position: relative; ul { position: absolute; js $wrapper.scrollleft(itemsperpage * itemwidth); but not scrolling you have use animate method that: $wrapper.animate({scrollleft: itemsperpage * itemwidth});

Link to sort table column in PHP MYSQL -

<?php $con = mysql_connect ("localhost", "user", "pass") or die ('error: ' . mysql_error()); mysql_select_db ("members"); if(isset($_get['orderby'])){ $order = $_get['orderby']; $result = "select * persons order ".mysql_real_escape_string($order)." desc"; } else{ $result = mysql_query("select * persons"); } $num_rows = mysql_num_rows($result); $row_counter = 0; echo "<table width=600 border=0 cellspacing=0>\n"; echo "<tr>\n <th>&nbsp;</th>\n <th>first name</th>\n <th>last name</th>\n <th>email address</th>\n <th>city</th>\n <th>state</th>\n <th><a href='index.php?orderby=submitdate'>date</a></th>\n </tr>"; while($row = mysql_fetch_array($result)){ if($row_counter % 2){ $row_color...

xaml - WPF - Defining DataTemplate inside ResourceDictionary without a key -

Image
i have seen many times wpf code samples in form: <window.resources> <datatemplate datatype="{x:type sometype}"> <!-- elements defining datatemplate--> </datatemplate> </window.resources> i understand usage, cant understand why syntax ok: since resourcedictionary implements idictionary, therefore every element add resource property must specify key. know using dictionarykeypropertyattribute, class can provide implicit key value - in case of datatemplate class, provided property "datatemplatekey". know sounds bit petty, motivation question know how use other classes if didnt have privilege see usage samples before (maybe 3rd party...). anyone? as mentioned in question, entries without x:key attribute use datatemplatekey(sometype) key. can specify 1 such instance particular sometype in resources. datatemplatekey derived templatekey derived resourcekey . of course such datatemplate resource definitions c...

eclipse - Checking out a maven project from a git repository -

i have installed m2eclipse , egit, can checkout project git repository , can build maven project, cannot checkout maven project git repository. problem is, scm url field empty (apart egit have svn team providers well...) , when paste url scm provider not available in maven console. tried searching issue , found have install m2eclipse scm integration , scm handler git, aren't on update sites. ideas? maven scm integration in eclipse used good. used import > check out maven projects scm , put in url scm:git:ssh://git@git:project.git in helios or new version of m2eclipse + extras can't anymore. gives error original post talking about. disappointing have check out in egit , add dependency management. isn't great solution because isn't smooth parent / children poms.

In Django using fiter() then get() on queryset? -

can combine use of filter() , get() on querysets return object in django view? have following view; def my_view(request, city, store, item): item = item.objects.filter(store__city=city, city=city).get(item=item) items unique city , store. trying filter queryset based on 2 foreignkey fields , use on charfield getting error message object not exist. approaching incorrectly or syntax off somewhere? thanks if related filter returns 1 result, can use : def my_view(request, city, store, item): item = item.objects.filter(store__city=city, city=city)[0] which filters item records , store them in queryset, has list-lilke structure, take first element... if sure result, can use instead of filter: item = item.objects.get(store__city=city, city=city) but if there exists no record fits filer criteria, error. if not sure whether filtering return result or not, use: item = item.objects.filter(store__city=city, city=city) if item: item = item[0] which ckecks resu...

java - How to prevent the result of Servlets from being cached? -

how can stop caching of pages in browser using servlets? i want session should expire if press button of browser when logged in. to permanently disable cache. // set expire far in past. response.setheader("expires", "sat, 6 may 1995 12:00:00 gmt"); // set standard http/1.1 no-cache headers. response.setheader("cache-control", "no-store, no-cache, must-revalidate"); // set ie extended http/1.1 no-cache headers (use addheader). response.addheader("cache-control", "post-check=0, pre-check=0"); // set standard http/1.0 no-cache header. response.setheader("pragma", "no-cache"); clearing client cache not expire session immediately,but clears session cookies in browser. make session expire immediately, need explicitly specify in server side jsp or servlet. // use session invalidate session.invalidate();