Posts

Showing posts from February, 2014

java - How to design the server side data structure of autocomplete function? -

java - How to design the server side data structure of autocomplete function? - i have millions of search engine queries looks this: stack overflow java video tutorials cars c++ vs java now want implement auto-complete function fit these demands: 1. type in 'so', prompt ['stack overflow','...','...'] 2. type in 'overflow', prompt ['stack overflow','...'] 3. type in 'jvt', prompt ['java video tutorials','...'] ... here solution: 1). extract query's abbreviation, e.g. stack overflow -> so; 2). split query suffix words, e.g. stack overflow -> 'overflow' + 'stack overflow'; 3). 3 sequences 'stack overflow': 'so','overflow','stack overflow' 4). in last, index these 3 sequences trietree, , in lastly node of every sequence denote orignal query(or query id): 'o' --> 'stack overflow' 'w' -...

gcc - Building FFTW with debug symbols - problems on port to 64-bit target -

gcc - Building FFTW with debug symbols - problems on port to 64-bit target - i need find why fftw segfaulting, in application built ok on 32-bit target gcc4.0 , fails on 64-bit target gcc4.6. the fftw configure options: --enable-debug --enable-debug-malloc --enable-debug-alignment only appear add together internal debug, hoping somewhere turning on gdb debug symbols can seek trace cause of segfault. there alternative gdb debug i've missed somehow? alternatively, there other way should trying track downwards segfault in fftw? as noted in comments above, reply edit makefile produced fftw3's configure add together -ggdb cflags. gcc gdb 32bit-64bit fftw

qt - Windows OpenCV VideoCapture Will Not Open Video File -

