Posts

Showing posts from February, 2013

database - Storing Date with timezone -

i have been working oracle db long time , have been storing dates without bothering timezone. have issue client , server in different timezones , need perform date/time conversion according timezone. has opened lots of questions now: should store date/time along timezone or not? asking because if servertimezone changes data corrupted. if oracle db server located in particular region should run on local timezone? there standard this? my second point in relation dr database servers located in different regions have same data prod db. if timezones not same both db in trouble. to able show clients date in timezone need offset. example, server runs in edt , saved time years. data saved way. so, need create field, store offset each user. need apply offset each date/time field on select. how this, have no idea - because have no idea how use data. select statement, report, or website? if application, client load user info including offset. example, user in edt have offset

dependency injection - Adding Ninject to Legacy Project C# -

i have inherited legacy c# & vb.net project have maintain , augment how. there no interfaces , no dependency injection. the first thing thinking of doing creating interfaces , adding ninject, make possible unit test project eventually. is idea or should leave alone ? what best practices implementing di when comes legacy projects. thanks i don't think there's set best practice, other use common sense - it's kind of case case scenario. few important questions ask yourself: how effort going required create interfaces current classes? how additional effort going required write proper unit tests? these unit tests add more value time spent? how long legacy system going maintained? there's nothing worse doing huge upgrade (requiring testing not development staff, product user) replace in 18 months. also, how long has legacy system been in place without issue? there's no reason invent work if appears stable , has low maintenance.

c# - Is it possible to deserialize and serialize json object in different propety names? -

