Posts

Showing posts from February, 2010

tsql - Running Totals with debit credit and previous row SQL Server 2012 -

i having problems in recalculating running totals. i have situation have duplicate transactions , these must deleted , and initial , closing balance must recalculated based on amount , taking account when isdebit. my attempt have nested cursors (parent-child) , parent select distinct bookingno , child calculation looks messy , didn't work, didn't post because didn't want confuse things. i know in sql server 2012 can use ( sum on partition by ) cannot figure how handle deleted row etc.. below did far --create table testing if object_id(n'testtransaction', 'u') not null drop table testtransaction go create table [testtransaction] ( [id] [bigint] identity(1,1) not null, [bookingno] [bigint] not null, [isdebit] [bit] not null, [amount] [decimal](18, 2) not null, [initialbalance] [decimal](18, 2) not null, [closingbalance] [decimal](18, 2) not null ) on [primary] go i

sql server - Microsoft SQL single character full text search works with 25 out of 26 letters - but not "n" - returns all rows -

found interesting issue quick search if single character search, 25 characters work fine, 1 doesn’t – “n” quick search select of form: select* some_full_text_table contains(the_full_text_field, ' "n*" ') this should search full text field in table beginning “n”. example data rows: “name1 foo bar cardiac” “aname foo2 echo” “some name foo3 ct” “the requested letter” the query should return rows 1 , 3 1 have words begin “n”. the actual result rows returned, row 4, has no n’s @ all. i believe sql bug. “na*” works expected , returns 1 , 3. looking solution or work around here example sql 2014 create table testfulltextsearch ( id int not null, alltext nvarchar(400) ) create unique index test_tfts on testfulltextsearch(id); create fulltext catalog ftcat_tfts; create fulltext index on testfulltextsearch(alltext) key index test_tfts on ftcat_tfts change_tracking auto, stoplist off go /* no n's in data */ insert testfulltextse

html - CouchCMS - Floated Elements Not Floating Properly -

i'm new here , of beginner in html , css. i'm working on project using both couchcms content management , bootstrap responsive framework. give short background, i've set custom.css file , have linked accordingly website bootstrap css. i'm going through steps create "blog list" page list blog snippets on 1 page, , what's happening sidebar appearing on right, below first element instead of side side. what i've noticed 1 post on page shows way it's supposed to, 2nd added moves bottom half of page on right. here code: #main { width: 90%; margin: 40px auto; } #news-content { float: left; width: 60%; margin: 0 3% 0 5.5%; border-radius: 10px; background-color: white; } #my-sidebar { float: right; width: 26%; height: 100%; margin: 0 5.5% 0 0; border-radius: 10px; background-color: white; } #cms-blog { width: 90%; height: inherit; margin: 25px 0 0 5%; } <div id="main">

angularjs - protractor browser.pause() debugger exists Selenium -

i'm using protractor 2.1.0 webdriver. i've got test want debug put in browser.pause() command. 'allows deleting level versions', -> browser.get('/api#/costings') element(by.id("edit")).click() element(by.id("versions")).click() count=element.all(by.id("listing")).count() first=element.all(by.id("listing")).first() browser.pause() expect(element.all(by.id("listing")).count()).toequal(parseint(count) - 1) this stopped tests @ point opening webdriver debugger. type single character shuts down selenium. i'm trying type in 'repl' enter interactive mode. ------- webdriver debugger ------- starting debugger agent. debugger listening on port 5858 ready press c continue next webdriver command press d continue next debugger statement type "repl" enter interactive mode type "exit" break out of interactive mode press ^c exit controlflow::1 | fram

javascript - Re-rendering a ReactJS component hangs browser -

i've been experimenting creating component based ui using reactjs, versus usual slapdash approach of million global functions, variables , non-reusable markup. far react i've hit stumbling block. consider following component layout eventview eventviewsidebar eventviewlist eventviewlistrow eventviewdetail in layout, multiple occurrences of eventviewlistrow present each unique key. clicking instance of eventviewlistrow should update eventviewdetail details of item. this render function top level eventview component: render: function () { return ( <div classname="event-view row-fluid"> <div classname="event-view__sidebar col-md-4"> <eventviewsidebar projectid={this.state.projectid} /> </div> <div classname="event-view__content col-md-8" id="eventdetail"> </div> </div> ); } and eventviewdetai

