Posts

Showing posts from May, 2014

Type Signatures in Haskell -

Type Signatures in Haskell - my question regarding type signatures. the next code complies: data vector = vector a deriving (show) vmult :: (num a) => vector -> -> vector (vector j k) `vmult` m = vector (i*m) (j*m) (k*m) however, not understand why substituting above type signature (on line number 2) next does not work: vmult :: (num a) => vector -> num -> vector my understanding since m of type num (eg. number 8 ), , since i, j, k num well, there should no problems computing vector (i*m) (j*m) (k*m) . kindly right understanding. num a isn't type @ all num type class, if num a means a number type, then vmult :: (num a) => vector -> -> vector means "as long a number type, vmult takes vector of a s , single a , returns vector of a s." that means vmult can work like vmult :: vector int -> int -> vector int or vmult :: vector double -> double -> vector double . notice each type rep

android - Restart app properly -

android - Restart app properly - i utilize code restart app. intent i=getbasecontext().getpackagemanager().getlaunchintentforpackage(getbasecontext().getpackagename()); i.addflags(intent.flag_activity_clear_top | intent.flag_activity_new_task); startactivity(i); it restart app, jumps first launch activity. goes fragment intent executed when press back. then added nullify backstack: fm.popbackstack(null, fragmentmanager.pop_back_stack_inclusive); then when press button goes activity holding fragment earlier. question: should override onbackpressed on first launch activity or there improve way? screen - splash screen b - first launched screen screen c - main here happens when restart (from main) without finish: c -> b -> -> *back pressed -> c so added finish, here happens: c -> b -> *closes, not crash but found answer. if want activity stack home screen , if user presses back button exit application add together these 2 fl

r - Rstudio knit to PDF -

r - Rstudio knit to PDF - the new version of rstudio (0.98.932) has many new options including knit pdf. article describing new version has comment dave says: ...after installing rstudio 0.98.932 don’t little dropdown menu knit-pdf or word when editing .rmd file. i'm having same issue. helpful response posted: it might either: a) not running r 3.0 (which required rmarkdown v2); or b) have custom markdown renderer defined (markdowntohtml option). can check executing: getoption(“rstudio.markdowntohtml”) that solved dave's problem (b), when run command null > getoption("rstudio.markdowntohtml") null which assume means don't have custom markdown renderer defined. (previously did in cusomized .rprofile , removed that.) r version 3.1.0. am misunderstanding getoption command? else tripping rstudio? i have installed new version of rstudio (0.98.932), prompted me upgrade couple of packages (i can't remember

read in from read only xlsm file using java apache poi -

