Posts

Showing posts from June, 2012

Mouse & Keyboard press combination keystroke for Mouse click - Autohotkey -

i wannna able press middle button simulating shift+middle button or left button+middle button function (both make same thing) autohotkey. panning middle button in sketchup software. tried many things none of them worked me. for example wrote that: mbutton:: send, {shift & mbutton down} keywait, mbutton mbutton up:: send, {shift & mbutton up} return this function has work x-mouse button's: during function. when press button has press other keys simultaneously. , release in same way. so, can do? i did it! the solution: mbutton::send {shift down}{mbutton down} keywait, mbutton mbutton up::send {shift up}{mbutton up} return

visual studio 2012 - SSRS, combine row and column groups , is it possible -

Image
i have simple report , tried use both row , column groups, , still getting value on rank column in separate lines (1 line per each rank). can display values (77, 22, 44) on single line somehow ? don't need line marked red crosses. note rank pr each loc diff display rank, don't care product, it's ok, display rank , count rank. finished doing pivot in sql, try in rdl. include sample ds here tx mario select 'europe' loc_name, '70' pr_code, 'product 700 man' pr, 'local' race, '96' cc, '1' rk union select 'europe' loc_name, '400' pr_code, 'product 400' pr, 'local' race, '116' cc, '2' rk union select 'europe' loc_name, '70' pr_code, 'product 700 man' pr, 'unknown' race, '37' cc, '1' rk union select 'europe' loc_name, '200' pr_code, 'product 200 women' pr, 'unknown' race, '13' cc, &

node.js - Building rethinkdb from source on Ubuntu -

i trying build rethinkdb source , hitting on error: npm warn engine amdefine@0.1.1: wanted: {"node":">=0.4.2"} (current: {"node":"0.13.0-pre","npm":"2.11.3"}) npm warn engine mime-db@1.13.0: wanted: {"node":">= 0.6"} (current: {"node":"0.13.0-pre","npm":"2.11.3"}) npm http fetch 200 https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz npm err! linux 3.16.0-30-generic npm err! argv "/usr/local/bin/node" "/usr/local/bin/npm" "--userconfig" "/home/myth/rethinkdb/mk/support/config/npm.conf" "--cache" "/home/myth/rethinkdb/external/npm_cache-2colxsuu" "--cache" "/home/myth/rethinkdb/external/admin-deps_2.0.3.fetch-2suk269g/npm-cache" "install" npm err! node v0.13.0-pre npm err! npm v2.11.3 npm err! code enotsup npm err! notsup unsupported npm err! notsup not co

I need help retrieving sub arrays from JSON with a HIVE query -