VBA copying multiple rows in Excel sequence and pasting to different excel sheet -

i found info on forum haven't been able understand it. need copy specific rows (range) in sequence 1 excel sheet new sheet data plotting. can please me visual basic code? my data looks this: http://imgur.com/1vm12xd what need combine a1-1:e1-1 , a1-2:e1-2 data side side, in want d5:d9 side side d19:d23 . similarly, e5:e9 side side e19:e23 . these combinations can done creating new sheet hope. then think need run loop combine a2-1 , a2-2 data. a2 data starts @ row 32. spacing maintained throughout spreadsheet. think 1 should able put in loop go through entire sheet. there spaces in between data (rows), not sure how tell program run through entire sheet. sub copydata() lastrow = activesheet.range("a" & rows.count).end(xlup).row = 8 lastrow range(cells(i, 1), cells(i, 4)).select selection.copy erow = activesheet.cells(rows.count, 1).end(xlup).offset(1, 0).row activesheet.cells(erow, 1).select activesheet.paste activeworkbook.save activeworkbook.cl

How do I limit the results of a php query based on the value of a javascript variable? -

originally had where class_id = 3 in php query learned more server-side things realized wouldn't able change once page loaded without ajax or something. i've taken away where part of query , getting results class_id 's. my hope can use radio limit rows returned matching radio button checked. ex. click class 2 radio button, click go, , rows class_id = 2 show up. <input type='button' name='go' value='go' onclick='getselected()'> function getselected() { var queryclass = ""; if (classthree.checked) { queryclass = 3; } else if (classtwo.checked) { queryclass = 2; } else if (classone.checked) { queryclass = 1; } } i can desired value don't know value limit rows. if possible it'd great know how.

javascript - Add formatting based on response - POST data sent to email using PHP -

i have form people can fill in there details , share current timetable. go , find times suit people , sort them groups. currently php form prints variable either 'work' or 'free' (based on selection in form) table , send email contact details , timetable. is possible assign text color or cell color value particular cell of table, when sending form? (so when receive email cells have 'free' variable in them colored green etc.) <?php $name_f = $_post['name_f']; $name_l = $_post['name_l']; $phne = $_post['phne']; $cont_em = $_post['cont_em']; $mon09to10h = $_post['mon09to10h']; $tue09to10h = $_post['tue09to10h']; $wed09to10h = $_post['wed09to10h']; ... $to = "email@email.com"; $subject = "new message"; ... $message = <<<eod new form submitted<br><br> <b>name:</b> $name_f $name_l <br> <b>phone:</b> $phne <br>

c# - EF6: Renaming namespace using Code First Migrations -

it possible me rename namespace of entire project (including of course: dbcontext class, migrations configuration classes, etc) without breaking or having recreate migrations? say, have project myproject, namespace is foo.myproject and configuration classes in foo.myproject.migrations say want rename foo namespace bar , , of course configurations namespace be bar.myproject.configurations is there correct way of doing , maintain current migrations still working? these ways involve manually editing ___migrationhistory table or something? (at glance see contextkey column, suspect should manually edit.) yes, indeed need update contextkey in the__migrationhistory table. code: update [dbo].[__migrationhistory] set [contextkey] = 'new_namespace.migrations.configuration' [contextkey] = 'old_namespace.migrations.configuration' a read on topic of renaming namespaces ef6: http://jameschambers.com/2014/02/changing-the-namespace-with-entity-fr

python - Do you have to check if an array element exists (not null string) in Python3? -

if associative array exists in python3, waste check if element of exists rather using it? should you: if 'name' in array , not array['name'].startswith('something'): or should just: if not array['name'].startswith('something'): ... , python3 handle "for" you? you can - if not array.get('name', 'something').startswith('something'): get() function returns second value default if key ( name ) not found. so in above case , return something , if key not found in dictionary, , because of .startwith() , not , complete conditional expression evaluate false , doing in op's first example .

What if someone knows the Secret Key (signature) of your JSON Web Token? -