let have class: public class resource { [jsonproperty(propertyname: "address")] public domain.dto.address addresses { get; set; } } the json string value looks like: { . . . "resourcesets":[ { "estimatedtotal":1, "resources":[ { . . . "address":{ "userlocation":null, "admindistrict":"national capital region", "admindistrict2":"third district ncr", "locality":"caloocan city", "postalcode":null, "addressline":"yellow bell ext", "formattedaddress":"yellow bell ext, caloocan city, philippines", "neighborhood":"barangay 161", "landma

Adding HTML code into powershell array -

i running several different types of validations on deployment process. each validation i'd add html code array. @ end of script i'd take entire array of code , email out. the code have send email following $sendmessage = @{ subject = "problem: web config blanks" body = " <p>the deployment validation script has found @ least 1 problem</p> <ul> <li> there " + $errorwcblanksct + " web config values blank </ul>" = "from@company.com" = "to@company.com" smtpserver = "0.0.0.0" } send-mailmessage @sendmessagewcblanksct -bodyashtml write-host "web config has been parsed , emailed" obviously 1 validation checks blank values in web.configs. if add in validation total file count example, how have additional <li> line, if file count script defines "wrong"?

ssms - Option in SQL Server Management Studio to expand columns in results grid for large text display -

i have column contains bunch of text. way can view in standard tiny cell. is there way automatically expand cell size of text? is possible in 'edit' mode well? this has got nothing sql or t-sql, per se. function of whatever user interface using display query results. assume in case using sql server management studio (ssms). don't believe there way automatically expand columns fit largest value width. might want try sql server development tools (ssdt). although don't think either. option might send results text file (which option) , viewing file in editor. you write own user interface want do.

numpy - Long error in contour plot python -

Image
i trying create contour plot x coordinates being label ef , y being labeled eb , z being function labeled a. returns long error posted below. appreciated. error is file "contour.py", line 19, in <module> c = plt.contour(ef,eb,a) file "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2016, in contour ret = ax.contour(*args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 7326, in contour return mcontour.quadcontourset(self, *args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1088, in __init__ contourset.__init__(self, ax, *args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 686, in __init__ self._process_args(*args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1101, in _process_args x, y, z = self._contour_args(args, kwargs) file "/usr/lib/pymodules/python2.7/matpl

web - Which EOL should I use in general? -

i wondered if there eol (end of line) privileged between \n , \r\n , \r (if enumeration right). the question in general and, webserver should serve? bonus: if can tell me python specificity if such exist. ps: question is, in hand generic , in other specific, didn't know if should have tagged question python tag or not. let me know. edit: , matter of operating system related prob or there programs (or specifications) requiring or advising use 1 more others? found surprisingly not lot of information them. doing wrong? for web, \n doesn't anything, need a <br> for python, \n should fine, if want safe, use import os os.linesep #this newline character on os code running on edit: formatting

php - Can :hover apply to generic element tags specific to a parent div? -

i using bunch of divs (created php) generate block of clickable elements. need apply styles these generic elements, rather specific ones, yet using code below seems invalid. #container { height: 80%; width: 60%; background-color: green; } #container div:hover { background-color: blue; } <div id="container"> <div style="background-color: red; width: 100px; height: 100px;"> </div> http://jsfiddle.net/xd2ez/ so not sure if issue generic div element cannot styled sub-element , have :hover attribute operates properly. know classes or id's can specified handle this, have thousands of unique divs. cannot use #container:hover div{ background-color: blue;} as seems invalid, need select 1 element block, , not @ once. any ideas here? in advance. this work if remove background color html, , apply using css: #container { height: 80%; width: 60%; background-color: green; } #container div {background-color: red;}

c - What is missing in my makefile? -

i trying create first makefile. tested program using following commands: command 1: gcc -wall -ggdb3 -std=c99 -o file1 file1.c -lm -lpthread -l command 2: gcc -wall -ggdb3 -std=c99 -o file2 file2.c -lm -lpthread everything works great. created makefile (please see below). keep getting error message. can take @ code , give me hint on problem is? file2.o: in function `seed_primes': file2.c:(.text+0x461): undefined reference `sqrt' file2.c:(.text+0x466): undefined reference `sqrt' file2:(.text+0x533): undefined reference `sqrt' file2.o: in function `create_threads': file2.c:(.text+0x668): undefined reference `pthread_create' file2.c:(.text+0x6b5): undefined reference `pthread_join' file2.o: in function `next_seed': file2.c:(.text+0x860): undefined reference `sqrt' collect2: ld returned 1 exit status make: *** [file2] error 1 here makefile: cc=gcc debug=-ggdb3 cflags=#(debug) -wall -lm -lpthread -lrt -l progs=file1 file2 all: $(progs)

java - How to subtract value from generic data -

i've defined point class this. class point<e,f> {e x; e y; ...} so can give float, integer ... [anyway number] but when want manipulate error. void getdistance(point<number, number> pt) { this.x-pt.x.floatvalue(); //not statement this.y-pt.y.floatvalue(); } also should not give string type, should change number? or other way calculate distance generic type? but if change type number how can specify different co-ordinate type [float or integer]? how infer type here? this.y-pt.y.typevalue? how can if integer or double? when pass pt.getdistance(otherpt); compiler shows error: create method getdistance(float,integer). how pass other point method? try , define point this: point<e extends number, f extends number> . way compiler can tell e , f both numbers. however, might want simplify point<n extends number> since both coordinates should of same type (i.e. double , integer etc.) - mixing types seems quite odd

algorithm - maximise the special elements in the matrix -

below problem statement: there matrix of size m*n , all numbers 1 m*n occupy place in it . now, element called special if (recursive definition) -it top left corner element(at position (0,0)) -an element @ (x,y) special if neighbour element (m,n) such (m,n) special , element @ (x,y) greater element at(m,n) , of (m,n)'s neighbours. a neighbour cell cell shares edge it. therefore, internal cell has 4 neighbours, edge cell has 3 neighbours , corner cell has 2 neighbours. the problem states few(maybe 0) cells in matrix have been filled. rest filled in such way numbers 1 m*n used , maximise number of special elements . also, if multiple answers possible, lexicographically smallest matrix considered answer. a matrix lexicographically smaller other if string of row-major view lexicographically smaller other. test case 1: //2 x 3 matrix 2 ? ? ? ? 3 solution 1: 2 1 4 5 6 3 test case 2: //6 x 6 matrix ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

guice - how to inject a uiBinder with @Inject (instead of GWT.create())? -

firstly, doing such thing practice ? tried seems right way me wasn't successful : public class formviewimpl extends compositeview implements hasuihandlers<c>, formview { public interface settlementinstructionssearchformviewuibinder extends uibinder<widget, settlementinstructionssearchformviewimpl> {} @inject static formviewimpl uibinder; @inject static provider<dateeditorwidget> dateeditorprovider; @uifield(provided = true) mycomponent<string> mycomp; @uifield dateeditorwidget effectivedatefrom; // .. other fields @inject public formviewimpl () { mycomp = new mycomponent<string>("lol"); if (uibinder == null) uibinder = gwt.create(settlementinstructionssearchformviewuibinder.class); initwidget(uibinder.createandbindui(this)); } @uifactory dateeditorwidget createdateeditor() { return dateeditorprovider.get(); } } what oth

java - Can somebody please explain me this output of polymorphism? -

heres code : class a{ int data=10; void show1(){ system.out.println("in a="+data); } } class b extends a{ int data=20; void show2(){ system.out.println("in b="+data); } } public class overriding4 { public static void main(string args[]){ b b=new b(); system.out.println("data1="+b.data); system.out.println("data2="+b.data); b.show1(); b.show2(); } } and heres output : data1=20 data2=20 in a=10 in b=20 the output @ data1=20 should 10 , not 20...but think i'm missing here. please me this okay , help, 1 new doubt : happen if changed main method : public static void main(string args[]){ a=new b(); system.out.println("data1="+a.data); system.out.println("data2="+a.data); a.show1(); a.show2(); } there go. class fields don't inherited. note

Facebook iOS SDK - open session and request read permissions -

i'm using (void)openwithbehavior:(fbsessionloginbehavior)behavior completionhandler:(fbsessionstatehandler)handler to open session, works fine. after open, read permissions with: (void)requestnewreadpermissions:(nsarray*)readpermissions completionhandler:(fbsessionrequestpermissionresulthandler)handler this works fine, users signing in through mobile safari (or facebook ios app, haven't tested), users jumped , forth twice (tap login in app, jump mobile safari, log in there, jump app, jump mobile safari, approve permissions, jump app. returning users - have signed out of app (and token removed), double-jump - each time mobile safari tells user they've approved app. i'm using openwithbehavior because prioritize native ios login using fbsessionloginbehaviorusesystemaccountifpresent . don't see version of combined initial permissions request (such openactivesessionwithreadpermissions... ). i hoping that, subsequent logins, permissions known via sessi

Oracle SQL - Comparing Rows -

i have problem i'm working on oracle sql goes this. table purchaseid custid location ----1------------1-----------a ----2------------1-----------a ----3------------2-----------a ----4------------2-----------b ----5------------2-----------a ----6------------3-----------b ----7------------3-----------b i'm interested in querying table return instances same customer makes purchase in different locations. so, table above, want: output purchaseid custid location ----3------------2-----------a ----4------------2-----------b ----5------------2-----------a any ideas on how accomplish this? haven't been able think of how it, , of ideas seem pretty clunky. database i'm using has 1mm+ records, don't want run slowly. any appreciated. thanks! select * yourtable t custid in (select custid yourtable group custid having min(location) <> max(location))

c++ - What does argc mean? -

this question has answer here: opencv argc , argv confusion 1 answer i can't understand, whats function of code in opencv loading image. whats function of if(argc !=2)? can tell me it. if( argc != 2) { cout <<" usage: display_image imagetoloadanddisplay" << endl; return -1; } full code: 1 #include <opencv2/core/core.hpp> 2 #include <opencv2/highgui/highgui.hpp> 3 #include <iostream> 4 5 using namespace cv; 6 using namespace std; 7 8 int main( int argc, char** argv ) 9 { 10 if( argc != 2) 11 { 12 cout <<" usage: display_image imagetoloadanddisplay" << endl; 13 return -1; 14 } 15 16 mat image; 17 image = imread(argv[1], cv_load_image_color); // read file 18 19 if(! image.data ) // check invalid input 20 { 21 cout << "could not open or find image" << std::end

rack pow - Pow (webserver) with directory listing -

is there way directory listing pow? http://pow.cx since gui access apache kind of deprecated on os x. looking simple web server setup can add random directories , serve static content may not have index file, minimal hassle , setup.

python - Django filter() returning object instead of contents -

brand new django excuse newbie question. cannot life of me google search return need. first, imported these using inspectdb. second, before providing the: def __unicode__(self): return u'%s %s' % (self.id, self.cuisine) in models, every database showed looked bound objects versus actual data when looking in admin. assumed normal. now i'm trying query database , show results. doing simple, code is: def expand(request): userid = userid.objects.filter(name__contains="test") return render(request,'expand.html',{'userid':userid}) the return should test 1, test 2, instead get: [<userid: userid object>, <userid: userid object>] tried userid, userid.name in template , both return object versus contents. thanks, sorry i'm sure repeat question! model: class userid(models.model): id = models.bigintegerfield(primary_key=true, db_column='id') # field name made lowercase. name = model

how to forward an email after adding text with outlook/python? -

i'm trying open email add text , forward using python windows extensions. this have: import win32com.client outlook = win32com.client.dispatch("outlook.application").getnamespace("mapi") inbox = outlook.getdefaultfolder(6).folders('subfolder') messages = inbox.items message = messages.getlast() newmsg = message.forward newmsg.to = "email@email.com" #i want forward address here when try last line: attributeerror: 'instancemethod' object has no attribute 'to' i know how open message, add own text, , forward somewhere else? i'd prefer if have option of having display message in outlook before sending it.

Python: A way to detect a filetype attached to a string? -

in ironpython 2.6*, i'm trying build function "corrects" string; have 2 arguments, file , extn . idea them concatenated necessary later in program, know people don't read instructions , you're bound have enter "file.*" file , mess up. i'm looking way take file , have function detect , strip .* ( any extension of length) file if .* exists ; doesn't need in string, , user entering same extension extn **, needs not prepared, merely consistently stripped. my current method has me passing file , extn separately, it's not inconceivable redo things take file.extn , break file , extn if need be; don't want if don't have to, though, program built around former system. *a note regarding ironpython 2.6; i'm trying avoid ironpython-specific codes , use simple of ones possible, unix-win cross-compatibility's sake. far, i've done works in python 2.7 ide's, not work in python 3.x **a note regaring extn ; want u

Choosing Correct Database For Delphi Project -

i developing delphi xe2. i planning software primary , secondary school. school have 1,500 students. database model relational , plan keep whole history of each student years move on. (well @ point archived, relationships maintained time) i used write delphi apps using dbisam v4 elevate software. hold licence of it, still possibility use it. however had contact many companies using firebird recently, using postgres , many websites mysql. i don`t see need go paid databases, since type of customer sensitive in investment. database free such use, plus option of keep using dbisam. getting old. i prefer put business logic on software, not in database, no need intricate logic or procedures on database side. my questions is: need consider choose correct database? this wiki post can you. besides that, have decide using ole-db, odbc or dbx middleware technology. depending on 1 find or not support delphi. another criteria include know-how on database options , rectric

php - Displaying database information on a page -

i'm building unique hits counter project count go 1 if users ip isn't in database, how implement "count" html? php <?php $connect_error = 'sorry, we\'re experiencing connection problems.'; mysql_connect('localhost', 'root', 'password') or die($connect_error); mysql_select_db('hit_counter_database') or die($connect_error); $user_ip = $_server['remote_addr']; function ip_exits($ip){ global $user_ip; $query = "select `ip` `hits_ip` `ip` = '$user_ip'"; $query_run = mysql_query($query); $query_num_rows = mysql_num_rows($query_run); if($query_num_rows) ==0) { return false; }else ($query_num_rows) >= 1){ return true; } } function ip_add($ip) { $query = "insert `hits_ip` values ('$ip')"; @$query_run = mysql_query($query); } function update_count(){ $query = "select `count` `hits_count`"; if (@$query_run = mysq

jsf 2 - JSF 2 Global exception handling, navigation to error page not happening -

i developing jsf 2.0 based web application. trying implement global exception handler redirect user generic error page whenever exception occurs (e.g. nullpointerexception,servletexception,viewexpiredexception etc.) whenever npe occurs in app, customnavhandler breakpoint hit , navigationhandler code executed, somehow redirection error page not happening, requested page remains partially rendered. idea wrong here ? 1 info throwing npe deliberately on requested page (which partiallyu rendered after npe) my faces-config.xml entry <factory> <exception-handler-factory> com.common.exceptions.customexceptionhandlerfactory </exception-handler-factory> </factory> my customnavhandler public class customexceptionhandler extends exceptionhandlerwrapper { private static final logger logger = logger.getlogger("com.gbdreports.common.exception.customexceptionhandler"); private final exceptionhandler wrapped; public customexceptionhandler(excep

ios - NSXMLParser parse error 65 in HTML -

i attempting use nsxmlparser parse html file believe xhtml <!doctype html public "-//w3c//dtd html 3.2 final//en"> <html> <head> <title>index of /foo</title> </head> <body> … the parsing failing quite early 2013-08-23 13:40:00.413 foo[61787:c07] -[directorylistingparserdelegate parser:parseerroroccurred:] line 1 column 52 error domain=nsxmlparsererrordomain code=65 "the operation couldn’t completed. (nsxmlparsererrordomain error 65.)" error 65 nsxmlparserspacerequirederror occurring on line 1, column 52 is there wrong in doctype line being returned common apache server? is /en not wanted parser?

c# - Launching new process from ASP.NET -

i'm having hard time c# / asp.net (.net 4) code works fine in development environment, isn't working on production server. part of code attempts launch new process run lame.exe (to convert .wav file .mp3): process convert = new process { startinfo = { filename = appdomain.currentdomain.basedirectory + "bin\\lame.exe", arguments = "--quiet -q 5 -b 16 \"" + filepath + "\" " + directory + "\\" + tempfile, useshellexecute = false, redirectstandardinput = true, redirectstandardoutput = true } }; convert.start(); convert.waitforexit(); and works fine on windows 7 development pc. however, on production windows 2008r2 server, doesn't anything: doesn't crash, or throw exceptions, doesn't anything. i realise caused user permissions, i'm struggling fix issue. having read dozens of art

javascript - Bootstrap 3.0 Popovers and tooltips -

i new bootstrap , i'm having trouble getting popover , tooltip features work. had no problem drop downs , models seem missing popover , tooltips. i getting tooltips show not styled , located bootstrap examples. , popover not working @ all. please take , let me know missing. <!doctype html> <html> <head> <title>bootstrap 101 template</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet" media="screen"> <link href="css/font-awesome.min.css" rel="stylesheet" media="screen"> <link href="css/index.css"

r - Minimize distance between matrices subject to row and column margin constraints -

i solve matrix possessing predetermined row , column totals closely resembles second predetermined matrix possessing same properties (but possibly different row/column totals). so, both matrices must satisfy following: elements of must in range [0,1]. any element column number less row number must 0 in solution. any element column number greater row number + 2 must 0. so starting this: 0.07 0.17 0.47 0.29 0.07 0.1 0.14 0 0.31 0 0.07 0.18 0.07 0.32 0 0 0.15 0.04 0.19 0 0 0 0.18 0.18 i minimize ‘distance’ this: 0.10 0.21 0.37 0.32 0.10 0.11 0.12 0 0.33 0 0.10 0.13 0.10 0.33 0 0 0.12 0.09 0.21 0 0 0 0.13 0.13 such original row , column totals first matrix preserved. defining distance here sum of squared differences between ith, jth entries in each matrix, if issue reason ok using other me

java - Creating a connection with Microsoft's JDBC driver is 3 times faster than with jTDS -

i googled lot can't figure out reason of strange behaviour. i'm using microsoft sql server 2012 windows authentication. i'm connecting that: try { class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); conn = drivermanager.getconnection("jdbc:sqlserver://my-pc:1433;databasename=database;integratedsecurity=true"); } catch (exception e) { system.out.println("failed" + e.getmessage()); e.printstacktrace(); } this connection aproximately 3 times faster when use jtds driver (and add .jar project library , on) net.sourceforge.jtds.jdbc.driver , appropriate connection string ( jdbc:jtds:sqlserver://my-pc:1433/database;instance=sqlexpress ). does know why? read jtds driver faster sqldbc drivers, don't know i'm doing wrong. thank you jtds driver has lot of improvements related way queries work after connection made. benchmark not mention initial connection speed: http://jtds.sourceforge.net/benchtest.html .

c# - The RSA key container could not be opened for one of two sections -

i have encrypted 2 sections of webconfig file, 1 called connectionstrings , other useraccount using same provider. in code connectionstring section decrypted fine without problem when comes decrypt second section called useraccounts error. here exact error message: failed decrypt using provider 'aqueductdevprovider'. error message provider: rsa key container not opened. your appreciated. thanks here code in web config file <configprotecteddata> <providers> <add name="aqueductdevprovider" type="system.configuration.rsaprotectedconfigurationprovider, system.configuration, version=2.0.0.0,&#xd;&#xa;culture=neutral, publickeytoken=b03f5f7f11d50a3a,&#xd;&#xa;processorarchitecture=msil" keycontainername="aqueductdevkeys" usemachinecontainer="true" /> </providers> </configprotecteddata> <connectionstrings configprotectionpro

c# - RallyDev - Getting Tasks for Stories using Rally.RestAPI.dll and Service V2.0 -

i'm pulling data off rally server @ https://rally1.rallydev.com using c# , rally.restapi.dll. server upgraded webservice v2.0 , i'm having problems getting tasks user story. know way child collections presented changed in api move 2.0, i'm trying isn't working. v2.0 removed ability return child collections in same response performance reasons. fetching collection return object count , url collection data.a separate request needed elements of collection. here code iterates on user story results, accesses "tasks" collection on stories , issues separate request access individual task attributes: using system; using system.collections.generic; using system.collections; using system.linq; using system.text; using rally.restapi; using rally.restapi.response; namespace arestapp_collectionoftasks { class program { static void main(string[] args) { //initialize rest api rallyrestapi restapi;

c# - WCF timeout error with code running fine -

i have project uses wcf service database queries, builds "environment" object (which consists of different database class objects) , returns inside "workspace" object client. it's been running fine. i added "database" type service correct contract , method updates. when call method client times out after 1 minute. in debugging take 3-5 seconds hit end of service method. nothing happens rest of minute until on client side see timeout problem. there no errors/exceptions thrown. please see below: calling client: 490 m_scanworkspace = m_connection.scanproxy.createenvironments end of service method: 477 return tworkspace; 478 } it takes 3-5 seconds line 478 in service. f10 shows it's complete. nothing happens until 1 minute later when line 490 in client shows timeout error. while debugging can see valid object in tworkspace. firstly, set wcf tracing using diagnostics namespace. use first example on tutorial , wcf dump o

wpf - Implicit Styles not working on Custom Controls -

in app.xaml have few implicit styles <style targettype="{x:type button}"> ...blah... </style> these styles work control long not in custom control create. my control public class navigationcontrol : control { public static readonly dependencyproperty buttonstyleproperty = dependencyproperty.register("buttonstyle", typeof(style), typeof(navigationcontrol)); public style buttonstyle { { return (style)getvalue(buttonstyleproperty); } set { setvalue(buttonstyleproperty, value); } } } static navigationcontrol() { defaultstylekeyproperty.overridemetadata(typeof(navigationcontrol), new frameworkpropertymetadata(typeof(navigationcontrol))); } public navigationcontrol() { } my control styles , templates <controltemplate x:key="navigationcontroltemplate" targettype="{x:type controls:navigationcontrol}"> <button style="{templatebinding buttonstyle

Powershell Remoting: Transport Exception -

here's code i'm using: const string username = "domain\\user"; const string password = "password"; var credentials = new pscredential(username, password.tosecurestring()); var conninfo = new wsmanconnectioninfo(new uri("https://server.domain.com/powershell"), "http://schemas.microsoft.com/powershell/microsoft.exchange", credentials) {authenticationmechanism = authenticationmechanism.negotiate}; var rs = runspacefactory.createrunspace(conninfo); rs.open(); here's exception: connecting remote server server.domain.com failed following error message: winrm client cannot process request. authentication mechanism requested client not supported server or unencrypted traffic disabled in service configuration. verify unencrypted traffic setting in service configuration or specify 1 of authentication mechanisms supported server. use kerberos, specify computer name remote destination. verify client comp

f# 3.0 - F# laziness in quoted computation expressions -

using quote member on computation expression convert workflow ast, such getenumerator() not called on sequence quotation constructed (i.e., have form of laziness). in use case, sequence represents remote data-source, , invoking getenumerator() member on go out , query against it. is there way implicitly use lazy type (and still use quote member) on source member not eagerly call getenumerator() , instead has not loaded value yet? why let binding defined property of module , variable within function treated different entities in quotation, i.e. propertyget vs value . some test code... module example open microsoft.fsharp.quotations [<interface>] type i<'type> = inherit seq<'type> type foobuilder() = member __.source (x : #seq<'type>) : i<'type> = invalidop "not implemented" member __.for (source : i<'type>, f : 'type -> i<'type>) : i<

enqueue files to playlist in winamp with python -

i trying python enqueue music files winamp. have tried following: pywinamp some functions work, add playlist doesn't wacommand again command line switches work, load file doesn't does know way done? not looking complete controller winamp, way push files playlist in running instance. i using winamp 5.63 , windows 7 x64 , python 2.7 i'm using python 3 on windows 8 64-bit , using pywinamp.py can add files playlist , play file. here code: # run winamp.exe try: open(os.devnull, 'wb') devnull: devnull = open(os.devnull) winamp_path = 'c:\\program files\\winamp\\winamp.exe' p = subprocess.popen([winamp_path], stdout=devnull, stderr=devnull) except oserror e: # handle exception pass w = winamp() # class pywinamp.py # wait app start ''' reason couldn't access __mainwindowhwnd attribute of winamp class added line in __init__ method of winamp class: self.wid = self.__mainwindowhwnd. way kn

git - Deploying to Heroku fails: "channel 0: bad ext data" -

i'm trying push node.js application heroku command line, prompt freezes text “channel 0: bad ext data”. right before goes down, there large rush of text, appears several node modules' readme contents. i've tried push quietly same error: 'git push -q heroku master' is ssh being overloaded data? there way silence logs node modules installed? possibly worth noting: i'm on 32bit win7, , using normal command prompt, not git bash or anything, although after testing same error happens there well.

How to download a file from php page using phonegap (Android platform)? -

i'm using phonegap create android application ,in app i'd allow user download file php page (server side) ,that's i'm having troubles . here html page index.html android project : <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>download</title> </head> <body> <form id="down" name="down" action="http://172.25.10.99/test/download.php" method="get"> <!-- 172.25.10.99 : server ip --> <input type="text" name="filename" id="filename"/> <input type="submit" id="id2" value="download"/> </form> </body> <

Number of Characters in SQL Server varchar(max)? -

microsoft's documentation on varchar(max) data type: "variable-length, non-unicode string data. . . max indicates maximum storage size 2^31-1 bytes (2 gb) . storage size actual length of data entered + 2 bytes" http://technet.microsoft.com/en-us/library/ms176089.aspx i thought 2^31 bytes = 2 gb, not 2^31-1 bytes = 2 gb. wrong on point? two of bytes reserved column overhead, question becomes: how many characters data type store? a) 2^31-3 = 2,147,483,645 bytes = 2,147,483,645 characters b) 2^31-2 = 2,147,483,646 bytes = 2,147,483,646 characters the number 2^31-1 0x7fffffff in hex. it's largest possible positive 32-bit number on twos-compliment machine (like x86 , else). the documentation telling maximum storage size, has hold length of data plus 2 bytes. means maximum data size 2^31-1-2, or 2,147,483,645 (0x7ffffffd).

php - Mysql: Gap detection query not detecting gaps -

it seems though gap detection picking whatever set timedifference , doing every interval based on that. so here's explanation of data structure , i'm after: i have database that's set this: (schema name) historical -cid int uq ai nn -id int pk -location varchar(255) -status varchar(255) -time datetime my data comes in looking (example 5 rows selected id) 433275 | 97 | mylocation | ok | 2013-08-20 13:05:54 433275 | 97 | mylocation | ok | 2013-08-20 13:00:54 433275 | 97 | mylocation | ok | 2013-08-20 12:25:54 433275 | 97 | mylocation | ok | 2013-08-20 12:20:54 433275 | 97 | mylocation | ok | 2013-08-20 12:15:54 in case above you'll notice i'm missing data 12:25:54 -> 13:00 id 97. trying write report tell me the: start of downtime, duration of downtime, , end of downtime (which i've been handling in php adding timediff time) here's code (php -> mysql) (non-working) stands now:

css - HTML: How to insert links into Ordered/Unordered Lists? -

hello guys i'm creating website fun , wondering how can insert link inside order/unordered list? (although it's not in title) <li></li> tag? like this: <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> </ul> li stands "list item". tag can have direct child of <ul>...</ul> , have put links inside <li> .

numpy - Error when using the python module numba -

i have installed llvm 3.2 , dependencies of numba (except meta): llvm 3.1 or 3.2 llvmpy (from llvmpy/llvmpy fork) llvmmath numpy (version 1.6 or higher) meta (from numba/meta fork (optional)) cython (build dependency only) nose (for unit tests) argparse (for pycc) i installed llvm 3.2 , llvmpy according instructions on page https://github.com/llvmpy/llvmpy . other python modules installed using pip : sudo pip install --upgrade module_name next tried numba examples on page: http://jakevdp.github.io/blog/2012/08/24/numba-vs-cython/ . stored both pairwise_python , pairwise_numba in file named performance.py . when run from performance import * in ipython following error: --------------------------------------------------------------------------- assertionerror traceback (most recent call last) <ipython-input-4-c7c496c26b18> in <module>() ----> 1 import performance /home/carlos/workspace/freestyle/numba/performance.p

what's the difference between head and branch using Git in Eclipse -

Image
this question has answer here: difference between head , master 3 answers i using git inside eclipse. can please explain difference between head , master[branch] in drop down menu selected? choose 1 arbitrarily , far arbitrariness hasn't appeared make difference, sure that's gonna come haunt me if don't figure out soon. head not pointing master in circumstances. there projects without master branch example, put head pointing somewhere else, or might have master, not default anyway. your confusion may coming general scenario when there no difference between two, there situations aforementioned when not hold true. hope helps.

C# preprocessor directive or conditional for differentiating between Visual Studio 2012 and 2010? -

i have c# code works in visual studio 2012 use visual studio 2010 on same codebase. there preprocessor directive or conditional can use isolate code? no built in pre-processor directive far know, there msbuild variable. open project file (unload in solution explorer, click edit) , add following after main set of property declarations. <propertygroup condition="'$(visualstudioversion)' == '10.0'"> <defineconstants>$(defineconstants);vs_10;</defineconstants> </propertygroup> <propertygroup condition="'$(visualstudioversion)' == '11.0'"> <defineconstants>$(defineconstants);vs_11;</defineconstants> </propertygroup> you can use vs_10 (vs 2010) or vs_11 (vs 2012) preproc directives.

system.reactive - Reactive Extensions: Why does this exit immediately? -

i reading introtorx , i'm having bit of trouble sample code. here sum total of code: using system; using system.collections.generic; using system.linq; using system.reactive.disposables; using system.reactive.linq; using system.reactive.subjects; using system.text; using system.threading; using system.threading.tasks; namespace learningreactiveextensions { public class program { static void main(string[] args) { var observable = observable.interval(timespan.fromseconds(5)); observable.subscribe( console.writeline, () => console.writeline("completed") ); console.writeline("done"); console.readkey(); } } } if understand book correctly, should write sequence of numbers console, once every 5 seconds forever since never dispose() of sequence. however, when run code, "done" @ end. no numbers, no "completed", nothing "done". what doing wro

java - How to change tomcat port number -

i developing web application in jsp, in purpose need change tomcat accessing port. is there possibility? simple !!... can via server.xml goto tomcat>conf folder edit server.xml search " connector port" replace "8080" your port number restart tomcat server. you done!.

windows - Where is guest ring-3 code run in VM environment? -

according white paper vmware has published, binary translation techinology used in kernel (ring 0 codes), ring 3 code "directly executed" on cpu hardware. as observed, no matter how many processes run in guest os, there 1 process in host os. assume guest ring 3 code run in single host process context. (for vmware, it's vmware-vmx.exe). so question here is, how execute many ring 3 code natively in single process? considering of windows exe file don't contain relocation information, cannot executed somewhere else, , binary translation not used in ring3 code. thanks. let's talk vmx , intel vt-x 's design. intel vt-x introduces 2 new modes solve problem: vmx root mode , vmx non-root mode , host , guest respectively. both modes have ring 0~3, means host , guest not share same ring level. a hypervisor running in ring 3 of vmx root mode , when decides transfer cpu control guest, hypervisor lanuch vmlaunch instruction, allows transfer vmx non

java.sql.SQLException: near "ON": syntax error -

hey guys have scoured many other answers , still unable figure out problem. statement.executeupdate("create table if not exists recentlywatched (filename string not null, filelocation string, viewcount integer, primary key (filename))"); class.forname("org.sqlite.jdbc"); connection = drivermanager.getconnection("jdbc:sqlite:media.db"); statement = connection.createstatement(); statement.executeupdate("insert recentlywatched (filename, filelocation, viewcount) values ('" + filename + "', '" + filelocation + "', 0) on duplicate key update viewcount = '1'"); i have tried numerous ways resolve issue , @ loss whenever try insert record "java.sql.sqlexception: near "on": syntax error". update final code looked statement.executeupdate("insert or ignore recentlywatched (filename, filelocation, viewcount) values ('

java - send and receiving message using smack API -

i have setup open fire(jabber server) on local machine 2 user testuser1 , testuser2 .using spark client both users perform chat without issue,it's nice. openfire ip -192.168.1.65 i want use smack api(3.3.0) send , receiving message. have write sender side code send message(with testuser1) , tested spark client(with testuser2) message received on testuser2 side,but when try java code receive sender message ,i not able receive publish messages. sender.java import org.jivesoftware.smack.chat; import org.jivesoftware.smack.xmppconnection; import org.jivesoftware.smack.xmppexception; import org.jivesoftware.smack.packet.message; import org.jivesoftware.smack.messagelistener; public class sender { public static void main(string a[]) throws xmppexception, interruptedexception { xmppconnection connection = new xmppconnection("192.168.1.65"); system.out.println(connection); connection.connect(); connection.login("te