i have following json. { "_id": "00075602-f58d-49f5-8a82-9b5fb5582443", "activitycountedcollection": [{ "lesson": "98d66ab9-1ef4-4b61-a05d-857b3e07e0f8", "dataset": 1, "datetime": "2013-06-19t15:54:27.79+00:00", "elapsedseconds": 0.0000 }, { "lesson": "kindergarten - play & practice", "dataset": 0, "datetime": "2014-01-01t00:00:00", "elapsedseconds": 0.0, "scores": [{ "dataset": 11, "lesson": "c241ab4b-3d11-4aca-bb9b-a8a645c1e6ca", "activitynode": "ef2d4aae-08ad-48eb-a2e3-0ab616ef2e9c", "datetime": "2013-07-01t15:31:11.81+00:00", "numpossible": 2, "numcorrect": 1,

How to download WordPress with Java -

i want download wordpress java. my code looks this: public void file(string surl, string pathtosave) throws ioexception { url url = new url(surl); sun.net.www.protocol.http.httpurlconnection con = (httpurlconnection) url.openconnection(); try (inputstream stream = con.getinputstream()) { files.copy(stream, paths.get(pathtosave)); } } i using url download latest version of wordpress: http://wordpress.org/latest.tar.gz but when try extracting tar.gz file error saying file not in gzip format. i read issues uncompressing tar.gz file , looks when download wordpress need have cookie enabled accept terms , services. how this? or incorrectly downloading tar.gz file? here tar.gz extracting code: public class unzip { public static int buffer = 2048; public void tar(string pathtotar, string outputpath) throws ioexception { file tarfile = new file(pathtotar); tararchiveinputstream tarinput = new tararchiveinputstream(new gzipinpu

.net - Deserialize stream to object -

i'm trying stream returned amazon object. please see below. private function getreportdata(byval service marketplacewebserviceclient, byval merchantid string, byval reportid string) string dim request new getreportrequest() request.merchant = merchantid request.reportid = reportid request.report = file.open("report.xml", filemode.openorcreate, fileaccess.readwrite) dim data string = nothing dim response getreportresponse = service.getreport(request) using reader = new streamreader(request.report, encoding.utf8) ' value data = reader.readtoend() end using return data end function here example data returned. there no xml data. looks this... "sku fnsku asin product-name reserved_qty reserved_customerorders reserved_fc-transfers reserved_fc-processing vpd-002 b22embmpac b22embmpac product name 3 0 3 0 vpd-002 b22embmpac b22embmpac product name 3 0 3 0 vpd-002 b22embmpac b22embmpac product name 3 0 3

elasticsearch - Do index names such as "logstash-YYYY.MM.dd" positively affect searches? -

do index names such logstash-yyyy.mm.dd , logstash-yyyy.mm , logstash-yyyy positively affect time-based filtering in kibana? example, having daily indexes avoid kibana querying shards in indexes name falls outside given time filter? googling has determined multiple shards for: distributing searches across multiple nodes planning future addition of nodes achieve 1. and logstash-style daily/monthly/yearly indexes for: regularly deleting old documents (since deleting entire index cheaper individually deleting contained documents.) selectively closing old indexes. so if don't need able cycle out (delete/close) old documents, or plan have multiple nodes, benefits daily/monthly/yearly indexes have? these indexes (hence shards) go slow down queries? the important advantage of having indexes in such pattern is:- you define pattern in kibana & pick indexes saving time put indexes manually. for querying in ex logstash-yyyy.mm.dd index, query index ins

sql - What's the best way to have a calculated column that involves multiple tables in a transactional database? -

what's best way have calculated column involves multiple tables in transactional database? background our transactional mysql database includes fact tables following simplified model: create table lu_project( project_id int, project_desc varchar(60) ); create table f_project_budget( project_id int, budget numeric(15, 2) ); create table f_task_budget( task_id int, budget numeric(15,2) ); create table f_money_used( reported_time datetime, task_id int, money_used numeric(15, 2) ); task child of project . task ids not unique, project/task pairs unique. requirements we need preserve invariant total budget tasks project <= budget project. in addition, need run query returns result set following columns: project_id , projet_desc , project_budget , task_count , project_money_used issues we're concerned performance. simplest solution require updates hit 3 fact tables: check adding f_money_used wouldn't put on bu

Get Data for Google Analytics Users Flow Report with API -

google analytics web ui has neat report called "users flow" shows user behavior on website navigate different pages. raw data report understandably not accessible web ui since include many thousands of rows. should available through api however. have read this understand basic framework of how this. however, results i'm getting these efforts don't match see on site, leads me believe making error somewhere. exhibit a: 1 particular interaction i'm investigating users navigating home page particular sub-page. interaction popular , therefore visible in web ui. shows following: home -> page = 9.4k users (doesn't give exact value =/) however, results when investigating thought api not match. basic method this: dimensions="ga"landingpagepath,ga:secondpagepath" metrics="ga:sessions" which gives following result home -> page = 1,993 users i same result following query: dimensions="ga"previouspagepath,ga:pa

javascript - jquery UI sortable with fixed elements on the end -

i have 2 lists, 1 empty. have fixed elements on end, such drag element empty list ends between anchor elements (like bookends). when drag items, end after locked elements (i using items , 'not:' selector exclude anchors). , not between them: <ul id="list1" class="connected"> <li class="anchor">top of list 1</li> <li>item 1</li> <li>item 2</li> <li class="anchor">bottom of list 1</li> </ul> <ul id="list1" class="connected"> <li class="anchor">top of list 2</li> <li class="anchor">bottom of list 2</li> </ul> $( "#list1" ) .sortable({ items: "li:not(.anchor)", connectwith: ".connected"})... i have fiddle demonstrates this: http://jsfiddle.net/97xdq0hj/ even on jquery ui site seems bro

windows - Missing operand in Batch Script -

i think part there's error. code fragment inside loop fyi. set /a used=%size% - %free% set /a percentage=100 * %used% / %size% how implement arithmetic equation? thank much! as others have said, 1 solution problem delayed expansion. your actual code must like: for ... in (...) ( set size=... set free=... set /a used=%size% - %free% set /a percentage=100 * %used% / %size% ) the problem %size% , %free% , , %used% expanded when line parsed, , entire loop (also, parenthesized block) parsed in 1 pass, before loop executed. expand value existed before loop executed, empty in case. one solution use delayed expansion, takes place @ execution time. delayed expansion must enabled before used. setlocal enabledelayedexpansion ... in (...) ( set size=... set free=... set /a used=!size! - !free! set /a percentage=100 * !used! / !size! ) but not necessary if doing set /a computations because set /a command knows how expand variables without doing it

c++ - Check STL bounds in Debug and Release with MinGW -

i'm working on project (settlers 2.5 return roots namely) suffers problems. hope able solve of them using stl containers , bounds checking. so somehow possible use bounds-checking in stl containers in release mode? use (less performing) version, them , crashes/throws on error? the build server uses mingw crosscompile linux windows , apple. edit: []-operator used exclusively. changing .at() require large search-and-replace action got reversed @ point. best be, if there define or switches []-behaviour .at() first approach you can rely on exceptions verify bound checking using stl container. enable in both debug , release mode. for instance std::vector::at throws out of range exception if beyond bounds. second approach if use operator[] , not want change code, can enable _glibcxx_debug flag bound checking.

Sikuli with Selenium Grid integration -

i have integrated sikuli selenium web driver , works fine on local machine. want execute same scripts in remote machines. scripts sikuli based i.e. there hardly web automation. whole project automating desktop application running on different remote machines. think of pos systems running on retail store. as know sikuli image based automation finds elements checking base image against current visible screen.so put simply, works code executes.so not possible on grid execution happens on remote machine there post answers on that.that guy had written blog on autoit,sikuli , other tools selenium grid also go through launchpad discussion and found sikuli remote control interesting. haven't used can try it

javascript - Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node' -

running error on dom manipulation var prependdata = $('#income_ranges').children().first().clone(); var prependeddata = $('#income_ranges').children().last(); var list = document.getelementbyid("income_ranges"); list.insertbefore(prependdata, prependeddata); uncaught typeerror: failed execute 'insertbefore' on 'node': parameter 1 not of type 'node'. i error when run code , dont know why. appreciated. can't test right now, pretty sure error because switching between jquery objects , vanilla js objects. use .get() on jquery object it's vanilla counterpart (see documentation ). so change last line to: list.insertbefore(prependdata.get(0), prependeddata.get(0)); or go full jquery (much prettier in opinion): var prependdata = $('#income_ranges > :first-child').clone(); var prependeddata = $('#income_ranges > :last-child'); prependdata.insertbefore(prependeddata);

javascript - HTML Textarea permanent border color -

i have been trying set color of textarea permanently (not on focus) color.. , not work... using bootstrap( dont know if might have this) reason cant set permanently border color of textarea.. have in css (and have tried other combinations have seen stack overflow) not work. textarea{ width: 650px; min-width:650px; max-width:650px; height:400; min-height:400px; max-height:400px; border-color: red; /*not working*/ } width , height works dont worry that. my textarea in html looks this: <table class="table"> <tr> <td><textarea id="task1" class="form-control"></textarea> </td> </tr> yes, inside table in have several textareas still (dont know if thats reason, dont think so).. thanks! kevin beware have class .form-control define border, set !important textarea or add 1 more class , in css , place rules of class after .fom-control is. o

java - Unable to convert to DEX format -

i'm using unity5, jdk 1.8 , i'm building min android sdk = 10 , max = 22. i can development build without problems when i'm trying create .apk file google play store error. error log: commandinvokationfailure: unable convert classes dex format. see console details. f:/java/jdk\bin\java.exe -xmx2048m -dcom.android.sdkmanager.toolsdir="f:/android/sdk\tools" -dfile.encoding=utf8 -jar "f:/programs/unity5/editor/data/buildtargettools/androidplayer\sdktools.jar" - stderr[ unexpected top-level exception: java.util.zip.zipexception: zip file empty @ java.util.zip.zipfile.open(native method) @ java.util.zip.zipfile.<init>(zipfile.java:220) @ java.util.zip.zipfile.<init>(zipfile.java:150) @ java.util.zip.zipfile.<init>(zipfile.java:164) @ com.android.dx.cf.direct.classpathopener.processarchive(classpathopener.java:244) @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:166) @ com.and

javascript - JQuery - How to implement Cancel Button -

<html> <body> <form class="totalpayment"> <input class="paid" type="text" name="numberone" /> <input class="due" type="text" name="numbertwo" /> <button>add</button> </form> <p class="total"></p> <script src="jquery.min.js"></script> <script> // sum value when submitting form $(".totalpayment").submit(function(e){ e.preventdefault(); var paid = parseint($('.paid').val()); var due = parseint($('.due').val()); $(".total").html(paid + due); }); </script> </body> </html> i have form adds 2 numbers together. issue is, has 1 button, add button. let's wanted add handler cancel button clear 2 boxes, how implement this? just add 1 more button reset form. read

asp classic - SQL group_concat function in SQL Server -

this question has answer here: simulating group_concat mysql function in microsoft sql server 2005? 9 answers if there table called employee empid empname ---------- ------------- 1 mary 1 john 1 sam 2 alaina 2 edward result need in format: empid empname ---------- ------------- 1 mary, john, sam 2 alaina, edward q: record in same employee table. have no experience using udfs, stored procedures, need done thing through query.is possible without using udfs, sp's. for xml path trick , article clr user defined aggregate for sql server prior version 2005 - temporary tables an example of #1 declare @t table (empid int, empname varchar(100)) insert @t values (1, 'mary'),(1, 'john'),(1, 'sam'),

c++ - Winner of a tournament in O(N) and rank of the players in O(NLogN) -

in tennis tournament of n players every player plays every other player. following condition hold- if player p1 has won match p2 , player p2 has won p3, player p1 has defeated p3. find winner of tournament in o(n) time , o(1) space. find rank of players in o(nlogn) time. my solution : input boolean matrix element matrix[i][j] indicates whether player wins player j. bool win[][]= { {0, 0, 1, 1, 1, 0, 1}, {1, 0, 1, 1, 1, 1, 1}, {0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 1, 1, 0, 1}, {0, 0, 1, 1, 1, 0, 0} }; so winner found like, int winner = 0; (int = 1; < player_count; ++i) { if (win[i][winner]) winner = i; } return winner; for getting rank of players, guess topological sorting one. if player 1 wins player 2, edge added lke p1-> p2. if player 1 winner here, have edges other players. topological sorting winner source vertex, give rank of player. solution correct ? there other efficient sol

asp.net - JSON Not Returning Any Results -

i building website based on mvc sql database & asp.net 4 not sure missing trying display table updateable using kendo ui framework. please see below controller: /// <summary> /// reads available products provide data kendo grid /// </summary> /// <returns>all available products json</returns> [httppost] public actionresult read(int take, int skip, ienumerable<sort> sort, kendo.dynamiclinq.filter filter) { using (var db = new sc_newentities12()) { var result = db.sc_opportunities .orderby(p => p.cust_intranetdate_093808085) // ef requires ordered iqueryable in order paging // use view model avoid serializing internal entity framework properties json .select(p => new updateviewmodel { manageuserid = p.manageuserid, cust_customer_070539405 = p.cust_customer_070539405, cust_make_093929971 = p.cust_make_093929971,

Django : form is not saved into my database -

altough form send offer correctly displayed , have no error when submitting offers, not saved in database. know checking admin site, no objects saved. on other hand, have written code registration , users saved in database. i suspect foreignkey relation between 2 models culprit. models.py from django.db import models class user(models.model): username = models.charfield(max_length=30, unique=true, blank=false) password1 = models.charfield(max_length=40, blank=false) password2 = models.charfield(max_length=40, blank=false) mail = models.emailfield(unique=true, blank=false) birthday = models.datefield(blank=false) date = models.datetimefield(auto_now_add=true, auto_now=false, verbose_name="date d'inscription") def __str__(self): return self.username class offer(models.model): publisher = models.foreignkey(user) content = models.textfield() date = models.datetimefield(auto_now_add=true, auto_now=false, verbose_name="date de parution") def __s

r - How can I fix this error with plotweb2 in bipartite package? -

i try build tritrophic network using plotweb2 in bipartite. have 2 diferent quantitative adjacency matrix (one linking level 1 2 , linking level 2 3). the problem become when try use function plotweb2. obtain error: error in dummy[i] <- dummy[i] - lowfreq[which(names(lowfreq) == names(dummy[i]))] : replacement has length zero what problem?? suggestions fix it? my code is: library(bipartite) net1<-read.delim("net1.txt", row.names=1) net2<-read.delim("net2.txt", row.names=1) plotweb2(net1,net2) thank in advance. plotweb2 uses matrices instead of data frames. try converting both objects matrices first library(bipartite) net1<-read.delim("net1.txt", row.names=1) net2<-read.delim("net2.txt", row.names=1) net1 <- as.matrix(net1) net2 <- as.matrix(net2) plotweb2(net1,net2)

vb.net - Word VSTO - Filling a shape does not work in Word 2010 and Word 2013? -

i use following vb.net (vsto) code add shape in ms-word, dim app word.application = globals.thisaddin.application dim doc word.document = app.activedocument dim left single = csng(convert.todouble(app.selection.information(word.wdinformation.wdhorizontalpositionrelativetopage))) dim top single = csng(convert.todouble(app.selection.information(word.wdinformation.wdverticalpositionrelativetopage))) dim shape word.shape = doc.shapes.addshape(1, left, top, 225.1f, 224.5f) shape.fill.backcolor.rgb = colortranslator.toole(color.transparent) shape.fill.visible = microsoft.office.core.msotristate.msofalse shape.fill.transparency = 0.0f shape.line.transparency = 0.0f shape.line.visible = microsoft.office.core.msotristate.msofalse shape.fill.userpicture("c:\newfolder\app1.jpg") what code is, adds rectangle shape @ cursor point, makes transparent (both background , line) , adds (fills) image. this works fine in word 2007 . on word 2010 , word 2013 there issue. adds rectangl

c# - Nested Model returning null in View -

i know question has been asked before struggling find suitable solution. have foreach loop compares values 2 models , decides parent element each belong can see in view (table has expand/close capability) want each group appear under section have been allocated to, when call item.group.groupsectionid returns null every time, when debugging controller populating groupdetail model , sectiondetail model being populated public groupdetail group { get; set; } returning null: view (sectiontable) <table class="table table-striped"> <tbody> <!-- render details of each employee. --> @foreach (var item in model) { <tr> <td>-</td> <td>@html.displayfor(model => item.name)</td> </tr> if (item.group.groupsectionid != 0 && item.sectionid == item.group.groupsectionid) { <tr> <td colspan="3"><p>@html.displayfor(model => item.

Asp.Net textbox is not declared error when textbox is in gridview header -

i adding several textboxes asp.net gridview below header of each column, in order use them filter input fields. the thing when try run following error on each field: error 3 'txts_ap' not declared. may inaccessible due protection level. if take out textboxes outside of gridview, no errors, assume there "special" putting fields within gridview. i appreciate if can on how avoid this. thanks <asp:templatefield > <headertemplate> <asp:linkbutton id="lbap" runat="server" text="ap" style="color:white;" commandname="sort" commandargument="ap"></asp:linkbutton> <br /> <asp:textbox runat="server" id="txts_ap" cssclass="std_searchfields" autopostback="true" ></asp:textbox> </headertemplate> <itemtemplate> <table > &

CodeSign error: entitlements are required for product type 'Static Library' in SDK 'Simulator - iOS 8.4'. Your Xcode installation may be damaged -

i couldn't figure 1 out in xcode have run script build phase runs "xcodebuild" test project on simulator. when run following line in script: xcodebuild -workspace augury.xcworkspace -scheme "augury - production" -destination "platform=ios simulator,name=iphone 5s" test it fails following message: === build target pods-fmdb of project pods configuration debug === check dependencies codesign error: entitlements required product type 'static library' in sdk 'simulator - ios 8.4'. xcode installation may damaged. === build target pods-raven of project pods configuration debug === check dependencies codesign error: entitlements required product type 'static library' in sdk 'simulator - ios 8.4'. xcode installation may damaged. === build target pods-cpanimationsequence of project pods configuration debug === check dependencies codesign error: entitlements required product type 'static library' in sdk '

ios - scrollToItemAtIndexPath before the view is shown the first time -

i have uiview added uicollectionview . view shown on app start up. @ same time i'm scrolling position in collection view. therefore use scrolltoitematindexpath . problem scrolls wrong position, because collection view has wrong size @ beginning: if start ipad in landscape orientation on ios 7 collection view takes 768 width despite in landscape. how can scroll position without user noticing it? in view hierarchy can call it? viewwillappear : frames have not been set viewdidappear : not possible without user noticing it layoutsubviews : called multiple times , need @ startup , when user presses button i tried use layoutifneeded , doesn't edge case (ios 7, ipad, landscape @ startup). constraints kick around time viewdidappear , layoutsubviews called last time. time it's late. you can try inheriting own class uicollectionview , see if layoutsubviews has correct constraints , call scrolltoindex there. if fails, can cheat setting frame sizes in vie

How to mimic C++ "pass array(pointer) by reference" in C? -

sorry cryptic title, i've searched answer, couldn't find one. anyway, i'm trying pass char array function , modify pointer inside array. here example of mean in c++: #include "stdio.h" #include "string.h" void fill(char*& destination, const char* const input, int size) { memcpy(destination, input, size); destination += size; } void inner(const char* const string1, int size1) { const int size2 = 8; char string2[size2] = "world!\n"; char output[20]; char* outputwriter = output; fill(outputwriter, string1, size1); fill(outputwriter, string2, size2); printf(output); } int main() { inner("hello ", 6); } which outputs hello world! and here attempt in c: #include "stdio.h" #include "string.h" void fill(char** const destination, const char* const input, int size) { memcpy(destination, input, size); *destination += size; } void inner(const char* const

Youtube Data API for PHP - Not getting any "publishAt" values -

i want track uploaded videos there scheduled date publishing. uploaded videos , filter them privacystatus "private" won't publishat values. what do wrong?! // call channels.list method retrieve information // authenticated user's channel. $channelsresponse = $youtube->channels->listchannels('contentdetails', array( 'mine' => 'true')); $htmlbody = ''; foreach ($channelsresponse['items'] $channel) { // extract unique playlist id identifies list of videos // uploaded channel, , call playlistitems.list method // retrieve list. $uploadslistid = $channel['contentdetails']['relatedplaylists']['uploads']; $playlistitemsresponse = $youtube->playlistitems->listplaylistitems('snippet', array( 'playlistid' => $uploadslistid, 'maxresults' => 50 )); $htmlbody .= &

Spring OAuth 2 Call /oauth/token Resulted in 401 (Unauthorized) -

greeting everyone, try configure simple authorization code flow via spring security oauth. i tested authorisation , resource server configuration via following approaches: create web application client , use page fire http post call /oauth/authorize. after getting code, use same page fire http post code , token. at end, use curl -h place token inside header , response protected resource. but when try use rest template. throw error message 401 unauthorised error. server side - security configure: <http auto-config="true" pattern="/protected/**" authentication-manager-ref="authenticationmanager"> <custom-filter ref="resourcefilter" before="pre_auth_filter" /> <csrf disabled="true" /> </http> <http auto-config="true"> <intercept-url pattern="/**" access="hasrole('role_user')" /> <form-login default-target-url="

c# - Max Value from a field as a condition -

i'm trying use max value of field condition delete several rows. in case it's numdoc. i want check max value of it, i'm new sql , i'm not being able to. using c# , mysql, code have right this: querystring = "delete wgcdoccab numdoc = max(numdoc) serie ='1' , tipodoc ='fss' , contribuinte ='999999990' , datadoc = convert(varchar(10),(dateadd(dd, -1, getdate())),120) "; this might newbie question , i'm sorry if case, answer, or whether there better way trying achieve. edit: conditions deleting are: value serie must equal 1, tipo doc must equal fss , date, must of previous day, schema, deleting rows line line, fall condition thats why want use max can check fields 1 one do\while cycle sorry if dont explain well, english not mother language. assuming condition delete rows have maximum value of numdoc filtered other conditions, delete wgcdoccab numdoc = ( select max(numdoc) wgcdoccab serie ='1'

Setting Autoincrement in SQL Server 2012 -

Image
i in designer trying enable auto increment , when trying save changes error shows, using sql server 2012 management studio. does know why? thank you. this feature in management studio prevents accidentally dropping , re-creating table without knowing it. can turn off in tools -> options -> designers -> "table , database designers" - option "prevent saving changes require table re-creation". you should turn off caution feature trying prevent causing issues. recommend against development servers, or better generate script , execute instead. way know commands being executed.

osx - How to show window using command line in Mac -

i work several webstorm projects opened (sometimes 5 or 6) , gets annoying have keep searching through desktops find right one. make worse, mac changes order of desktops, can't know project , have search through of them. does know if there's command line can run show specific window? e.g. have terminal window opened 3 tabs, projects 1, 2 , 3, , want go on project 2 terminal tab , type show me desktop webstorm window of project 2 showing. possible @ all? i know can run $ wstorm . open project, if run project opened nothing happens. thanks! the osascript command can used if window names contain text can used identify them. using example textedit, having 2 windows open, 1 file "file1.txt" , other "file2.txt", following command show window "file2.txt" osascript -e $'activate application "textedit"\ntell application "textedit" set index of window 1 name contains "file2" 1'

r - Make regression equation in monthly time series data in Rstudio? -

i'd analysis of monthly rainfall data (make time series plot + regression equation time series). i've written code in r , plot monthly time series data , i've tried make different regression equations (linear , nor linear) , show these equation on same graph of time series plot unfortunately cannot may because i'm new user of r/ rstudio statistical packages. can me? many in advance. data style date monthly rainfall (mm) jan94 12 feb94 11 . . . dec14 1x the code # plotting of time series rainfall data (option1) # step1: read files mr<-read.table("c:\\users\\salam\\desktop\\trend kufa\\csv2 habel\\monthly rainfall.csv", header=t,sep=",") summary(mr) names(mr) mr # step2: plot observed discharge mr1<-mr[c(1:252),2]; summary (mr1) mr1 class(mr1) require(zoo) x <- yearmon(1994 + seq(0, 251)/12) x y<-mr1 y pcp<-y~x plot(pcp,type="l", xlab="month",ylab="monthly rainfall(mm)", axe

function - Parsing(removing extra space,encoding) multiple attributes through same funtion in python -

i trying parse data html file. extract various information , store in respective attributes.however before printing results/attributes in csv file need remove unwanted special characters , encode attribute values. address2='#4th avenue' price='price $45' address2 = address2.encode('utf-8') address2= re.sub('[,!@#$&]','',address2) address2=address2.lstrip() address2=address2.rstrip() address2=address2.strip() price = price.encode('utf-8') price= re.sub('[,!@#$&]','',price) price=price.lstrip() price=price.rstrip() price=price.strip() expected output: price: price 45 address2: 4th avenue i getting result expected need apply strip , encode each , every attribute. there way create function can pass attributes in function . instead of applying strip/encode each attribute. something def cleanup(temp): temp = temp.encode('utf-8') temp= re.sub('[,!@#$&]',&#

node.js - nodejs connect mongo have memory leak -

in node.js use expressjs , when connect mongodb, have trouble , have no idea why happens. search it's unclear. (node) warning: possible eventemitter memory leak detected. 11 reconnect listeners added. use emitter.setmaxlisteners() increase limit. trace @ addlistener (events.js:179:15) @ server.connect (/home/repository/nodejs/blog/n-blog/node_modules/mongodb/lib/server.js:291:17) @ open (/home/repository/nodejs/blog/n-blog/node_modules/mongodb/lib/db.js:206:19) @ db.open (/home/repository/nodejs/blog/n-blog/node_modules/mongodb/lib/db.js:229:44) @ function.user.get (/home/repository/nodejs/blog/n-blog/models/user.js:55:10) @ context.<anonymous> (/home/repository/nodejs/blog/n-blog/test/models/userspec.js:63:9) @ test.runnable.run (/home/repository/nodejs/blog/n-blog/node_modules/mocha/lib/runnable.js:233:15) @ runner.runtest (/home/repository/nodejs/blog/n-blog/node_modules/mocha/lib/runner.js:390:10) @ /home/repository/nodejs/blog/n-

cq5 - How to give user permissions programatically? -

i know can give permissions in ${host}:4502/useradmin when double click user login , go permissions tab i want give permissions when deploy content package. is possible? when give permission user particular node/path , stores permission on node level below rep:policy node (allow/deny). i want give permissions when deploy content package. you can deploy aem package containing rep:policies serve same purpose of setting permissions through useradmin. you can refer acl packager acs tools packaging acls. note : user installing package needs have permission set acls to programmatically set acls (as title of question says), might care check out few jackrabbit/jcr interfaces/classes . org.apache.jackrabbit.api.security.jackrabbitaccesscontrolmanager org.apache.jackrabbit.api.security.jackrabbitaccesscontrollist javax.jcr.security.privilege

How can I download google maps of a certian area and use it for my plot [R]? -

Image
i trying use lat-log data plot on google maps. tried download google maps , use plotting values. here's how tried download couldn't understand function properly: let's say: data.lat.long <- data.frame(lat=c(2,3,4,5,6,7,3,7,8,9,2),long=c(3,7,8,9,2,1,2,3,4,5,6),c=c(1,1,1,2,2,1,1,1,1,2,2)) data <- data.lat.long %>% mutate(mean_lat = mean(latitude)) %>% mutate(mean_long = mean(longitude)) library(rgooglemaps) getmap(center = c(lat = data$meanlatitude, lon = data$meanlongitude), size = c(640, 640), destfile = "c:/m/googlemaps/", zoom = 12, sensor = "true", maptype = c("terrain"),format = c("gif"), returnimage = true, grayscale = false, newmap = true, scale = 1, api_console_key = null, verbose = 0) what trying is: have calculated max , min lat-long points. , want download region [from maximum latitude minimum latitude & maximum longitude minimum longitude]. basic usage ggmap : library(dplyr) library

How to submit a form that has data for 2 models on Spring and let it validate them? -

suppose have 2 tables: users , preferences. users table has columns username, password , email. preferences table has columns contact_me_by_email, contact_me_by_phone_call, contact_me_by_sms. each table has it's own model (user , preferences). i want present 1 page users when fill in data in form data validated , populate both tables. i'm able parameters 1 form accessing request object , manually performing validations , proceed according results get. also, can use @validate annotation validate models when present 2 pages user (each page having 1 model - first page contains data user model , second 1 contains data preferences). i'm struggling discover way present 1 page form contains fields both models above validated spring using @validate annotation. is possible? there other annotation i'm not aware of it? any appreciated. regards. so, here user mode class : @entity @table(name = "user") public class user(){ // fields of u

r - Reshape and mean calculation -

i have climatic data have been collected during whole year along altitude gradient. shaped that: clim <- read.table(text="alti year month week day meantemp maxtemp mintemp 350 2011 aug. 31 213 10 14 6 350 2011 aug. 31 214 12 18 6 350 2011 aug. 31 215 10 11 9 550 2011 aug. 31 213 8 10 6 550 2011 aug. 31 214 10 12 8 550 2011 aug. 31 215 8 9 7 350 2011 sep. 31 244 9 10 8 350 2011 sep. 31 245 11 12 10 350 2011 sep. 31 246 10 11 9 550 2011 sep. 31 244 7.5 9 6 550 2011 sep. 31 245 8 10 6 550 2011 sep. 31 246 8.5 9 8", heade