read in from read only xlsm file using java apache poi - i'm trying read info read xlsm using java apache poi, when utilize xssf workbook doesn't seem able access file , hssf workbooks work xls files. code looks this: try { fileinputstream file = new fileinputstream(new file("file.xlsm")); system.out.println("found file"); xssfworkbook workbook = new xssfworkbook(file); system.out.println("in workbook"); xssfsheet sheet = workbook.getsheet("shipments"); system.out.println("got sheet"); the code never reaches "in workbook" print line , i'm not sure why. please help! i copied code , gave file proper path , worked. my version: fileinputstream file = new fileinputstream(new file("c:\\users\\user\\desktop\\filet.xlsm")); system.out.println("found file"); xssfworkb

Is there a way to bind a Dictionary in mvvmcross -

Is there a way to bind a Dictionary in mvvmcross - i started using observable concurrentdictionary because it's threadsafe. face problem how bind list. local:mvxbind="itemssource sourcedictionary" obviously cannot work because item consists of keyvaluepair , not object itself. local:mvxbind="itemssource sourcedictionary.values" does not work. which, must admit, puzzles me. tried long shot , did converter : public class sourcedictionaryvalueconverter : mvxvalueconverter<keyvaluepair<string, sourceclass >, sourceclass > { protected override sourceclass convert(keyvaluepair<string, sourceclass> value, type targettype, object parameter, cultureinfo culture) { homecoming value.value; } } and bind local:mvxbind="itemssource sourcedictionary, converter=sourcedictionary" but didn't work. suppose asks ilist. there way bind listview dictionary? you should able bind dictionary - or i

Since/Until date on javascript -

Since/Until date on javascript - i want method since/until worried there're error when month has changed. don't want calculate when time left or passed. my code: var graduatedday = new date(); var day = graduatedday.getdate(); var month = graduatedday.getmonth() + 1; //(i plus 1 because month value 0-11) var year = graduatedday.getfullyear(); if ((day >= 15 && month >= 3) || (month > 4) && year >= 2015) { document.write("since today have graduated"); } else { document.write("you aren't graduated yet"); } i don't sure above code given have concept that why not compare date object? var graduatedday = new date(); var x = new date('2013-03-15'); if (graduatedday > x) {document.write("since today have graduated")} else {document.write("you aren't graduated yet")} i believe error might having in original code wrong ( if( day>=15 && month>

php - Gettext tool to use the translation in one language as the key for translation in another language -

php - Gettext tool to use the translation in one language as the key for translation in another language - is there tool i'm suggesting in question title? consider next scenario, msgid "%s minutes left" , msgstr in english language is, well, same, , msgstr in language "bla %s bla" . in marketing decides in english language string should "%s minutes left, hurry up!" . do? on 1 hand, can alter msgid . on plus side, becomes evident translation in language needs updated; string alter requires developer update source file, doesn't sound utilize of developer's time when there many features implement , time scarce. on other hand, translator update msgstr in english, match marketing person's request, how notify translators have update translation? also, see msgid , hasn't changed. how tell them actual string is? thanks can help. this mutual situation , – for improve or worse - pretty much built gettext's int

c# - ASP.NET MVC4 - Multiple add in multiple textboxes -

c# - ASP.NET MVC4 - Multiple add in multiple textboxes - i'm working asp.net mvc4. want offer possibility add together multiples records (from 1 3 maximum) displaying view multiple textboxes represents same things. for instance, in view, have : start hr (1) : |textboxforhours| h |textboxforminutes| start hr (2) : |textboxforhours| h |textboxforminutes| start hr (3) : |textboxforhours| h |textboxforminutes| in controller, i'll check how many textboxes have been filled , save in db. here's viewmodel i've created : public class deniedintervalsviewmodel { public int starthour { get; set; } public int startminute { get; set; } } any thought that? you can utilize input naming convention array, list, collection or dictionary this [updates] oneway inputs: @for (int = 0; < model.count; i++) { <div> <label>start hr :</label> <input type="text" name="interva

objective c - How to create Time Zone selection like Settings app in iOS -

objective c - How to create Time Zone selection like Settings app in iOS - i trying accomplish selection table view 1 in settings app selecting time zone in ios app, time zones displayed nicely formatted city , country name. from documentation, + (nsarray *)knowntimezonenames method returns "id"s of time zones, in alphabetical order not in "time" order, , names quite ugly read such america/new_york . other methods in nstimezone homecoming localized names such “central standard time” central time. names means nil of users, used reason in terms of "cities" instead in terms of "time zones" (especially in europe). is there way accomplish same representation 1 in settings app using nstimezone own methods, or should build database of time zones , cities myself? ios objective-c timezone

python - Django AdminEmailHandler causing wsgi to hang -

python - Django AdminEmailHandler causing wsgi to hang - i'm building webapp using django 1.7 on python 2.7, deployed in production apache , mod_wsgi in daemon mode. i'm having problem wsgi hangs whenever have exception logged (with python logging) , adminemailhandler configured in settings.py. when request page browser hangs until apache log shows "end of script output before headers: wsgi.py" i have 2 logging handlers configured, filehandler , adminemailhandler, , when comment out adminemailhandler problem doesn't occur. 'handlers': { 'file': { 'level': 'info', 'class': 'logging.filehandler', 'filename': '/var/log/apache2/mylog', 'formatter':'simple', }, 'email': { 'level': 'error', 'class': 'django.utils.log.adminemailhandler', 'formatter':'simple',

C# Bool Variable always false -

C# Bool Variable always false - i comparing 2 strings: bool d = (string.equals(ethernetheader.source,staticform.textbox1.text.tostring())); this statement false in console both same below.. ethernetheader.source=00:25:64:4f:21:d9 textbox1.text=00:25:64:4f:21:d9 any possible reason?? thanks, use trim in order have no spaces on lead or end of string. boolean d = ethernetheader.source.trim() == staticform.textbox1.text.trim(); c# variables boolean

php - Error while implementing currency converter of yahoo -

php - Error while implementing currency converter of yahoo - <?php error_reporting(0); $currency_code = $_get['currency_code']; $currency_opt = strtoupper($currency_code)."inr"; $jsn_response = file_get_contents('http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22' .$currency_opt. '%22%29&format=json&env=store://datatables.org/alltableswithkeys&callback='); $currencyrate_arr = json_decode($jsn_response, true); $currency_rate = $currencyrate_arr['query']['results']['rate']['rate']; //var_dump($currency_rate); if($currency_rate > 0){ echo $currency_text = $currency_rate; } else{ echo $currency_text = "sorry! error.."; } ?> it working fine getting error while using piece of code currency conversion. the script working me, , prod

Add email notification subscription option for new Blog Posts in Sitefinity -

Add email notification subscription option for new Blog Posts in Sitefinity - sitefinity (version 6.3.5) has feature allow users subscribe comments notified when there new comments added via email. there anyway same thing blog posts themselves? i thinking similar functionality in wordpress sign notified when new blog post added blog. i've seen rss feed looking way allow users notified via email. it looks possible, not without custom coding. http://bit.ly/sf-customlogicforsfwidgets create .class file in sitefinity project solution must find out how inherit 1 widget. illustration inheriting sitefinity login control. to find needed path should inherited ( telerik.sitefinity.web.ui.publiccontrols.logincontrol ) go administration->settings->advanced->toolboxes->pagecontrols->sections->login->tools->login , find textbox: command clr type or virtual path . in can take path telerik.sitefinity.web.ui.publiccontrols.logincontrol oth

c - How to undo changes to an array after passing to a function -

c - How to undo changes to an array after passing to a function - is there way undo actions or original array after changed array shown below. #include <stdio.h> void function(int array[]){ array[2] = 20; //do work return; } int main(void){ int array[5] = {1,2,3,4,5}; function(array); // code has utilize original array homecoming 0; } you can pack 2 32 bit integers (old / new) 64 bit integer, example: #include <stdio.h> #include <stdint.h> void function(int64_t array[]) { array[2] = (array[2] << 32) | 20; } void printarr(int64_t array[], size_t n) { size_t i; (i = 0; < n; i++) { printf("%d ", (int32_t)(array[i])); } printf("\n"); } int main(void) { int64_t array[] = {1, 2, 3, 4, 5}; size_t i, n = sizeof(array) / sizeof(array[0]); function(array); puts("after function:"); printarr(array, n); (i = 0; < n; i++) {

c# - Script is not generated for a stored procedure in Entity Framework -

c# - Script is not generated for a stored procedure in Entity Framework - i utilize entity framework create database scripts using next code: var dbscript = ((iobjectcontextadapter)context).objectcontext.createdatabasescript(); i utilize maptostoredprocedure() method in entity mapping class. code generated create table sql script , not generate sql script stored procedure. how can generate sql script stored procedure? objectcontext.createdatabasescript() old code path database creation uses migrations pipeline create schema. reason, createdatabasescript doesn't know how process stored procedures. utilize code : var configuration = new dbmigrationsconfiguration { automaticmigrationsenabled = true, contexttype = typeof(mycontext), migrationsassembly = typeof(mycontext).assembly }; var migrator = new dbmigrator(configuration); var scriptor = new migratorscriptingdecorator(migrator); string script = scriptor.scriptupdate(sourcemigration: null,

javascript - Set var equal selected value from dynamically created select lisst -

javascript - Set var equal selected value from dynamically created select lisst - html: have select list class, no options. <select class="myclass"></select> js: populate select list $.each() iterate through json array $.each(value,function(key2, value2){ if(key2 == 'name'){ $('.myclass'). append($("<option></option>"). attr("data-catid",value['catid']). attr("data-catiid",value['catiid']). attr("value",key). text(value2)); } }); how select selected option? $('.myclass').on(change,funciton(){ alert($(this+' option:selected').data('catid')); alert($('.myclass option:selected').data('catid')); alert($('.myclass').is(':selected').data('catid')); ??? none of these work }); you can utilize next data: $('.myclass').on('change'

javascript - Django - How to make datepicker submit form on change -

javascript - Django - How to make datepicker submit form on change - so have jquery datepicker in html, shown below: <form id="form" method="get" action="."> ... <input class="form-control" type="text" value="{{ range }}" name="range" placeholder="date range" id="daterange"><b class="caret"></b></input> </form> and javascript function makes datepicker: $(document).ready(function() { $("#daterange").daterangepicker({ ranges: { "today": [new date(), new date()], "yesterday": [moment().subtract("days", 1), moment().subtract("days", 1)], "last week": [moment().subtract("days", 6), new date()], "last 30 days": [moment().subtract("days", 29), new date()], "this month": [moment().startof("month"

jquery - Getting an Element of a Particular Class -

jquery - Getting an Element of a Particular Class - is possible element particular class solely using class name? example, if have: <div class="hello"> hello world! </div> is there method in jquery accepts parameter hello , returns div(s) have class "hello"? i know can utilize loop until find given div class/id-name, curious if there else. $(".hello") the jquery class selector select class "hello". http://api.jquery.com/class-selector/ jquery html

python - Archive old data in mongoengine -

python - Archive old data in mongoengine - i have huge mongodb database powered mongoengine objects have date. create work easier, want archive old objects maintain them somewhere. i've been reading documentation , came across switch_db , switch_collection . however, can't create either work. for both cases, documentation references 2 usage scenarios. as queryset operation: user = user.objects.get(id=user_id) user.switch_collection('old-users') user.save() the problem works individual object. not possible batch archive multiple documents. as context_manager : with switch_collection(group, 'group1') group: group(name="hello testdb!").save() # saves in group1 collection using can't create query, getting next error: validationerror (document:none) (field required... i've tried searching way archive info mongoengine, none of options seem work. have suggestion? if have access mongodb instance itself,

node.js - Spawning child_process in NodeJS with valid HOME folder set -

node.js - Spawning child_process in NodeJS with valid HOME folder set - i'm trying spawn process in nodejs accesses home folder, , can't see, either of options below work. var spawn = require('child_process').spawn, options = {stdio: 'inherit', env: process.env}; spawn('ls', ['~/'], options); spawn('ls', ['$home'], options); output ls: ~/: no such file or directory ls: $home: no such file or directory i've verified options.env.home set, thought i'm doing wrong? update so ended doing create use-case work (using script instead of ls ): spawn('script', [process.env.home], options); then, within of script: #!/usr/bin/env bash export home=$1 i still don't understand why options.env.home not seem work expected. process.env.home want. utilize so: var spawn = require('child_process').spawn, options = {stdio: 'inherit'}; var ls = spawn('ls&#

sublimetext2 - PHP Syntax Check in Sublime Text Editor -

sublimetext2 - PHP Syntax Check in Sublime Text Editor - in gedit, can add together external tool of "php -l" on current document, , if have php command line installed, syntax check document. there way sublime text editor? (note, have mac , has php cli installed.) i imagine i'll have paste code snippet sublime plugin, right? the action referring called "linting" , there number of plugins sublime lint php files. mentioned len_d, php syntax checker one, i'd recommend sublimelinter sublime text 2 instead. (there different version of sublimelinter st3, it's not backwards-compatible, , has different architecture st2 version, no longer officially supported.) to install, first install bundle control if haven't already, restart sublime. open command palette ctrlshiftp , type pci bring package control: install package . nail enter, type in sublimelinter , nail enter 1 time again install. after installation complete, restart st2 1

if statement - program is terminated after else condition in perl -

if statement - program is terminated after else condition in perl - after encountering else condition(invalid url) loop terminated , not processing farther urls. 2. if node fails in xpath not printed in screen or file.i want print in both file , screen (node exception) use lwp::simple; utilize file::compare; utilize html::treebuilder::xpath; utilize lwp::useragent; utilize win32::console::ansi; utilize term::ansicolor; sub crawl_content{ { open(file, "c:/users/jeyakuma/desktop/input/input.txt"); { while(<file>){ chomp; $url=$_; foreach ($url){ $domain) = $url =~ m|www.([a-z a-z 0-9]+.{3}).|x; } 'c:/users/jeyakuma/desktop/perl/mainsub.pl'; &domain_check(); $ua = lwp::useragent->new( agent => "mozilla/5.0" ); $req = http::request

javascript - Bootstrap dropdown to show grid -

javascript - Bootstrap dropdown to show grid - i want show list of clients in dropdown, want info separated columns firstname, lastname, address, city, state, , zip. how can set grid in dropdown , have each row selectable regular dropdown? have far, rows don't right , "create new client" row has right highlighting when hover on it. <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" ng-click="loadclientlist()"> {{client.displayname || "select client..."}} <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li> <div class="row" style="width: 650px;"> <div class="col-sm-2"><b>first name</b></div> <div class=&quo

android - setting up multiple buttons at once -

android - setting up multiple buttons at once - so im trying create calculator (first app) instead of having each button setup itself, there away them @ once? this how it's setup now: final button button1 = (button) findviewbyid(r.id.button1); button1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { if (decimal == true) { string onscr = string.valueof(firsttextview.gettext()); onscr = onscr + 1; firsttextview.settext(onscr); currentval+= 0.1; } else { if (currentval == 0) { firsttextview.settext("1"); currentval++; } else { string onscr = string.valueof(firsttextview.gettext()); onscr = onscr + 1; firsttextview.settext(onscr); } } } });

how can I open a link in a webView (on a local file) in external browser? -

how can I open a link in a webView (on a local file) in external browser? - i have webview opened local file asset on it. then, when clik on link opennig local file asset, unfortunately, new file replace, , not open in external browser. i want sec file opened in external browser. how can that. edit : i have html file in asset named list.html. in html file there 20 links refer 20 html files in assets. want open list.html file in webview. then, when click on 20 links in file, links opened in external browser, not replace list.html file. start new activity , invoke web browser application , pass url it. startactivity(new intent(intent.action_view, uri.parse(url))); this might help, haven't test it. webview

Select which columns from CSV to graph with HighChart -

Select which columns from CSV to graph with HighChart - as looking @ question how select columns csv chart highchart? tried apply using csv file not work! what doing wrong? give thanks in advance: $(function () { //var info = "year,month,day,hour,time,kwh,savings,total kwh\n2013,02,06,11,11:00,0,0,308135\n2013,02,06,11,11:59,15,1.875,308150\n2013,02,06,12,12:59,27,3.375,308177\n2013,02,06,13,13:59,34,4.25,308211\n2013,02,06,14,14:59,32,4,308243"; var options = { chart: { renderto: 'example', defaultseriestype: 'line' }, title: { text: 'current temperature', x: -20 //center }, subtitle: { text: 'source: hassayampa.csv', x: -20 }, xaxis: { type: 'datetime' }, yaxis:{ title: { text: 'temperature (\xb0c)' }, //min: 0 }, legend:{ layout: 'vertical',

validation - Training and Validating Correctly With Encog -

validation - Training and Validating Correctly With Encog - i think i'm doing wrong encog. in of examples i've seen, train until training error reached , print results. when gradient calculated , weights of hidden layers updated? contained within training.iteration() function? makes no sense because though training error keeps decreasing in program, seems imply weights changing, have not yet run validation set through network (which broke off , separated training set when building info @ beginning) in order determine if validation error still decreasing training error. i have loaded validation set trainer , ran through network compute() validation error similar training error - it's hard tell if same error training. meanwhile, testing nail rate less 50% (expected if not learning). i know there lot of different types of backpropogation techniques, particularly mutual 1 using gradient descent resilient backpropogation. part of network expected update manua

Are floating point operations in Delphi deterministic? -

Are floating point operations in Delphi deterministic? - are floating point operations in delphi deterministic? i.e. same result identical floating point mathematical operation on same executable compiled delphi win32 compiler win64 compiler, or os x compiler, or ios compiler, or android compiler? this crucial question i'm implementing multiplayer back upwards in game engine, , i'm concerned predictive results on client side differ definitive (and authoritative) determination of server. the consequence of appearance of "lag" or "jerkiness" on client side when authoritative game state info overrules predictive state on client side. since don't realistically have ability test dozens of different devices on different platforms compiled different compilers in resembling "controlled condition", figure it's best set question delphi developers out there see if has internal understanding of floating point determinism @ low-level o

xml - xsd - sequence vs choice -

xml - xsd - sequence vs choice - i confused xml schema sequence according w3schools.com, the sequence element specifies kid elements must appear in sequence. each kid element can occur from 0 to number of times. if each element must appear, how can occur 0 times? wouldn't break must appear rule? and thing, difference between <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:element name="choicea" type="xs:string" > <xs:element name="choiceb" type="xs:string" /> </xs:choice> and this: <xs:sequence minoccurs="0" maxoccurs="unbounded"> <xs:element name="choicea" type="xs:string" > <xs:element name="choiceb" type="xs:string" /> </xs:sequence> can't set number of each element both of these cases? there difference @ all? the elements within sequence must appear in order spec

javascript - Google picker api not entering the onApiLoad function -

javascript - Google picker api not entering the onApiLoad function - i want integrate google drive picker api in application. onload function google picker api not calling. below code of mine. <!doctype html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>googledriveapi</title> <script type="text/javascript" src="https://apis.google.com/js/api.js?onload=onapiload"></script> </head> <body> <div> </div> <script type="text/javascript"> /**************************************************************** start of google api code ************************************************************************************************/ // api developer key obtained google developers console. var developerkey = 'aizasyazjlxjshv3fpklk6517tiz2nywt6rjzhk'; // client id obtained google developers console. var client

ruby - Rails 4 - routing actions for contact form -

ruby - Rails 4 - routing actions for contact form - i have 2 actions in controller: def study @user = user.find_by_slug(params[:slug]) end def reportform @user = user.find_by_slug(params[:slug]) thread.new mail service = ... end @message = 'thanks!' end and in routes: # user study form "/user/:slug/report", to: "users#report" # grab study form , action post "/user/:slug/report", to: 'users#reportform' and view: <form method="post" action="/user/<%= @user.slug %>/reportform"> ... but problem is, when send form, action reportform not called , instead of refresh current page form. what's wrong here? thank guys. form helpers the first thing that's wrong you're not using form helpers rails provides - problem because you'll end niggly little problems 1 you're receiving: #config/routes.rb resources :users :r

asp.net - Contact form send even if the field(s) are empty -

asp.net - Contact form send even if the field(s) are empty - please help... i got below code net , don't know how prepare issue. issue is:- if form empty or 1 of fields empty, still receive email. i think need add together validation here don't know how. not programmer , new asp. here code. the aspx is: <%@ page language="c#" autoeventwireup="true" validaterequest = "false" codefile="contact.aspx.cs" inherits="_default" %> <html> <head runat="server"> </head> <body> <form id="form1" runat="server"> <div class="inp_title"><asp:label id="label1" runat="server" text="name*" /></div> <div> <asp:textbox id="txtname" runat="server" validationgroup = "contact" cssclass="inp_h" /

php - Performance: Put soundex in DB or translate it after the query? -

php - Performance: Put soundex in DB or translate it after the query? - i relative new in mysql. have forum , writing search function this. query getting entries of forum. want combine search algorithm [similar_text() & soundex()]. my question due performance. improve going save soundex code in database when writing new entry datasae? or improve due performance translate each entry in soundex()? i using symfony2 framework. the soundex algorithm designed index anglo-saxon lastly names sound when pronounced in english. if you're trying index forum text--something questions , answers on stackoverflow--instead of names, it's not choice. full text search instead. having said that, if happen indexing lastly names, you'll probably improve performance storing encoding. ideally, you'd include check constraint guarantee encoding updated if name changed, mysql doesn't enforce check constraints. you'd need write triggers maintain 2 columns in syn

java - Getting the SOAP version in a JAX-WS Provider -

java - Getting the SOAP version in a JAX-WS Provider - is there way soap version (1.1 / 1.2) of request, in jax-ws provider? (@servicemode(mode.payload)) let's service supports both soap 1.1 , 1.2. when assemble soap fault in provider, have know soap version (because soap fault's construction dependent on soap version). have found no way information. java web-services soap jax-ws

javascript - jQuery unable to use Sortable with Isotope -

javascript - jQuery unable to use Sortable with Isotope - i trying create table of items sortable, using jquery ui's native sortable option, sortable based on criteria, using isotope plugin (here). here's fiddle: http://jsfiddle.net/sa5yh/4/. find out, here isotope works fine, clicking button indeed sorts expected. jquery ui sortable not work, can drag it, 1 time released, returns original position. without isotope use, works fine, expected: http://jsfiddle.net/sa5yh/5/. thought how create both work? isotope adds style attibute position restrictions, mentioned in reply well. here cure: http://jsfiddle.net/zd6mt/4/ //an event handler when isotope done reordering elements $container.isotope( 'on', 'layoutcomplete', function( isoinstance, laidoutitems ) { var n = laidoutitems.length; (var = n-1; >= 0; i--) { //starting lastly element in list //moves them origin of parent tag

asp.net mvc 4 - Need help in implementing tablesorter 2.17.1(or latest) -

asp.net mvc 4 - Need help in implementing tablesorter 2.17.1(or latest) - can please help me working sample of mvc application tablesorter plugin applied ? bit confused how apply latest tablesorter plugin mvc sample..i trying implement $('table').trigger('sortreset') in below teble. <table class="tablesorter"> <thead> <tr> <th>alphanumeric sort</th> <th>currency</th> <th>alphabetical</th> <th>sites</th> </tr> </thead> <tbody> <tr><td>abc 123</td><td>&#163;10,40</td><td>koala</td><td>http://www.google.com</td></tr> <tr><td>abc 1</td><td>&#163;234,10</td><td>ox</td><td>http://www.yahoo.com</td></tr> <tr><td>abc 9</td><td

sql - Group by and show records by criteria MSSQL -

sql - Group by and show records by criteria MSSQL - i have next table : | pid | fullname | position | salary | status | datehired | 11 | dave | clerk | 100 | extended | 2014-01-30 | 11 | dave | clerk | 100 | hired | 2014-01-02 | 22 | chris | guard | 80 | extended | 2014-01-30 | 22 | chris | dj | 100 | hired | 2014-01-02 | 33 | dud | clerk | 200 | terminated| 2014-01-30 | 33 | dud | clerk | 200 | hired | 2014-01-03 | 44 | trish | clerk | 200 | hired | 2014-01-25 i need able output each record grouped pid, , latest status. if latest status terminated, should ignored. output should this: | pid | fullname | position | salary | status | datehired | 11 | dave | clerk | 100 | extended | 2014-01-30 | 22 | chris | guard | 80 | extended | 2014-01-30 | 44 | trish | clerk | 200 | hired

css - JavaScript animation clingy circles -

css - JavaScript animation clingy circles - on canvas animation, have problem circles getting drawn "without metaphorical pen" lifting canvas. i need way stop function , draw 1 circle one. here jsfiddle (warning: uses 100% of 1 logical processor core/thread). javascript: window.requestanimframe = (function(callback) { homecoming window.requestanimationframe || window.webkitrequestanimationframe || window.mozrequestanimationframe || window.orequestanimationframe || window.msrequestanimationframe || function(callback) { window.settimeout(callback, 1000 / 60); }; })(); var canvas = document.getelementbyid("mycanvas"); var context = canvas.getcontext("2d"); var size = 19; var size_two = 19; function start(){ requestanimationframe(start); size++; context.arc(95, 85, size, 0, 2*math.pi); context.stroke(); } function othercircle(){ requestanimationframe(othercircle); size_two++; context.arc(500, 3

javascript - Vline.js is giving cryptic error message -

javascript - Vline.js is giving cryptic error message - i trying room illustration of vline , getting cryptic error message not able figure out. please see exception stack below. vline.js?t=1231:732 local stream: w91ahwvmk6ohuoni meeting:108 user came online, starting mediasession with: bakbak:biplav.saraf@gmail.com meeting:123 [140623 12:31:36.22] [vline.person] cannot read property 'log' of undefined typeerror: cannot read property 'log' of undefined @ qh.f (https://static.vline.com/vline.js?t=1231:195:297) @ oh (https://static.vline.com/vline.js?t=1231:187:418) @ w.n.dispatchevent (https://static.vline.com/vline.js?t=1231:186:432) @ w.n.vj (https://static.vline.com/vline.js?t=1231:194:348) @ w.n.dispatchevent (https://static.vline.com/vline.js?t=1231:193:416) @ kl (https://static.vline.com/vline.js?t=1231:366:162) @ w.n.start (https://static.vline.com/vline.js?t=1231:358:142) @ bm.n.oe (https://static.vline.com/vline.js

ACCESS VBA using using one more SQL QUERY in WHERE clause -

ACCESS VBA using using one more SQL QUERY in WHERE clause - i have 2 tables, 1 std table , keytable. have display values of std table based on status of keytable. example, if user selects asia, have create sql query list of countries in asia , utilize country values (example: india,srilanka,bangladesh) clause in final query. have tried building them. not sure of syntax first query filter out values of asia strsql1 = "select keytable.[lead country] keytable keytable.country='" & lstcountry & "';" second query display values according first query in clause strsql = "select * [std table] ([std table].country in (______)); the blank missing. you combine 2 queries 1 statement: strsql= "select * " & _ "from [std table] " & _ "where [std table].country in " & _ "(" & _ " select s.[lead country] " & _ " keytable s s.country = '" &

.net - Datetime type conversion in SQL -

.net - Datetime type conversion in SQL - i getting info external datasource , need store in sql server table. 1 filed in datetime. getting datetime field varchar format, , in sql table need save datetime datatype. convert(datetime,[date_time],03) -- code work in development environment not in production. convert(datetime,[date_time],120) -- code work in production not in development. this create life hard transfer code development production since have create changes in tested code. please note using sql server 2008 r2. is there anyway can create code similar? cannot alter civilization , language on both server since many other applications deployed there , might break existing application in both server. you can seek utilize set statement override date format, this: set dateformat mdy; select convert(datetime, [date_time], 120); as long include code in stored procedure/query on both environments, should fine. may want read on msdn.

javascript - Object # has no method addEventListener -

javascript - Object #<Controller> has no method addEventListener - i trying create controller create switch button android since 1 in titanium doesn't have de holo android need, controller working fine, there addeventlistener in controller uses switch controller that's throwing me object #<controller> has no method addeventlistener error. told me had define addeventlistener method in switch controller have no clue how this. ideas? customer.xml: ... <view> <switch id="myswitch" platform="ios"/> <require id="myswitch" platform="android" src="customswitch" /> </view> ... customer.js: ... $.myswitch.addeventlistener('change', function(e) { // magic goes in here }); ... customswitch.js: $.value = false; $.setvalue = function(value){ $.value = value; } var switchbutton = ti.ui.createbutton({ width : 97, height

c# - Is it ok to use following 'thread safe double checked lazy initilalization' pattern? -

c# - Is it ok to use following 'thread safe double checked lazy initilalization' pattern? - framework: .net 4.5 i using below sample code pattern initialize variables in thread safe manner. have been reading articles explains 'double checked locking has been broken in platforms http://www.cs.umd.edu/~pugh/java/memorymodel/doublecheckedlocking.html ' looks ok me using .net 4.5. recommendation per comments recommendation utilize lazy , allow .net framework heavy lifting of handling thread safety , memory models based on platforms:) : http://msdn.microsoft.com/en-us/library/dd642331.aspx update it appears eric lippert has been recommending not utilize pattern @ (now confused :() name pattern? (answer: lazy initialization double-checked locking) c# manual lock/unlock update 2 following excerpt "like techniques remove read locks, code in figure 7 (similar code have) relies on strong write ordering. example, code wrong in ecma memory model unless

c# - Linq to Entities Query Optimisation -

c# - Linq to Entities Query Optimisation - i've got linq query select ticket based on whether satisfies few conditions. query runs fine , works okay, i'm worried increment in number of possible returns noticeably worse goes. could suggest ways improve or optimise query run faster/better? doing horribly wrong against standard practice? here's query. i've swapped names. i'm thinking select 's in select new statement problem well. var attentionobj = (from c in context.supportticketentities c.statusid != 3 && ((c.isallocated == false) // not allocated || (c.flaggedforassist == true && c.allocatedtoemployeeid == empid) // flagged assist || ((from d in c.supportticketdatas c.allocatedtoemployeeid == empid && c.fogbugzattachments.count == 0 orderby d.t

Python 2.7 tkinter card matching game -

Python 2.7 tkinter card matching game - ok, have project school , create matching card game using python 2.7. here code. import sys import tkinter import random tkinter import * #==== main window ====# root=tk() root.title('matching game') root.geometry('750x770+400+20') #===== load images =====# back= photoimage(file='images/back.gif') card1=photoimage(file='images/card_front_01.gif') card2=photoimage(file='images/card_front_02.gif') card3=photoimage(file='images/card_front_03.gif') card4=photoimage(file='images/card_front_04.gif') card5=photoimage(file='images/card_front_05.gif') card6=photoimage(file='images/card_front_06.gif') card7=photoimage(file='images/card_front_07.gif') card8=photoimage(file='images/card_front_08.gif') card9=photoimage(file='images/card_front_09.gif') cards=[card1,card2,card3,card4,card5,card6,card7,card8,card9] useable=[] useable.append(cards[random.randr

css - Which tags allowed to have columns class in Foundation -

css - Which tags allowed to have columns class in Foundation - i have grid construction using zurb-foundation version 5. utilize elements other div handle row or columns such new html5 tags nav, header, etc. causes problems grid layout? i inquire on issue because there column seems not in grid. i.e height shorter neighbour columns: <header id="header" class="row"> <div id="logo" class="small-4 large-4 columns"> <div id="site-logo"><a href="/4test/drupal-7.28/" title="home"> <img src="http://localhost/4test/drupal-7.28/sites/default/files/ari_0.png" alt="home"> </a></div> <a href="/4test/drupal-7.28/" title="home"><span>drupal test</span></a> </div> <nav id="navigation" role="navigation" class="small-8 lar

c# - Change View Controller on UITableViewCell Tap -

c# - Change View Controller on UITableViewCell Tap - i'm trying alter view controller when taps on table view cell. im not doing conventional way. submethoding method detects tap utilize other class. here how doing it: tablesource.cs public override void rowselected (uitableview tableview, nsindexpath indexpath) { if (onrowselected != null) { onrowselected (this, new rowselectedeventargs (tableview, indexpath)); } } public class rowselectedeventargs : eventargs { public uitableview tableview { get; set; } public nsindexpath indexpath { get; set; } public rowselectedeventargs(uitableview tableview, nsindexpath indexpath) : base() { this.tableview = tableview; this.indexpath = indexpath; } } public event eventhandler<rowselectedeventargs> onrowselected; request.cs tablesourcetable.onrowselected += (object s

java - CloudHopper Server sending MO to connected client -

java - CloudHopper Server sending MO to connected client - i have project using ardanstudios smppclient connect smppserver. can send messages smpp server , delivered handset. when hand set replies or sends shortcode received message event message text blank. we using cloudhopper internally simulate smpp server, want confirm there isn't problem on our end when receiving messages can not figure out way simulate mo (mobile originated) message sent cloudhopper server our connected ardanclient. ideas ? you have 2 questions in 1 pal. suggest break up. first 1 have override firepdurequestreceived methos of class defaultsmppsessionhandler: @override public pduresponse firepdurequestreceived(pdurequest pdurequest) { pduresponse response = pdurequest.createresponse(); if (pdurequest.getcommandid() == smppconstants.cmd_id_deliver_sm) { processmo(pdurequest); } homecoming response; } private void processsmo(pdurequest request){ deliv