if knows secret key , alters lets example username of json token , expiry time, able access secured data on sever? you need 5 different parameters access token - grant_type, username, password, client_id, client_secret so, knowing secret key, username not token; knowing password get. precisely means token if he/she knows parameters, else not!

how print file content to stdout in vxWorks? -

i'm using putty telnet robot controller. need equivalent of "cat" command in vxworks, or workaround print content of text file stdout. how can it? the copy function overloaded handle this. call 1 filename argument , stdout assumed second argument, e.g.: -> copy "foo.txt" bar -> http://www.vxdev.com/docs/vx55man/vxworks/ref/usrfslib.html#copy

ruby on rails - How do I get Bundler gem to work without doing /bin/bash --login -

i've been following lot of instructions on how fix rails installation without understanding everything. can create new rails app now, if type /bin/bash --login in terminal first. if don't first, the rails new command fails when gets part with bundle install this first line of error message when fails: /usr/lib/ruby/2.2.0/rubygems.rb:243:in `bin_path': can't find gem bundler (>= 0) (gem::gemnotfoundexception) is there path setting or can fix can make new rails app in virgin terminal window? also, bin/bash --login do? doesn't change command prompt, , thought logged in when entered password start linux. i recommend use: rails <version> new <appname> ... <version> rails version wish use (e.g. _4.2.0_ ) , <appname> name of app wish create. make sure @ root of workspace when run command. /bin/bash --login invoke bash non-interactive shell , execute commands /etc/profile . after reading file, looks ~/.bash_

jinja2 - How can I pass JSON data into a Nunjucks template? -

i want use nunjucks templates want pass in own json data used on templates. the documentation here pretty sparse. https://mozilla.github.io/nunjucks/templating.html thank you. you can use gulp-data allows pass json files task runner you're using render nunjucks. gulp.task('nunjucks', function() { return gulp.src('app/pages/**/*.+(html|nunjucks)') // adding data nunjucks .pipe(data(function() { return require('./app/data.json') })) .pipe(nunjucksrender({ path: ['app/templates'] })) .pipe(gulp.dest('app')) });

oop - Inheritance behaviour in java -

can explain , why shows error in eclipse , run without error.i have paste code below. parent class: public class parent { /*parent class method*/ public void show() { system.out.println("parent class show called"); } } child class: public class child extends parent { /* child class overridden method*/ private void show() { // line show error in eclipse system.out.println("child class show called "); } public static void main(string[] args) { parent p = new child(); p.show(); } } output is: parent class show called this happening because eclipse compiler can create class files in presence of compilation errors. please follow below link . http://help.eclipse.org/mars/index.jsp?topic=%2forg.eclipse.jdt.doc.user%2fconcepts%2fconcept-java-builder.htm but if open child class created in java decompiler see below code. public class child extends parent {

triggers - How do I increase the maximum length of a MySQL error message? -

i wrote before insert trigger on particular table in database in order impose value constraints. code returns semicolon-separated list of errors. intent have flask app return list of user-defined error messages client. however, if more 1 error occurs, message gets cut off mid sentence. here sort of redacted error message: the specified xxxxxxx xxxxx xxxxxxxx (105) exceeds maximum value (100).; specified xxxxxxx xxxxxxx xxxxx xxxxxxxx (90) here of code trigger: begin declare rtn text; declare error boolean; -- declare variables here -- select values variables -- check new row fields against variables if error signal sqlstate '02001' set message_text = rtn; end if; assuming using php, there maximum limit exception messages. defined log_errors_max_len in php.ini. refer here more details https://bugs.php.net/bug.php?id=31955 you can try , change that. but suggest using stored procedure/function insert data. can

ruby on rails - Refreshing or updating partials -

so have 2 models. facilities , availability. each facility has many availabilities. on facilities page, have partial lists out availabilities current facility. i'm trying allow crud operations on availabilities. delete works fine, through ajax , use jquery delete row in table. i'm having trouble create , update. i'm able them remotely reflecting change without reloading page has stumped. this partial looks like : <tbody class="availabilitycontainer"> <% facility_availabilities?.each |a|%> <tr id="availability_<%= a.id %>"> <td id="date_<%= a.id %>"><%= a.start_time.strftime("%a, %b %d %y") %></td> <td id="time_<%= a.id %>"><%= a.start_time.strftime("%i:%m %p") %> - <%= a.end_time.strftime("%i:%m %p") %></td> <td id="price_<%= a.id %>"><%= number_to_currency a.price

python - Changing Django Timezone setting -

we have "erp like" project use_tz = false in our settings , set time_zone desired zone requested each client, since each client different site (each client has it's own wsgi proccess , settings file) but moving django tenants (it gets hostname in middleware , changes db schema according it). , 1 settings file rule them all. trying emulate previous behavior wrote middleware change timezone using django.utils.timezone.activate if call datetime.datetime still getting time using settings.time_zone instead "activated" timezone. how should dealing timezone in scenario? additional info: it important same timezone user on same subdomain(tenant) independently of location of each user. we using postgresql timestamp time zone fields. al operations should remain date/time have.

regex - Deleting back to back substrings from a string but not all occurences - c# -

i have string like: "water water asdf fdsa" as strings like: "water water asdf fdsa water" i need remove first instance of back substrings these 2 cases become: "water asdf fdsa" , "water asdf fdsa water" what tried do: list<string> substrings = findsubstrings(returnstring); ienumerable<string> duplicateitems = x in substrings group x x grouped grouped.count() > 1 select grouped.key; so have seperate findsubstrings method returns list contains substrings original string. (from online found) way detect duplicates list of them placed in ienumerable. is best way go like: (int = 0; < substrings.count; i++) { //if duplicateitems contains substring , substring[i+1] same item, remove it) } the issue cant string duplicateitems if contains more 1 duplicate substring

angularjs - Angular sends the ID in the request body instead of URL -

here resource definition: app.factory('program', ['$resource', function ($resource) { return $resource(host + '/rest/program/:id/:action', {}, {query: {method: 'get', isarray: false}}); }]); when call program.save({id:3,name:'foo'}); sends request post /rest/program , places {id:3,name:'foo'} in request body. shouldn't send update request /rest/program/3 , put {name:'foo'} in request body. try this: app.factory('program', ['$resource', function ($resource) { return $resource(host + '/rest/program/:id/:action', { id: '@id', action: '@action' }, { query: { method: 'get', isarray: false } }); }]); you might need pass them parameters too.

javascript - How to use Regular expression to test for FIle Names with special characters -

i trying use open source image uploader: https://github.com/blueimp the documentation says function match on file type can used match on file name also. https://github.com/blueimp/jquery-file-upload/blob/7d46990486ff08acfc001b6368b09bce6712c2c2/js/jquery.fileupload-validate.js can see way use match on , restrict special characters in file names? here regex match characters want exclude. trying prevent end users using special characters in file names, instead of depending on training them. english concern in case. [&~@#$^*()_+=/:?;\\|<>"',!%] here snipit source code (open source) evaluate it. full code available @ link above. // file upload validation plugin extends fileupload widget // file validation functionality: $.widget('blueimp.fileupload', $.blueimp.fileupload, { options: { /* // regular expression allowed file types, matches // against either file type or file name: acceptfiletypes: /(\.|\/)(gi

python - Convert a very large base n number to bytes -

i have large number in base n ( n specified user), stored array each element representing digit. u[0] highest digit, u[1] second highest, u[-1] lowest digit , on. leading zeros understood meaningless: instance, if n 8, [0, 0, 0, 4, 7, 3] equivalent [4, 7, 3] , both equal (473) in base 8, or 315 in base 10, or 13b in hex, or [1, 59] byte array. i want convert array of bytes correspond base-256 representation of same number, minimal leading zeros. have following code so: def base_n_to_byte_array(digits, from_base): """ converts base n number byte array. :param digits: digits of number, starting highest. :param from_base: base in number given. """ x = 0 n = len(digits) in range(0, len(digits)): x += digits[i] * int(math.pow(from_base, n - - 1)) min_length = max(math.ceil(math.log(x, 256)), 1) byte_array = x.to_bytes(min_length, byteorder='big') return byte_array this works smaller

ios - Swift 2: Type of expression is ambiguous without more context -

class example: nsobject, uiviewcontrolleranimatedtransitioning, uiviewcontrollertransitioningdelegate { var aview : uiview! uiview.animatewithduration(duration, delay: 0.0, usingspringwithdamping: 0.8, initialspringvelocity: 0.8, options: nil, animations: { self.aview.transform = cgaffinetransformidentity //this line throwing error mentioned in title }, completion: { finished in transitioncontext.completetransition(true) }) } this working in earlier version of swift failing in version 2 not sure why you have change uiview.animatewithduration(duration, delay: 0.0, usingspringwithdamping: 0.8, initialspringvelocity: 0.8, options: nil, animations: { with: uiview.animatewithduration(duration, delay: 0.0, usingspringwithdamping: 0.8, initialspringvelocity: 0.8, options: [], animations: { there "options" change.

c++ - How to check for equals? (0 == i) or (i == 0) -

okay, know following 2 lines equivalent - (0 == i) (i == 0) also, first method encouraged in past because have allowed compiler give error message if accidentally used '=' instead of '=='. my question - in today's generation of pretty slick ide's , intelligent compilers, still recommend first method? in particular, question popped mind when saw following code - if(dialogresult.ok == messagebox.show("message")) ... in opinion, never recommend above. second opinions? i prefer second one, (i == 0), because feel more natural when reading it. ask people, "are 21 or older?", not, "is 21 less or equal age?"

jhipster - Displaying APIs of Spring Data Rest -

after adding spring data rest jhipster generated project, how make rest apis viewable in addition of apis on controller level? @repositoryrestresource(collectionresourcerel = "api/myentities", path = "api/myentites") i try "/api/myentities". in spring data rest, able see rest apis like /api/myentities/search/<method name> the following swaggerconfiguration class in project. don't see how can customize show apis spring data rest. @configuration @enableswagger2 @profile("!"+constants.spring_profile_production) public class swaggerconfiguration implements environmentaware { private final logger log = loggerfactory.getlogger(swaggerconfiguration.class); public static final string default_include_pattern = "/api/.*"; private relaxedpropertyresolver propertyresolver; @override public void setenvironment(environment environment) { this.propertyresolver = new relaxedpropertyresolver(environment, "s

android - AutoCompleteTextView with CursorAdapter works on virtual device, but not on physical device -

this autocompletetextview working fine, until created filterqueryprovider , passed adapter's setfilterqueryprovider method. i'm trying alow user input either contact's name or phone number, , have relevant contacts show up. here's relevant code: //set behavior recipient field. autocompletetextview destination = (autocompletetextview) findviewbyid(r.id.destination_number); //get list of contacts, add array adapter. /* arraylist<string>[] contactnames = getcontactlist(); arraylist<string> contactnumbers = getcontactnumbers(contactnames[1]); */ //initialize cursoradapter. final contentresolver cr = getcontentresolver(); cursor namecursor = cr.query(contactscontract.commondatakinds.phone.content_uri, new string[]{contactscontract.commondatakinds.phone._id, contactscontract.commondatakinds.phone.display_name, contactscontract.commondatakinds.phone.number, contactscontract.commondatakinds.phone.type},

java - Connection to Weblogic JMS Queue fails -

i trying write message jms queue running on weblogic java.rmi.connectioexception when trying connect eclipse program. javax.naming.communicationexception [root exception java.rmi.connectioexception: error during jrmp connection establishment; nested exception is: java.io.eofexception] @ weblogic.jrmp.context.lookup(context.java:189) @ weblogic.jrmp.context.lookup(context.java:195) @ javax.naming.initialcontext.lookup(unknown source) @ example.jms.queue.jmssender.sendmessage(jmssender.java:42) @ example.jms.queue.jmssender.main(jmssender.java:130) caused by: java.rmi.connectioexception: error during jrmp connection establishment; nested exception is: java.io.eofexception @ sun.rmi.transport.tcp.tcpchannel.createconnection(unknown source) @ sun.rmi.transport.tcp.tcpchannel.newconnection(unknown source) @ sun.rmi.server.unicastref.newcall(unknown source) @ weblogic.jrmp.baseremoteref.invoke(baseremoteref.java:221) @ weblogic.jrm

awk - Using bash to search for a string in the second column -

i'm trying write function looks last name (from user input) in second column , returns line user. here i've tried (and not working). importantly, when run last name in place of $input_name @ command line, works then. can see, echo confirm user input read properly. missing? 60 last_search () { 61 echo "what last name looking for?" 62 read input_name 63 echo "$input_name" 64 awk -f':' '$2 ~ /$input_name/{print $0}' temp_phonebook 65 } use -v name=value pass shell variable awk shell variable won't expanded in single quote print $0 default action take out. you can use: awk -f: -v input_name="$input_name" '$2 ~ input_name' temp_phonebook

php - What's the best way to install a PECL extension (libsodium) for unit testing with Travis CI? -

i'm trying add continuous integration project called halite , uses libsodium encrypt cookies before storing them on end-user's device. however, can't seem travis.yml right. these issues encountered: adding extension=libsodium.so did not lead extension being loaded (thus, class sodium not found fatal errors). changing extension=/path/to/libsodium.so caused fatal error phpapi versions mismatched. i can run tests locally, i'd use travis ci diagnose issues in pull requests. run pecl install without sudo. pecl should automatically enable extension shouldn't need config file , extension= line enable it.

javascript - Cannot load oauth.io (oauth.js) in firefox Extension -

i have tried load oauth.io js file downloaded https://github.com/oauth-io/oauth-js/tree/master/dist using oauth = require("lib/oauth.min.js"); i got following error in debug console. console.error: test: message: referenceerror: window not defined stack: [8]</<@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:20165 [8]<@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:20107 e@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:212 a@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:387 @resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:1 cuddlefishloader/options<.load@resource://gre/modules/commonjs/sdk/loader/cuddlefish.js:79:18 background@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/background.js:52:10 please me use oauth.io js file authorize google using oauth. it looks you're trying load background (main). main

python - Loading STATA file: Categorial values must be unique -

i trying load .dta file behind zip file pandas . however, error. have stata @ command, since error message doesn't tell me more, faulty column, have no clue do. how can load file pandas ? >>> df = pd.read_stata('cepr_org_2014.dta') traceback (most recent call last): file "<input>", line 1, in <module> file "/usr/local/cellar/python/2.7.8_1/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/pandas-0.15.2-py2.7-macosx-10.9-x86_64.egg/pandas/io/stata.py", line 69, in read_stata order_categoricals) file "/usr/local/cellar/python/2.7.8_1/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/pandas-0.15.2-py2.7-macosx-10.9-x86_64.egg/pandas/io/stata.py", line 1315, in data cat_data.categories = categories file "/usr/local/cellar/python/2.7.8_1/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/pandas-0.15.2-py2.7-macosx-10.9-x86_64.egg/pandas/core/

windows - I need to automate running commands in CMD with a batch file -

i need project. goal open batch program open cmd, automatically run few commands. have tried couple scripts found online. happens cmd opens, shows few errors "end not internal or external command.", closes. helpful if 1 of guys gave me batch script input commands into, make batch program. also, don't think matter running windows 8.1 on 64-bit computer. p.s. here script used before: private sub cmdautomate() dim sipdomain textbox = txtcommand dim myprocess new process dim startinfo new system.diagnostics.processstartinfo startinfo.filename = "cmd" startinfo.redirectstandardinput = true startinfo.redirectstandardoutput = true startinfo.useshellexecute = false startinfo.createnowindow = true myprocess.startinfo = startinfo myprocess.start() dim sr system.io.streamreader = myprocess.standardoutput dim sw system.io.streamwriter = myprocess.standardinput sw.writeline(**command want enter**) sw.writelin

google analytics - Unique Goal Starts -

currently pulling data google analytics api each day (php). dimensions of data pull include: - date - hour - minute metrics include - sessions - goalxstarts - goalxcompletions (start , completion same goal). the issue when including hour or minute dimension, number of starts appears include duplicates. example, if have 1,000 goalxstarts day. when including hour , minute dimensions in api call, might reflect 1,500 goalxstarts. when running report in google analytics web interface (custom report) hour , minute dimension, goalxstarts metric not appear have duplicates. i should note goalxcompletions not duplicate when including hour , minute dimensions in api call. does know how retrieve unique goalxstart metrics google analytics api? appreciated...

ios - Attempting to save an event in EKEventStore crashes the app -

i have odd bug in app. attempting save event using saveevent causes app continue in 1 of 3 ways: everything gets saved correctly , without issues the app crashes unrecognized selector sent instance error, offending selector constraints: , object it's sent different , rather unpredictable (they private sdk classes) the app crashes exc_bad_access error in trying debug this, i've stripped app view controller listing events, button add new one. first time present view controller add event, goes smoothly, second time this, throws error. here code use: self.event = ekevent(eventstore: self.eventstore!) self.event!.calendar = self.calendar! self.event!.startdate = self.defaultstartdate() self.event!.enddate = self.event!.startdate.datebyaddingtimeinterval(3600) var error: nserror? self.eventstore!.saveevent(self.event!, span:ekspanthisevent, error: &error) if let e = error { println("saving error: \(error)") } if values calendar , startdate o

unix - subprocess Popen in python with command that changes environment -

i'm trying run python script python using subprocess module , executing script sequentially. i'm trying in unix before launch python in new shell need execute command (ppack_gnu) sets environment python (and prints lines in console). the thing when run command python subprocess process hangs , waits command finish whereas when in unix console jumps next line automatically. examples below: from unix: [user1@1:~]$ ppack_gnu; echo 1 appear in prefix (shell=/opt/soft/cdtng/tools/ppack_gnu/3.2/bin/bash) 1 [user1@1:~]$ from python: processes.append(popen("ppack_gnu; echo 1", shell=true, stdin = subprocess.pipe)) this print entering gentoo prefix /opt/soft/cdtng/tools/ppack_gnu/3.2 - run 'bash -l' source full bash profiles in python console , hang... popen() not hang: returns while ppack_gnu may still running in background. the fact see shell prompt not mean command has returned: ⟫ echo $$ 9302 # current shell ⟫ bash ⟫ echo $$ 12131

Command line install valgrind and gdb on Majaro -

does provide me command line install valgrind , gdb on manjaro(archlinux) ? kind regards you can install both packages @ once with: sudo pacman -s gdb valgrind

Why redis cluster resharding is not automatically? -

when add node in redis cluster, has 0 hash slots. why redis cluster doesn't automatically resharding operation in order make new node functional? the process of adding node consists of 2 steps: introduce node other nodes via cluster meet nodes start communicate via cluster bus make node act master via cluster addslots or slave via cluster replicate the separation helps keep commands simple. automatic resharding part of redis 4.2 roadmap

hibernate - How to get ScrollableResults with Gorm DetachedCriteria? -

in hibernate can do: // dc - detachedcriteria scrollableresults sr = dc.getexecutablecriteria(getsession()).scroll() but how same gorm detachedcriteria? domainname.withsession { session -> domainname.where { // predicates }.getexecutablecriteria(session).scroll() } code above fail, because method not exists. updated: have found solution: def hibersession = holders.grailsapplication.maincontext.sessionfactory.currentsession def hiberdc = hibernatecriteriabuilder.gethibernatedetachedcriteria(null, gormdc) def sr = hiberdc.getexecutablecriteria(hibersession).scroll() but outgoing sql has no columns in query: select domain_name ... ; updated: dug deeper , have found solution previous problem. hiberdc.setprojection(null) why happens? when pass detached criteria (gorm) gethibernatedetachedcriteria , detached criteria has no projections, new detached criteria (hibernate) have empty list of projections instead of null - proof . well, of

Wordpress - Admin not found -

have strange error has popped struggling resolve. i have wordpress install using sub domain method: www.example.com/wordpress in root directory have .htaccess: # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress and index file: <?php define('wp_use_themes', true); /** loads wordpress environment , template */ require( dirname( __file__ ) . '/wordpress/wp-blog-header.php' ); home set to: www.example.com url set to: www.example.com/wordpress when try , access admin at: www.example.com/wordpress/wp-admin error: sorry, page looking not found. this not new install of wordpress , issue happened after auto update. how go bug testing this? you're using sub directory installation (rather sub domain installation); such, .htaccess file doesn't

android - onSaveInstanceState() makes my app close -

i want use onsaveinstancestate() because have 5 pages , when ever result 1 page need go next one but each time should save result in result activity when close go next page , come save new result previous result there i used code (just page4 previous result , page5 new result) when run on device , click on page4 button send result result activity closes app public class resault extends actionbaractivity { string ch44=""; static final string ch4 = ""; public final static string extra_massage = "massage"; public final static string extra_page = "page"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_resault); if (savedinstancestate != null) { // restore value of members saved state ch44 = savedinstancestate.getstring(ch4); ((textview) findviewbyid(r.id.choice4)).settext(ch44);

asp.net - How do I list all value= options in an html (aspx) page -

i working off .net website has bunch of webforms. user types in data via browser , submitted data pushed sql server database. i trying analyze data in database struggling because there no code book shows me codes 1, 2, 3 etc represent. is there relatively simple tool in javascript or can use extract options in dropdown list , tell me how coded ? instance, right-clicking on source code can see mode: there 3 options: 1=research, 2=test , 3=non-research . i've got couple of hundred of these things not want hand... i thinking there tools (hopefully online, maybe jsfiddle) can automatically. i have copied snippet of html below. not know if helps page uses: bootstrap.js jquery.js some css <tr> <th class="newpatient-label">mode: </th> <td> <select name="ctl00$cphbody$fvpatient$modedropdownlist" id="cphbody_fvpatient_modedropdownlis

ruby on rails - Searching by full name with Ransack -

i have ransack form on project inherited looks this: <%- ransack_form_options ||= {} -%> <%- search_field_options ||= {} -%> <%- search_field_options.merge! autocomplete: "off", id: "q" -%> <div class="search-form"> <%= search_form_for(@q, ransack_form_options) |f| %> <%= f.text_field search_on, search_field_options %> <%= f.submit 'search' %> <%= button_tag '', class: 'cancel-search' %> <% end %> </div> the value of search_on student_first_name_or_student_last_name_or_student_email_cont . this works searching first name or last name or email. if want search full name or first name or last name or email? how can that?

multithreading - How to handle multiple threads, single outcome in a functional way? -

this not 'pure' functional question involves side-effects. have function may take 10 seconds, complete. function generates data in database (for example). if run twice @ same time create duplicate data. lets function can triggered clicking button in browser. if 2 people click within seconds of each other function can running twice concurrently. in java , similar systems use synchronise on semaphore. in node or django can take advantage of single threading drop parallel runs. running = false def long_running_process(): global running # run once if running: return try: running = true .... go ... finally: running = false the requirement in python global reference clear hint function requires state - , imperative nature. so, questions. how 'pure' functional programs demand immutability handle problem? and how implement in python (for example)? is best option use reactive python library? i know haskell people tell me create state

python - django some translations are not updated -

when change translations keeping previous value not new one. first, have file #: choices/__init__.py:14 msgid "power on" msgstr "encendido" then, changed this #: choices/__init__.py:14 msgid "power on" msgstr "dispositivo encendido" i compile messages, translation not updated. happens translation not all. in development mode, not behind ningx. restart runserver. what reason? that because of app loading order. if app, defined later in installed_apps defines different translation same literal.

django - Is not using models.*Field for variables in models allowed? -

if have model: class model(models.model): variable_name = value variable_name2 = models.fieldtype(default=value) what's difference; first 1 allowed? kind of variable that? i.e count = 2 vs count = models.integerfield(default=2) follow question i know inherently goes against constant variables there variable shared among instances still editable? static/constant variables seem shared among instances definition seems must defined in code; instead of user input want. class dog(models.model): var = 10; # static variable, want changeable in admin instance = dog(____) # var = 10 as @nightshadequeen said, models.*field fields saved database. other constant. as second question, no there not. constant , while can change it, remain changed scope of instance. here's example of mean: class example(models.model): variable_name = 5 def description(): instance_a = example() instance_a.variable_name == 5 # true instance_a.variable_name = &#