qt - Windows OpenCV VideoCapture Will Not Open Video File - my team , working on project opencv (v. 2.4.2) , qt(v. 4.8.4). developing in qtcreator. cross-platform project looking motion in video files. on mac osx, video file open using normal cv::videocapture object , interface , can run our programme successfully. however, on windows, file not open, throwing error on qtcreator terminal when programme exits: warning: error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:361) however, when set qtcreator 'release' build mode instead of 'debug', programme opens file should. my teammate , have done extensive research on error , found no real solutions. have tried installing codecs, moving opencv_ffmpeg.dll file working directory of .exe, , modifying path location of opencv_ffmpeg.dll (as location of ffmpeg library.) have made sure our video valid, file path (the same video works on macos, , video file play in windows through qt's phon...

design - android is here we use expandlistview -

design - android is here we use expandlistview - know question wrong reply me please ? i have app allow user come in many addresses. want show him of addresses take expandedlistview handle label of each address , when user click on label , can see city , street of address. want inquire utilize of expandlistview right here? lot. i don't see reason why using expandablelistview wrong in case. yes, can utilize it. how imagine this: where address 2 expanded. android design expandablelistview

assembly - Simple Addition in MIPS -

assembly - Simple Addition in MIPS - i'm in mips assembly class , book utilize out of print relying upon net help may understand. programme taking in 3 integers. 2 of them add/sub/mult/div , 3rd operator. here code. .text .globl __start __start: # prompt first int , take first int la $a0,firstint li $v0,4 syscall li $v0,5 move $s0, $v0 syscall # prompt sec int , take sec int la $a0,firstint li $v0,4 syscall li $v0,5 move $s1, $v0 syscall # prompt operation la $a0,operation li $v0,4 syscall li $v0,5 move $s2, $v0 syscall beq $s2,0,__add0 li $v0,10 syscall __add0: la $a0,added li $v0,4 syscall add together $a0, $s0, $s1 li $a0,1 syscall .data firstint: .asciiz "enter first integer: " secondint: .asciiz "enter sec integer: " operation: .asciiz "enter operation (add=0, subtract=1, multiply=2, divid...

c# - ForEach to Trim string values in string array -

c# - ForEach to Trim string values in string array - i wondered why foreach doesn't work , leaves values trailing whitespace. string days = "monday, tuesday, wednesday, thursday, friday"; string[] m_days = days.split(','); m_days.tolist().foreach(d => { d = d.trim(); } ); i know there other ways of doing don't need , reply there. because not reassigning trimmed strings. var list = m_days.split(',').select(s => s.trim()).tolist(); why foreach doesn't work or if using foreach incorrectly? foreach not linq, it's method of list<t> . doing this: foreach(string day in m_days) { day.trim(); // throwing away new string } c# asp.net foreach

windows - How do I create custom DataObjects in Python? -

windows - How do I create custom DataObjects in Python? - i'm searching python alternative of .net's dataobject class, can set info , re-create dataobject clipboard. pseudocode: dataobject = dataobject() dataobject.setdata('somekey', 'somevalue') dataobject.setdata('somekey2', 'somevalue2') dataobject.copy_to_clipboard() is there libraries this? python windows data-objects

Converting java code in C#. Operator error -

Converting java code in C#. Operator error - i'm working on 1 project. converting java code in c#. how convert next java code in c#. int h4; int e = h4; int[] w = new int[80]; e += 1518500249 + (a << 5 | >> 27) + (b & c | (b^ 0xffffffff) & d) + w[0]; show compiler error @ line 4 "cannot implicitly convert type long int". how changing type of variables int long ? long h4; long e = h4; long[] w = new long[80]; e += 1518500249 + (a << 5 | >> 27) + (b & c | (b ^ 0xffffffff) & d) + w[0]; c# java operators

r - How to set font for a gcheckbox object -

r - How to set font for a gcheckbox object - the font method in gwidgets not seem work gcheckbox (with rgtk2 toolkit). in next code styling applied correctly glabel object fails gcheckbox . library(gwidgets) w <- gwindow("test", height=50) g <- ggroup(container=w) cb1 <- gcheckbox(text="one", container=g) cb2 <- gcheckbox(text="two", container=g) label <- glabel("text", container=g) font(cb2) <- list(size=20) font(label) <- list(size=20) is there way create work? there isn't in api setting font, can hack in: ## setfont properties setfont_hack <- function(cb, spec) { require(rgtk2) widget <- gettoolkitwidget(cb)$getchildren()[[1]] font_descr <- pangofontdescriptionnew() if(!is.null(spec$weight)) font_desc$setweight(pangoweight[spec$weight]) if(!is.null(spec$style)) font_desc$setstyle(pangostyle[spec$style]) if(!is.null(spec$scale)) font_desc$setsize(spec$scale * pa...

Are there problems with using SQL Server AlwaysOn Availability Groups with Windows 2008R2? -

Are there problems with using SQL Server AlwaysOn Availability Groups with Windows 2008R2? - [cross posted dba.stackexchange] brent ozar published webcast (slides, video free registration) entitled "real-life sql server 2012: alwayson lessons learned", in repeatedly states, varying degrees of force, that using windows 2008r2 sql server 2012 availability groups bad idea among issues raises are: quorum recalculation (a feature of windows failover clustering introduced in windows 2012) numerous bugs requiring windows hotfixes (list in alwayson docs, "stackoverflow patch"), though i'm much less interested in problems fixed bringing deployment date. he doesn't talk other specifics of why using ags win2008r2 bad idea, other stating alwayson "pushes windows clustering harder other app, , uncovering breaking points". worth noting though supported configuration (alwayson scheme requirements). what problems have been seen in new deploy...

php - Non-expiring download link through Dropbox Chooser -

php - Non-expiring download link through Dropbox Chooser - the dropbox chooser returns 2 link types: preview , direct. appending ?dl=1 @ end of direct download link can forcefulness dropbox send file user's browser. now that's great , want direct link expires after couple of hours. is there way permanent direct download link dropbox file? the 'direct' link type returned chooser returns link references file straight default, without ?dl=1, expire after 4 hours. the ?dl=1 modification makes dropbox tell browser download file. in case, can modify 'preview' links, don't expire, either of these behaviors well, documented here: https://www.dropbox.com/help/201/en in short, using dl subdomain (instead of www) makes behave direct link, , appending ?dl=1 makes download. php api plugins download dropbox

hash - Unsigned Bytes CRC32 in Java -

hash - Unsigned Bytes CRC32 in Java - i'm trying replicate crc32 hashing function available in php in java. existing crc32 class within java returns different hash , believe because java bytes in byte array unsigned -128 through 128 instead of 0-255. what i'm failing figured out how work around situation. i've looked @ using guava's unsignedbytes, can't find hashing method takes argument. utilize write own hashing function, frankly don't plenty how works or bitwise arithmetic in general create plausible. in simplest terms i'm trying crc32 has string , homecoming decimal representation. crc not care sign. java's crc32 gave me same result php's. public static void main(string[] args) { string = "hello world!"; crc32 crc = new crc32(); crc.update(a.getbytes()); system.out.println(long.tohexstring(crc.getvalue())); } outputs: 1c291ca3 using this online php crc32 calculator gave same crc value abo...

asp.net - Javascript : Return false is not working : even after I press cancel the code gets executed -

asp.net - Javascript : Return false is not working : even after I press cancel the code gets executed - javascript : homecoming false not working, after press cancel code gets executed i trying execute 2 javascripts 1 button. when sec script executes, if click cancel code executed. below code. can please help me? <script type="text/javascript" language="javascript"> var targetbasecontrol = null; window.onload = function () { seek { //get target base of operations control. targetbasecontrol = document.getelementbyid('<%= this.gridview1.clientid %>'); } grab (err) { targetbasecontrol = null; } } function testcheckbox() { if (targetbasecontrol == null) homecoming false; //get target kid control. var targetchildcontrol = "chkselect"; //get command of type input in base of operations control. var inputs = targetbasecontrol.getelementsbytagname("input"); ...

Types of communication between azure virtual machines (IaaS) -

Types of communication between azure virtual machines (IaaS) - i trying find ways of communication between 2 virtual machines (iaas). i tried wcf communication, there other way this? read azure connect , vpn more communication between on-premise , cloud services? what possible ways? (i new in cloud computing , azure , detailed explanation useful. thanks.) depends on looking for vnet communication possible if looking that. azure iaas instances have public ip addresses can utilize communicate on internet. azure-virtual-machine

html5 - Kendo UI Mobile - data-* attribute for fixed headers in grouped listview? -

html5 - Kendo UI Mobile - data-* attribute for fixed headers in grouped listview? - i have fixed headers in grouping listview... know how using javascript, wondering if possible accomplish purely using kendo's data-* attributes? something following: <ul data-role="listview" data-type="group" data-headers="fixed"> <li> ... </li> </ul> thank you data attributes hyphenated , lower case declarative initialization property of camel-case counterparts in kendo mobile. $("ul[data-role=listview]").kendomobilelistview({ template: $("#listviewtemplate").html(), headertemplate: $("#listviewheadertemplate").html(), type: "group", fixedheaders: true }); <ul data-role="listview" data-template="listviewtemplate" data-header-template="listviewheadertemplate" data-type="group" data-fixed-headers=...

c++ - default behaviour for (bool) cast -

c++ - default behaviour for (bool) cast - classes in stl, such unique_ptr show examples such as: // unique_ptr constructor illustration #include <iostream> #include <memory> int main () { std::default_delete<int> d; std::unique_ptr<int> u1; std::unique_ptr<int> u2 (nullptr); std::unique_ptr<int> u3 (new int); std::unique_ptr<int> u4 (new int, d); std::unique_ptr<int> u5 (new int, std::default_delete<int>()); std::unique_ptr<int> u6 (std::move(u5)); std::unique_ptr<void> u7 (std::move(u6)); std::unique_ptr<int> u8 (std::auto_ptr<int>(new int)); std::cout << "u1: " << (u1?"not null":"null") << '\n'; std::cout << "u2: " << (u2?"not null":"null") << '\n'; std::cout << "u3: " << (u3?"not null":"null") << '\n'; st...

php - Securing Smarty -> any way of getting all assigned variables? -

php - Securing Smarty -> any way of getting all assigned variables? - i've created layer users can utilize own smarty code in sort of html template module, need sure it's save. so far i've disabled utilize of {php} -tags , {$smarty.now} accessible. i'm wondering if there way, because of existence of smarty in template, assigned variables template? if so, how list of assigned variables requested can develop check , exclude beingness parsed (means: left out tpl-source 1 time submitted user). any help or contributions i'm overlooking 'securing'/limiting smarty-access appreciated. first of wrong approach take way powerful , limiting in order secure it. famously java failing on many years on browser plugin. instead, if want have secure solution suggest writing own tiny templating engine have functionality need provide users. in case there no way exploitation bad guys. php security smarty

cakephp 2 - load helper depending on layout -

cakephp 2 - load helper depending on layout - i load helpers depending on layouts. want this, id doesnt't work: function beforerender(){ if (array_key_exists($this->request->action, $this->custom_layouts)){ public $helpers = array('html', 'form', 'session', 'menu1'); $this->layout = $this->custom_layouts[$this->action]; }else{ public $helpers = array( 'session', 'html' => array('classname' => 'twitterbootstrap.bootstraphtml'), 'form' => array('classname' => 'twitterbootstrap.bootstrapform'), 'paginator' => array('classname' => 'twitterbootstrap.bootstrappaginator'), 'menu1' ); $this->layout = 'default'; } } thanks help regards you cant juse declare public $helpers within methods. you need phone call php wants called: $...

Remove Trailing Spaces and Update in Columns in SQL Server -

Remove Trailing Spaces and Update in Columns in SQL Server - i have trailing spaces in column in sql server table called company name . all info in column has trailing spaces. i want remove those, , want have info without trailing spaces. the company name "amit tech corp " i want company name "amit tech corp" please help me in this. --agmraja try select ltrim(rtrim('amit tech corp ')) ltrim - removes leading spaces left side of string rtrim - removes spaces right ex: update table set companyname = ltrim(rtrim(companyname)) sql sql-server-2008 trailing

Erlang Monitor Type -

Erlang Monitor Type - full discloser: i've started learning erlang. forgive me if i'm beingness nieve. in erlang manual signature monitor function is: monitor(type, item) -> monitorref according rest of documentation: currently processes can monitored, i.e. allowed type process, other types may allowed in future. monitor semantics seem pretty inherently tied processes i.e. doesn't create sense monitor other process. having parameter seems border on paranoia rather trying plan future. these other things might allowed monitored in future? i don't know designers may have had in mind, i'd guess remote nodes. it may create sense process grouping (http://www.erlang.org/doc/man/pg2.html) monitored. erlang monitor

Is it possible to reference an output buffer at specific depth in PHP? -

Is it possible to reference an output buffer at specific depth in PHP? - we can ob level. can length of current ob stack. can reference ob stack @ level n? benefit of getting length of buffer @ specific depth. suppose example: $length = array(); ob_start(); echo "1"; $length[] = ob_get_length(); // length of current stack (depth 1) 1 ob_end_clean(); ob_start(); echo "11"; ob_start(); echo "2"; $length[] = ob_get_length(); // length of current stack (depth 2) 1 ob_end_clean(); ob_end_clean(); ob_start(); echo "111"; ob_start(); echo "22"; ob_start(); echo "3"; $length[] = ob_get_length(); // length of current stack (depth 3) 1 ob_end_clean(); ob_end_clean(); ob_end_clean(); print_r($length); output is: array ( [0] => 1 [1] => 1 [2] => 1 ) the length of each deepest stack 1. expected. my app has recursive output generation , of output stacks have know length of parent system-genera...

android - passing edittext parameter -

android - passing edittext parameter - i tried phone call method 1 class activity class im having nullpointer exception on edittext. // method created in method class public void getedittextvalue(edittext edittext, int resources, string datavalue , string vedittextvalue) { methods md = new methods(); edittext = (edittext) findviewbyid(resources); vedittextvalue = edittext.gettext().tostring(); md.editorsharepreferences(this, datavalue, vedittextvalue); } // phone call method in main activity class, declare public edittext edittext @ origin of class public edittext edittext; methods md = new methods(); md.getedittextvalue(currentemployermonth, r.id.ettimewithyourcurrentemployermonths, "dcurrentemployermonth", vcurrentemployermonth); send edit text value string , 1 time again in other activity , assign want assign value of edittext function (edittext.tostring()); android android...

Git branch prompt under Ubuntu not working -

Git branch prompt under Ubuntu not working - i under ubuntu 12.10, , have installed git-prompt-aware: https://github.com/jimeh/git-aware-prompt whenever in directory has git repository, need source ~/.bash_profile show branch. if don't that, doesn't show up. however, when close terminal , go same directory, need 1 time again ~/.bash_profile , thoughts why can happening? my problem in .bashrc have defined ps1 as: case "$term" in xterm-color) color_prompt=yes;; esac # uncomment colored prompt, if terminal has capability; turned # off default not distract user: focus in terminal window # should on output of commands, not on prompt force_color_prompt=yes if [ -n "$force_color_prompt" ]; if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; # have color support; assume it's compliant ecma-48 # (iso/iec-6429). (lack of such back upwards extremely rare, , such # case tend back upwards setf rather setaf.)...

node.js - Not able to deploy Angular app made in Yeoman -

node.js - Not able to deploy Angular app made in Yeoman - i created app using yeoman. works fine on local while "yeoman server" running. but when created dist, running "yeoman build", doesn't work. here link code on github: https://github.com/srijanaravali/yaspa node running on machine , demo project in angular seed works fine @ same time. node.js angularjs yeoman

jQuery compare select field values with an array before submitting form -

jQuery compare select field values with an array before submitting form - i'm new jquery here i'm trying do. i have form multi select field named city , zip, i'm trying values of select field , compare against list of cities have, if found match jquery update value of hidden text field named city these values , submit form. if no match found redirected different website. same thing zip codes, zip codes same field , see if matchs zip code list. if yes update zip code hidden field, if no redirect them website. here code right , it's not working. $("#front-form").submit(function(event) { // getting values html select field var cityandzip = $("#citynzip").val(); //comparing values cities list if (cityandzip === "city 1" || "city 2" || "city 3") { //updaing hidden field , submitting $("#hiddencityfield").val(cityandzip); //comparing values zip code list } else if (cityandzip === "...

facebook - PHP variable from external file? -

facebook - PHP variable from external file? - *edit / finished solution / working code so, friend of mine helped me come with. here part utilize in k2 "items.php" file: <div class="fb-comments" data-href="<?php echo juri::current(); ?>" data-num-posts="8" notify="true" data-width="580"></div> <input id="authname" style="display: none;" type="text" value="<?php echo $this->item->author->name; ?>" /> <input id="authmail" style="display: none;" type="text" value="<?php echo $this->item->author->email; ?>" /> <input id="link" style="display: none;" type="text" value="<?php echo juri::current(); ?>" /> <script> window.fbasyncinit = function() { fb.event.subscribe('comment.create', function (response) { var com...

php - Wordpress Resize Image and show as thumb in post -

php - Wordpress Resize Image and show as thumb in post - i have set crop in functions.php resize images posts. codex wordpress: add_image_size, post_thumbnail add_theme_support('post-thumbnails'); set_post_thumbnail_size(100, 100, true); //size of thumbs add_image_size( 'post-thumb', 180, 180, true ); //(cropped) usage below <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'post-thumb' ); } ?> but not resize thumb , shows original size. doing wrong? wordpress resize images on upload, can utilize this plugin resize images on fly, first time phone call image size not exists, plugin resize image next times image size exist. php wordpress

c++ - Can a class initialize its non-immediate base classes in its member initialization list? -

c++ - Can a class initialize its non-immediate base classes in its member initialization list? - the next code excerpted apache c++ standard library user's guide class derivedoutputstream : public std::ostream { public: derivedoutputstream(): std::ios(0), std::ostream(&dsb) {} //1 // ... private: derivedstreambuf dsb; // ... }; please note std::ios not immediate base of operations class of derivedoutputstream , appears in fellow member initialization list. i think not correct, that? it right if virtual base of operations class. virtual bases initialized derived class. c++ inheritance constructor initialization derived-class

android - Prompting a login only once -

android - Prompting a login only once - i have video player app. when video clicked user prompted login facebook business relationship using code below: if(videocode == "bqxtccyjske"){ $(document).ready(function () { login() }); } the login function works fine when same video thumbnail clicked again, of course of study login process runs again, produces error. out there know of way take care of this? either through boolean logic or through facebook api? api code , called function both below. <div id="fb-root"></div> <script type="text/javascript"> //<![cdata[ window.fbasyncinit = function() { fb.init({ appid : '410375775693910', // app id channelurl : '', // channel file, not required leave empty status : true, // check login status cookie : true, // enable cookies allow server access session oauth : true, // enable oauth 2.0 xfbml : false // pa...

c++ - Creating a new instance of a class for a doubly linked list -

c++ - Creating a new instance of a class for a doubly linked list - i have been provided starter code creating doubly linked list. problem i'm having implementing function inserts newly created node @ 'head'. a node in linked list next struct: template <class t> struct listitem { t value; listitem<t> *next; listitem<t> *prev; listitem(t theval) { this->value = theval; this->next = null; this->prev = null; } }; the code insertion @ head under: void list<t>::insertathead(t item) { listitem<int> a(item); //create node specified value if(head==null) { head=&a; //when list empty, set head //to address of node } else { //when list not empty, following. ...

ubuntu - Trying to Host Server for External Access - Apache, VirtualBox & Portforwarding -

ubuntu - Trying to Host Server for External Access - Apache, VirtualBox & Portforwarding - banging head on wall @ stage.... trying host apache site on ubuntu 12.10 virtualbox. running windows 8 host. things i've done: ensured apache listening on ports 80, 443 , 8080 (for thoroughness) tcp 0 0 0.0.0.0:443 0.0.0.0:* hear 3355/httpd tcp 0 0 0.0.0.0:8080 0.0.0.0:* hear 3355/httpd tcp 0 0 0.0.0.0:80 0.0.0.0:* hear 3355/httpd tcp 0 0 0.0.0.0:22 0.0.0.0:* hear 681/sshd vm using bridged network connection assigned static ip ubuntu vm, can accessed fine within network. forwarded tcp ports 80, 8080, 443 on static ip of vm on router given vm static nat address turned off ubuntu firewall , router firewall read on forums isp (eircom) allow port 80 used and still can't access site using wan/external ip (checked internally , using canyouseeme.org). says ports mentioned closed. i'm @ loss of seek next... missing silly here? note: haven't assigned...

javascript - d3 Line Chart Filling at Arbitrary Line -

javascript - d3 Line Chart Filling at Arbitrary Line - i'm attempting create simple line chart d3, reason it's filling between line , midpoint. here's output: my javascript following: var width = 500, height = 500, padding = 10; var extentvisits = d3.extent(visits, function(obj){ homecoming obj['visits']; }); var extentdates = d3.extent(visits, function(obj){ homecoming obj['datestamp']; }); var yscale = d3.scale.linear() .domain(extentvisits) .range([height - padding, padding]); var xscale = d3.time.scale() .domain(extentdates) .range([0, width]); var line = d3.svg.line() .x(function(d) { homecoming xscale(d['datestamp']); }) .y(function(d) { homecoming yscale(d['visits']); }) ...

mongodb - subdocument query not containing values outside array with regex matching -

mongodb - subdocument query not containing values outside array with regex matching - if have collection of recipes each item looks like: { name: "recipe 1", ingredients: [{ name: "dark chocolate", qty: "1 g" }, { name: "milk", qty: "2 g" }, { name: "unsalted butter", qty: "3 g" }] } how can find recipes that: have ingredient of name either contains milk or chocolate but do not contain other ingredients do not either contain milk or chocolate? the illustration above not match query. summary: need recipes contain milk, chocolate or both, nil else. using regex look looks docs not containing ingredients of milk or chocolate (using technique here) , negating $not trick: class="lang-js prettyprint-override"> db.recipes.find({'ingredients.name': {$not: /^((?!(milk|chocolate)).)*$/}}) tested against:...

javascript - Show & Hide Dynamic content -

javascript - Show & Hide Dynamic content - ok i've got inbox style layout, multiple messages dynamic content each message, want click on link (action needed) , 1 time click open drop downwards div containing iframe. javascript using: <script language="javascript"> function toggle() { var ele = document.getelementbyid("toggletext"); var text = document.getelementbyid("displaytext"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerhtml = "<iframe src=\"http://m.quotesin.com/an.html\" width=\"100px\" frameborder=\"0\" height=\"20px\" allowtransparency=\"yes\" scrolling=\"no\"></iframe>"; } else { ele.style.display = "block"; text.innerhtml = "<iframe src=\"http://m.quotesin.com/an.html\" width=\"100px\" frameborder=\...

alert - MS SQL Server third party transaction blocking monitor tools -

alert - MS SQL Server third party transaction blocking monitor tools - are there open source or otherwise free ms sql server transaction blocking monitor tools? 1 observe blocking transaction lasts longer x , email alert somewhere ideal. simple 1 server. ms sql express 2008 should apply really, or recent. yes, sql server comes such alternative out-of-the box, few know , fewer know how utilize it. called blocked process threshold : use blocked process threshold alternative specify threshold, in seconds, @ blocked process reports generated. threshold can set 0 86,400. default, no blocked process reports produced. event not generated scheme tasks or tasks waiting on resources not generate detectable deadlocks. you can define alert executed when event generated. example, can take page administrator take appropriate action handle blocking situation. once alternative enabled scheme generate profiler event of blocked process study event class. next piece o...

c++ - Can't use a struct(with template) inside a class -

c++ - Can't use a struct(with template) inside a class - i made node struct template: template <typename t> struct node{ t data; node* next; node* prev; }; it compiles fine when seek utilize within class gives me error: invalid utilize of template-name ‘node’ without argument list in class' context, need add together template parameter instead of using plain node* : struct b { node<int>* next; }; c++ templates struct

firefox - Google places autocomplete with Selenium IDE test -

firefox - Google places autocomplete with Selenium IDE test - i'm trying create test in selenium ide (from firefox addon) autocomplete place (given google places). need type in input place name , first location. sequence place "rzeszów, polska": i.stack.imgur.com/gqrmd.png firstly i've tried mouseover , click action - elements exists didn't create click on autocomplete. next i've tried 2 sequences (with clickat , keydown), didn't create click, despite fact selenium can find right locator. i.stack.imgur.com/f13q7.png i trying solution jquery autocomplete -> jqueryui.com/autocomplete/ , worked fine there. i think, problem connected html structure, bold in place name: i.stack.imgur.com/bflye.png you can test on: jsfiddle.net/dodger/pbbhh/ sequence in selenium ide (shown above) doesn't work google places, solved problem autocomplete? //moderator: please add together photos , create links post , delete line. thanks. to forc...

php - error on print by ajax -

php - error on print by ajax - i have ajax request other page print on printer, when phone call function cannot print page ajax code : /******* print a6 ********/ function buttonclickhanlder( e ) { e.preventdefault(); var bills_id = $('#bills_id').val(); $.post("bills/billsprinta6.php", { bills_id: bills_id }, function(data){ //alert("data loaded: " + data); } ); } $(function(){ $('#printa6').click(buttonclickhanlder); }); /***************/ i presume when go print info isn't loaded. you'll need have ajax fire before send printer. php ajax

php - How can I get results of this MYSQL query? -

php - How can I get results of this MYSQL query? - this question has reply here: mysql query result in php variable 5 answers how can results?: $check = mysql_query("select username, email, case when max(username = '$username') > 0 , max(email = '$email') > 0 'both' when max(username = '$username') > 0 'username' when max(email = '$email') > 0 'email' end school_users username = '$username' or email = '$email'") or die(mysql_error()); i need "username" or "email" or "both" when exists. how receive these variables? you should utilize fetch functions. mysql_query() returns resource of data, getting data, need utilize either mysql-fetch_assoc or mysql_fetch_array. ...

c# - Remove the escape sequence '\' from string to convert it to XmlDocument -

c# - Remove the escape sequence '\' from string to convert it to XmlDocument - i have web service returns struct object, response next xml string. need load xmldocument object how rid of escape sequences in string. '\' every '"' causing error. <?xml version=\"1.0\" encoding=\"utf-8\"?> <quote xmlns:xsi=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd=\"http://www.w3.org/2001/xmlschema\" xmlns=\"http://tempuri.org/\"> <price>19656</price> </quote> use regex.unescape method. string unescapedstring = regex.unescape(textstring); c# xml escaping

javascript - highcharts: epoch time not properly connected to Xaxis -

javascript - highcharts: epoch time not properly connected to Xaxis - when have inconsistent info coming in (when illustration server gathers info down) highcharts not plot x correctly. still plots there info on x while there not. should afcouse plot right hr when there data. here fiddle: http://jsfiddle.net/zvwfk/ info variable inconsistant! can show me how can right error? $(function () { var chart; $(document).ready(function() { chart = new highcharts.chart({ chart: { renderto: 'container', type: 'spline', margin: [50,130,90,100] }, title: { text: 'weather today' }, credits: { enabled: false }, subtitle: { text: 'test' }, xaxis: { type: 'datetime', datetimelabelformats: { day: '%h:%m' }, tickinterval: 36...

assembly - What's the default segment register when using square brackets to read values in NASM? -

assembly - What's the default segment register when using square brackets to read values in NASM? - as know, can read value of address using square brackets in nasm, such that: mov esi, [ebp +8] mov edi, [var] --> (var variable) those values in square brackets represent offset address, when read values using format, absolutely need segment, whether in real or protected mode, what's default segment register nasm uses? know windows uses flat mode, if set different values different segment register(cs, ss, ds, es, fs, gs), segment register nasm use? guess ds , right? segment register different when using different expressions in square brackets? default segment register same both in real , protected mode? thanks. the default segment register ds 'base registers' except mov esi, [ebp + 542] ; // uses ss: mov esi, [esp + 123] ; // uses ss: mov eax, [eax + esp] ; // uses ds, because eax base of operations // , esp scalab...

iphone - Get physical location of text in UILabel -

iphone - Get physical location of text in UILabel - i know how find size of text using sizewithfont want find actual highest point , lowest point of text has been drawn in uilabel . i need add together artificial cursor view uilabel within it. problem text in uilabel seems alter top , bottom margins arbitrarily. can't work out how os works out position text in uilabel . so great able create category or method works out y axis pixel origin of actual text drawn onto view. is possible @ all? how uitextfield position text , cursor perfectly? update i thinking might possible getting uilabel context , finds whitespace @ top, should give me y pixel origin of actual text right? have no thought start though, or create efficient plenty not inhibit frequent changes uilabel. many thanks. do need utilize uilabel or utilize disabled uitextview? for text view like cgrect rect = [textview.layoutmanager usedrectfortextcontainer:textview.textcontainer]; this...

playframework - unresolved dependency for postgresql 9.2 jar in play framework -

playframework - unresolved dependency for postgresql 9.2 jar in play framework - i using postgresql 9.2 play framework 2.1 i downloaded driver here: http://jdbc.postgresql.org/download.html (jdbc4 postgresql driver, version 9.2-1002) my project/build.scala file follows: import sbt._ import keys._ import play.project._ object applicationbuild extends build { val appname = "myapp" val appversion = "0.1" val appdependencies = seq( "postgresql" % "postgresql" % "9.2-1002.jdbc4") val main = play.project(appname, appversion, appdependencies) } i have placed jdbc driver in next locations in play directory structure: myapp/lib/postgresql-9.2-1002.jdbc4.jar myapp/lib/9.2-1002.jdbc4.jar myapp/lib/postgresql/postgresql/9.2-1002.jdbc4.jar however, running app play run , next error , build fails: [warn] module not found: postgresql#postgresql;9.2-1002.jdbc4 [warn] ==== local: tried [warn] ...

c++ - Loki :Typelist.h -

c++ - Loki :Typelist.h - i trying examples of typelist , read illustration given in next link. typelists visitor pattern example but in illustration have not used typelist.h provided loki. question how can utilize header file create typelist or have write scratch. c++ template-meta-programming loki

c++ - Can protobuf read partially? -

c++ - Can protobuf read partially? - i want save terrain info file , load parts of it, because it's big store in memory whole. don't know whether protobuf purposes. for illustration have construction (might invalid gramatically, know simple basics): message quad { required int32 x = 1; required int32 z = 2; repeated int32 y = 3; } the x , z values available in programme , using them find right quad object same x , z (in file) obtain y values. however, can't parse file parsefromistream(), because (i think so) loads whole file memory, in case file big. so, protobuf able load 1 object, send me checking , if object wrong give me sec one? actually... ask: parsefromistream() loads whole file memory? this depends on implementation using. have "read sequence" apis. example, assuming stored "repeated quad", protobuf-net be: int x = ..., y = ...; var found = serializer.deserializeitems<quad>(source) ...

Zend exception for default layout -

Zend exception for default layout - i using zend framework application have created controllers , phtml files. need maintain login page. how can create login page without displaying default.phtml contents. sombody please help me.. rather disabling layout want login action utilize different layout instead. in controller: $this->gethelper('layout')->setlayout('login'); zend-framework

PHP Content-length header delays loading -

PHP Content-length header delays loading - i have php webpage takes blob database , outputs image. when user uploaded image stored filesize (e.g. 491099) database. when image requested through webpage add together watermark, set http headers , output image through imagejpeg($img) . problem when image loaded (takes no time) browser still seems "busy" (loading indicator rotating). when requesting page through asynchronous phone call makes loading time long well, though image loaded within no time. when remove content-length header, image loaded before browser stops right when it's loaded process time fast. so seems browser thinks (due content-length header) should still loading while it's not... removing content-length header no alternative since required in many browsers i've read. // set header image header("content-length: " . $image->imagesize); //would 491099 in illustration header("content-type: " . $image->...

r - several values per date for annotated time line with googleVis package -

r - several values per date for annotated time line with googleVis package - it seems me annotated time line produced gvisannotatedtimeline() function of googlevis r bundle allows unique value each date. there way plot several values per date gvisannotatedtimeline() ? otherwise there alternative ? r google-visualization annotatedtimeline googlevis

Converting my wordpress theme into a bootstrap responsive -

Converting my wordpress theme into a bootstrap responsive - how convert wordpress theme bootstrap responsive... search ways in net didnt found stuff solve issue.. bunch of in advance helping me out you can utilize bootstrap starter theme wordpress here starter theme bootstrap wordpress starter theme twitter-bootstrap

android ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) -

android ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) - i designed simple application in android when run on emulator shows application stopped...i tried find solution , came across using breakpoints...but when set breakpoints , debug application shows "source not found" in ddms perspective activitythread.performlaunchactivity(activitythread$activityrecord, intent). can out here suggest now... this log looks like 02-20 04:28:21.232: d/androidruntime(607): shutting downwards vm 02-20 04:28:21.232: w/dalvikvm(607): threadid=1: thread exiting uncaught exception (group=0x4001d800) 02-20 04:28:21.262: e/androidruntime(607): fatal exception: main 02-20 04:28:21.262: e/androidruntime(607): java.lang.runtimeexception: unable start activity componentinfo{com.example.apps/com.example.apps.act}: java.lang.nullpointerexception 02-20 04:28:21.262: e/androidruntime(607): @ android.app.activitythread.performlaunchactivity(activitythread.java:...

asp.net mvc 3 - How to display only one error message using Html.ValidationSummary? -

asp.net mvc 3 - How to display only one error message using Html.ValidationSummary? - i have view (skipping redundant code simplicity): @model competencymodel @using (html.beginform()) { @html.validationsummary() @html.editorfor(model => model.results) } when submit, if validation fails within editorfor , validationsummary shows list of validation messages each item coming editorfor . this screenshot view, editorfor single line radio buttons: but need single error message saying failed. tried: @html.validationsummary(true) @html.editorfor(model => model.results) but doesn't show anything. tried @html.validationsummary(true) @html.editorfor(model => model.results) @html.validationmessagefor(model => model.results, "error !!!") but doesn't show anything. what doing wrong? give thanks you. solution trick. <style>.validation-summary-errors ul { display: none; }</style> @html.validationsummary("can...

Format numbers (amount) according to computer setup in C# -

Format numbers (amount) according to computer setup in C# - in c# im trying format amount according setup on computer. so instance if setup on en-us xxxx.xx (separated dot) , in nb-no xxxx.xx (separated comma) want auto-detect , format amount accordingly. thanks help in advance. try this double amount = xxxx.xx; string formattedcurrency=amount.tostring("c", cultureinfo.currentculture); c#

Android: How to remove files from External storage? -

Android: How to remove files from External storage? - i implementing application generates , create files in external storage. can guys help me how can remove that? thank you, chandra edit-1: added next code , still getting same problem, please have @ code below, string fullpath = "/mnt/sdcard/"; system.out.println(fullpath); seek { file file = new file(fullpath, "audio.mp3"); if(file.exists()) { boolean result = file.delete(); system.out.println("application able delete file , result is: " + result); // file.delete(); } else { system.out.println("application doesn't able delete file"); } } grab (exception e) ...

Where can I find graphics card specifications for openCL programming? -

Where can I find graphics card specifications for openCL programming? - i purchase new card, cann't find lot info cards. i'm searching - private memory size - local memory size - constant memory size - texture memory size thanks answers! you may have more luck researching card's architecture, rather researching specific cards. graphics cards of particular generation have varying amounts of identical hardware features on-chip. example, architecture of core same across series of cards, number of cores in product can unique. i recommend reading anandtech graphics card reviews. tend go great detail when benchmark graphics cards. opencl

Can you give me a good example of using a predicate that does not involve a collection, list, enumerator or IEnumerable? -

Can you give me a good example of using a predicate that does not involve a collection, list, enumerator or IEnumerable? - the title pretty much asks want -- illustration of using predicates don't involve iterating on collection, using ienumerable, or that. i don't care language use, or if provide code example. i'd grateful if described simple illustration illustrates predicates without usual uses. i'm working on article , i'm stumped, examples gratefully received , credited. in 1 project have manually implemented cache dependencies using predicates. whenever new item set in cache depends on cached item, predicate delegate created check whether dependency still valid or whether cached item has invalidated. whenever cached item accessed, , had dependency check predicate assigned, checked before cached item returned. if course of study solved without using predicates, solution pretty elegant , enabled implementing cache dependencies injectin...

python - Not sure why my Stored Procedure isn't working between pyodbc and SQL Server -

python - Not sure why my Stored Procedure isn't working between pyodbc and SQL Server - i'm pretty new python (2.7) , not lot of help pyodbc. have script calls stored procedure: sql = "exec gen_all.dbo.rpt_trinity_total '" + startdate + "', '" + enddate + "'" print sql dbcursor.execute(sql) rows = dbcursor.fetchall() row in rows: print row[0], row[1] at end of stored procedure returned dates passed in, create sure sp getting called @ parameters getting set. looks should working, when @ table supposed populated sp, nil in there. if run sp in management console, works fine. i tried found solution here, namely: dbcursor.execute("{call gen_all.dbo.rpt_trinity_total(?,?)}", (startdate),(enddate)) but gave me same results, nothing. sp simple, truncate , insert, using select, based on dates passed. just wonder if give insight on this. bunch. i suspect issue did not commit on connection....

unit testing - Equivalent of JustMock's ReturnsCollection() in FakeItEasy? -

unit testing - Equivalent of JustMock's ReturnsCollection() in FakeItEasy? - with justmock can mock datacontext tables lists in linq sql this, ienumerable taking place of each datacontext's table through returnscollection() allowing me plug in false data: [testmethod] public void shouldgetmanagersbyhiredate() { var context = mock.create<mydatacontext>(); mock.arrange(()=> context.employees).returnscollection(getfakeemployees()); mock.arrange(() => context.managers).returnscollection(getfakemanagers()); var repository = new employeerepository(context); var managers = repository.getmanagersbyhiredate(new datetime(2002, 1, 1), datetime.now); assert.areequal(1, managers.count()); assert.areequal(1, managers.firstordefault().id); } private ienumerable<employee> getfakeemployees() { homecoming new list<employee> { new employee { id = 1, hiredate = new datetime(2004, 12, 1) }, new employee { id = 2, hireda...

expansion - m4 expand macro inside words -

expansion - m4 expand macro inside words - i new m4 cannot find simple thing: is possible expand macro in middle of word? (i utilize counter used in c symbol name in low-level code) i mean like: define(`foo',`bar') happy fooday! the expected output be: happy barday! it ok this: happy expand(foo)day! sorry if easy question googling attempts failed on 'm4 expand macro in word, m4 expand substring', etc... thanks edit 1: stackoverflow recommended this: expansion of macro not working in m4 ...which indeed looking for. edit 2: ok, not easy: define(`foo',`bar') happy asdfoo()day! this fails, might normal. however, in c symbol names have substitute these macros in middle of words. way go that? i believe looking for: define(`foo',`bar') happy `'foo`'day! that is, utilize m4 quotes indicate word boundary. or, more accurately, utilize empty string on either side of word wish have expanded, , indic...

html - Using jquery to set a content area to height of page with sticky footer -

html - Using jquery to set a content area to height of page with sticky footer - http://www.playerspace.com/index.cfm/action/aboutus i using jquery set sticky footer content doesn't extend below fold. if didn't there space under footer bottom of browser window. unfortunately on pages takes place, link included above, content area has gap between bottom of container , sticky footer. can tell me how can set height of white content container meet footer jquery on page load? you can without jquery. set container wish fill whole page height: 100% along containers parents including body , , html . source: http://css-tricks.com/snippets/css/sticky-footer/ jquery html height footer

image - SVG color-shadow filter fails when built with JavaScript -

image - SVG color-shadow filter fails when built with JavaScript - i created drop-shadow svg image, works fine using pure svg (see a live demo): class="lang-svg prettyprint-override"> <!doctype html> <html> <body> <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <defs> <filter id="drop"> <fecomponenttransfer result="offout" in="sourcealpha"> <fefunca type="linear" /> <fefuncr type="discrete" tablevalues="1" /> <fefuncg type="discrete" /> <fefuncb type="discrete" /> </fecomponenttransfer> <feoffset result="shadow" dx="67" dy="0" in="offout" /> ...

java - Adding time and date to google calendar via intent -

java - Adding time and date to google calendar via intent - i trying add together event google calendar using object have stored on database. date stored on database stored in format of date , time stored string. currently working bar time portion of event. date beingness passed correctly time defaulting 0:00. how create time passed properly? @override public void onclick(view arg0) { if(arg0.getid() == r.id.btnaddtocal) { long starttime = 0, endtime=0; string startdate = blankevent.eventdate; seek { date date = new simpledateformat("yyyy-mm-dd").parse(startdate); starttime=date.gettime(); } catch(exception e){ } calendar cal = calendar.getinstance(); intent calintent = new intent(intent.action_edit); calintent.settype("vnd.android.cursor.item/event"); calintent.putextra("eventlocation", blankevent.eventlocation); ...