Posts

Showing posts from January, 2012

angularjs - Getting a 404 on angular.js on a MEAN app using gulp -

i attempting setup new mean app using gulp , bower keep getting 404 errors on bower dependencies when start app. used express-generator folder structure, wanted use gulp inject frontend dependencies bower , javascript files index file. folder structure: . +-- bin | +-- www +-- lib (bower_components) | +-- angular | +-- angular-ui-router +-- node_modules | +-- ... +-- public | +-- javascripts | | +-- angularapp.js +-- routes | +-- index.js | +-- users.js +-- views | +-- index.ejs +-- app.js +-- gulpfile.js +-- bower.json +-- package.json and gulpfile: 'use strict'; var gulp = require('gulp'), browsersync = require('browser-sync'), inject = require('gulp-inject'), nodemon = require('gulp-nodemon'), wiredep = require('wiredep').stream, reload = browsersync.reload; var paths = { scripts: ['public/javascripts/**/*.js'] }; var nodemonoptions = { script: 'bin/www',

swift - Segmentation fault: 11 when assigning label value from array -

having hard time figuring out. can print value of array , can assign label string, can't assign label value array. print(self.items[0]["username"]) // prints username fine cell.usernamelabel.text = "test" // works expected cell.usernamelabel.text = self.items[0]["username"] // throws segmentation fault:11 on compilation i managed work downcasting: cell.usernamelabel.text = self.items[0]["username"] as? string

Via Ansible to get the most recent war file from A nexus repo -

i have, in nexus, bunch of versions of .war files in snapshot repo. part of automated pipeline grab newest version of these .war files via ansible. when there no .war file on machine grab newest version. (code below). - name: deploy war file maven_artifact: group_id=com.company artifact_id=sales-ui extension=war repository_url=http://ddnexusrepo:8081/nexus/content/repositories/{{repo}} username={{ nexus_user }} password={{ nexus_password }} dest=/usr/share/tomcat/webapps/sales-ui.war when on system not updated when newer version in nexus. how can grab latest? the way can think download (via same maven_artifact module) .war.md5 , compare .war's md5 on server see if there change. want state=latest functionality present or absent. ideas appreciated. thanks you can use version=latest tag available in ansible 2.2.1.0

Generate a python parser for a particular JSON format -

i'm using file format. format is, effectively, json particular structure. format comes validator, great, , gives helpful error messages. however, validator fails when error causes input invalid json, , gives poor error message. i can use normal json validator, want able put json structure tool, , (python) parser out of other end. there various ways of doing this, question is: there ways of defining json format let me avoid writing parser json itself? the use case this: build 'proper' validator format, user can upload file , have checked. can write bnf, i'd write bnf tool understand bnf-within-json. the appropriate way assert json file follows particular format use json schema . supported across many languages , has libraries in python. there's helpful online tools generate, validate, , test schema.

Python/MySQL "Insert into" with variables -

i have problem inserting new rows mysql table. name of table change, must variable , have trouble. how can change name of table "second" variable? idea? add_word = ("insert second " "(name, surname) " "values (%s, %s)") data_word = (name1, surname1) cursor.execute(add_word, data_word) you this: add_word = "insert %s (name, surname) values ('%s', '%s')"%('table_name','name','surname1') and don't need data_word: cursor.execute(add_word, params=none, multi=false)

c# - Linq to SQL - Getting the last know history entry for each divice, prior to a certain date -

i have question similar entry: how-do-i-query-sql-for-a-latest-record-date-for-each-user ... need in linq. in short people not care read other link: i have history table devices. need latest entry each device before given date. not need specific value, whole row. example data: id | deviceid | state | lastupdateddate 0 | 1 | online | 2016-01-05 10:23:45 1 | 2 | offline | 2016-01-04 00:05:33 2 | 1 | offline | 2016-01-01 06:13:25 3 | 1 | online | 2016-01-07 11:02:06 4 | 3 | offline | 2016-01-03 18:00:25 5 | 4 | online | 2016-01-08 03:00:05 4 | 3 | offline | 2016-01-08 04:27:21 so, if have last known states before 2016-01-05, expect following result: id | deviceid | state | lastupdateddate 1 | 2 | offline | 2016-01-04 00:05:33 2 | 1 | offline | 2016-01-01 06:13:25 4 | 3 | offline | 2016-01-03 18:00:25 null | 4 | null | null the null entry not required, ad

xml - xdmp:eval and Update transactions -

i have test case here: let $s := 'xquery version "1.0-ml"; $doc in xdmp:directory("/test/") return xdmp:node-insert-child(doc(xdmp:node-uri($doc))/a, <b>bbb</b>) return (xdmp:eval($s, (), <options xmlns="xdmp:eval"> <isolation>different-transaction</isolation> <prevent-deadlocks>true</prevent-deadlocks> </options>), xdmp:directory("/test/")) my main goal here add new element each document in "/test/" , return results in same transaction. xdmp:eval() , "different-transaction" option thought eval-ed code executed in separate transaction updates available subsequent calls... 2nd , last xdmp:directory("/test/") should returning updated documents <b> element, yet returns non-updated documents. were there caveats here xdmp:eval , i'm trying achieve in single transaction? marklogic 8 in cas

php - response an email mailgun -

im new in mailgun, , use route proccess csv file , post in server want send response when person send email. in routes created new , forward personal email dont know can write response. for example: user send email -> mailgun catch email -> mailgun send server when mailgun catch email -> when catch email mailgun send response user confirm store of data i tried using action send response not work you have create own script. when catch mail gets email cant trigger action. can write own script (ie php) automated cron jobs. can checks incoming mails , process.

python - Traits for SortedListWithKey -

i using sortedlistwithkey class new sortedcontainers module ( link ). there way adapt list trait specify want sortedlistwithkey(instance(someclass), key=some_key) ? to more specific, how can achieve like: from traits.api import hastraits, instance, sortedlistwithkey # know cannot imported class myclass(hastraits): sorted_list = sortedlistwithkey(instance(elementclass)) after looking @ question again, think looking way of accessing sortedlistwithkey object if list , using traits or traitsui machinery able validate/view/modify it. property trait should here allowing view sortedlistwithkey list . have modified code example below have trait property(list(str)) , view simple traitsui: from sortedcontainers import sortedlistwithkey traits.api import callable, hastraits, list, property, str traitsui.api import item, view class myclass(hastraits): sorted_list_object = sortedlistwithkey(key='key_func') sorted_list = property(list(str), depend

iterm2 - How can I retrieve the contents of an iTerm session with Applescript? -

i working on applescript make logging 2-factor authentication domains little easier. long story short, instead of using delays , sending text, i'd poll contents of current session , enter usernames/passwords/tokencodes prompt them appears. luckily, iterm v3.x has bunch of cool applescript stuff: https://www.iterm2.com/documentation-scripting.html but i'm having lot of trouble reading contents of terminal session. here's i've got far: on run # start or activate iterm tell application "iterm" activate tell first window # create new tab, create new session inside set newtab (create tab default profile) tell newtab # since created tab, there should 1 session right now. repeat asession in sessions tell asession delay 3 #set myvar (tty) #set myvar (text) set myvar (contents) #do shell sc

javascript - make requirejs ignore library -

i loading external dependency work amd module requires knows how many sub libraries not on path configured config. is there way tell requirejs not load library module , instead let me include normal script tag. example: library.js: if (typeof define === "function) { // or how ever optional define stuff // amd stuff } else { // set globally } normally requirejs see if loaded script tag , freak out how read. want requirejs ignore , let set globally not have worry libraries depends on. currently doing setting define undefined before call script set after call script. seemed fix it... it sounds want bundled version of lib including. if lib doesn't have bundled js file available, can create own using browserify . browserify some-library.js -o bundled-some-library.js as long have dependencies installed @ time bundle lib, give single file can use script tag src.

r - split a data.frame using intervals -

this question quite similar post splitting data frame list using intervals , answer doesn't apply data because don't have column binary values. my data looks this: >df v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 1 chr1 49828662 49828663 rs7531656 0 +|chr1 48998526 50489626 agbl4 1 - 2 chr1 62594676 62594677 rs2481665 0 +|chr1 62208148 62629591 patj 1 + 3 chr1 62633580 62633581 rs2457831 0 +|chr1 62208148 62629591 patj 1 + 4 chr1 66379767 66379768 rs12757124 0 +|chr1 66378927 66840262 pde4b 1 + 5 chr1 66392060 66392061 rs55824844 0 +|chr1 66378927 66840262 pde4b 1 + 6 chr1 66393984 66393985 rs35185259 0 +|chr1 66378927 66840262 pde4b 1 + what need split file based on column v2 , in interval of 5e+05 , output this [[1]] 1 chr1 49828662 49828663 rs7531656 0 +|chr1 48998526 50489626 agbl4 1 - [[2]] 2 chr1 62594676 62594677 rs2481665 0 +|chr1 62208148 62629591 patj 1 + 3 chr1 62633580

Paypal express checkout works locally but not in production in rails. Returns an error called No Token Passed -

Image
using express checkout , activemerchant gem in rails created wallet feature in can add funds wallet through paypal(express checkout). works locally not in production. in production click paypal checkout button redirected following url no token(as can see) https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token= the thing on blank page here "no token passed" here log production in heroku in local development set same action get: https://www.sandbox.paypal.com/in/cgi-bin/merchantpaymentweb?cmd=_flow&session=-ubdpzpappbkghfszshlh8pr4jhmxwqybcjt5wlq2tcj8satu0iw3vysmhq&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0fb0124e9b61f737ba21b0819848475f0da5465a2ea26eae033cbe3bda (i removed few characters session above url wont work) option make payments. here screenshot of dev log the following relevant code: def express_checkout response = express_gateway.setup_purchase(bigdecimal.new(params[:amount])*100, ip: request.r

ruby - Reusing BinData Records with different data -

if have multiple bindata records take following form, here few examples: class debuginfo < bindata::record endian :little int32 :num array :data, :type => :debug_log, initial_length: :num end class goalinfo < bindata::record endian :little int32 :num array :data, :type => :goal, initial_length: :num end class packageinfo < bindata::record endian :little int32 :num array :data, :type => :package, initial_length: :num end all of these same, make array using different types of objects. there way make 1 of these , somehow pass type of object want read array? module info @base_classes = {} def self.[](type) @base_classes[type] ||= class.new(bindata::record) { endian :little int32 :num array :data, :type => type, initial_length: :num } end end then class debuginfo < info[:debug_log] end class goalinfo < info[:goal] end class packageinfo < info[:package] end disclai

objective-c struct properties are released before usage -

i have struct in objective-c code > typedef struct { __unsafe_unretained nsstring *string1; __unsafe_unretained nsstring *string2; __unsafe_unretained nsstring *string3; __unsafe_unretained nsstring *string4; __unsafe_unretained nsstring *string5; . . . __unsafe_unretained nsstring *string10; } mystruct; in model class store these structs in array declared @property (nonatomic, strong) nsmutablearray *mystructarray; i construct in .m file during runtime nsmutablearray *mytemparray = [nsmutablearray array]; (nsdictionary *jsondict in jsonarray) { mystruct stringsstruct = parsewithdictionary(jsondict); [mytemparray addobject:[nsvalue value:&stringsstruct withobjctype:@encode(mystruct)]]; } myobject.mystructarray = mytemparray; the problem when try access after parsing / constructing inside objects deallocated & received error -[cfurl length]: message sent deallocated instance here how access properties later way, mystruct mystruct; [[myobject.mystru

heroku - Smoochbot not replying -

Image
i tried setting smooch-bot via heroku example . followed directions , opened heroku app , chatted bot, don't receive replies. messages type being forwarded smooch because receiving email notifications smooch... there no replies smooch-bot in chat window. i not programmer i've tried follow directions. deploying app via dropbox connection. normal heroku folder in dropbox empty? tried uploading script.js dropbox > apps > heroku , dropbox > apps > heroku > mybot, i'm still not getting replies. i not sure went wrong. me point in right direction? if you're using dropbox heroku, not enough edit script file. have explicitly deploy dropbox changes via heroku dashboard, this: also, debug issues bot script specifically, i've documented troubleshooting steps here: https://github.com/smooch/smooch-bot-example#troubleshooting-your-bot to summarize, need install heroku toolbelt , log in on command line , view app's error logs heroku lo

java - Two receivers of android LocalBroadcast, one in MainActivity, the other in a fragment -

in android app, registered receiver in mainactivity's oncreate intentfilter mfilter = new intentfilter("action"); localbroadcastmanager.getinstance(this).registerreceiver(mreceiver, mfilter); in onresume new thread(new runnable() { @override public void run() { runonuithread(new runnable() { @override public void run() { intent = new intent("action"); localbroadcastmanager.getinstance(mainactivity.this).sendbroadcast(i); } }); } }).start(); frankly not sure why wanted use thread such (i copied code somewhere w/o digesting it). this app supports viewpager, in associated fragment's oncreate intentfilter mfilter = new intentfilter("action"); localbroadcastmanager.getinstance(getactivity()).registerreceiver(mreceiver, mfilter); in both mainactivity , fragment class, receiver looks like:

java - Why doesn't Files.isHidden() working correctly? -

i'm messing around java nio , reason can't files.ishidden() return correct boolean value. program checks see if directory hidden if hidden make visible , if not hidden make hidden. have: path start = filesystems.getdefault().getpath("e:/documents/somedirectory"); try { if (files.ishidden(start)){ system.out.println("dir hidden."); files.setattribute(start, "dos:hidden", false); } else { system.out.println("dir not hidden. hiding."); files.setattribute(start, "dos:hidden", true); } } catch (ioexception e) { e.printstacktrace(); } it keeps returning false , hiding directory despite directory being hidden. following code works fine using old file class w/ path class. path start = filesystems.getdefault().getpath("e:/documents/somedirectory"); file file = new file("e:/documents/somedirectory"); t

java - RMI ClassCastException to remote interface -

hi having problem rmi. i have error when run it. java.lang.classcastexception: com.sun.proxy.$proxy0 cannot cast rmi.converter this interface converter.java import java.rmi.remoteexception; public interface converter { double celciuskelvin (double a) throws remoteexception; double celciusfahrenheit (double a) throws remoteexception; double fahrenheitkelvin (double a) throws remoteexception; double fahrenheitcelcius (double a) throws remoteexception; double kelvincelcius (double a) throws remoteexception; double kelvinfahrenheit (double a) throws remoteexception; double atmospascal (double a) throws remoteexception; double atmospsi (double a) throws remoteexception; double pascalatmos (double a) throws remoteexception; double pascalpsi (double a) throws remoteexception; double psiatmos (double a) throws remoteexception; double psipascal (double a) throws remoteexception; } this remote method converterimp.java import java.rmi.remoteexception; import java.rmi.

Multi-dimensional or jagged array when dealing with matrix in C#? -

i think title quite clear, i'll write personal opinions here. consider matrix of numbers, equivalent representations in c# code double[,] , double[][] respectively. when using multi-dimensional array (2d in specific situation), can seen 1 doesn't have check either there null reference of double[] or size of rows same, allows better understanding of core problem. descirbes matrix more accurately point of view, since in cases matrix should treated single entity rather list of arrays. but using multi-dimensional array may result in more lines of code. if 1 wants apply math operations on it, say, transposition, have use nested loops like var row = mat.getlength(0); var col = mat.getlength(1); var newmat = new double[col, row]; (var = 0; < row; i++) { (var j = 0; j < col; j++) { newmat[j, i] = mat[i, j]; } } with jagged array, can write var newmat = enumerable.range(0, mat[0].length - 1). select(i => mat.select(r => r[i]).toarray

html - How to make Floating Action Button / Content overlap two divs in MaterializeCSS -

i looking @ materializecss showcase (materializecss.com/showcase.html), , saw feature wanted incorporate website. wanted able make card, picture, button, etc. able overlap on 2 divs (or sections). for example: http://prntscr.com/bezcgo or http://prntscr.com/bezd7s or prntscr.com/bezdvx apparently picture different live website, there same idea looking for. in first picture, "hyperapi" picture overlaps both blue , white parts. second picture, yellow down arrow overlaps blue , white. thirdly, red down arrow overlaps light blue , white areas. just clarifying, know how using materializecss framework (materializecss.com). thanks! also, couldn't post more 2 links had break them (sorry d:)! that pretty popular effect :) we negative margins image , eqiuvalent padding header... css .overlap-header { padding: 25px 25px 125px; /* bottom padding has 100px */ text-align: center; background: #333; color: #fff; position: relative; }

How to use if to find a substring inside a string with JavaScript or jQuery, using TamperMonkey and possibly an array? -

so i'm writing tampermonkey script use on facebook (as might tell on id's & classes) , i've run wall. total writers block. i'm trying figure out how can write if statement allow me find specific strings in existing string. now, i've looked around ideas , regular expressions aren't working me, nor .test or .match working me either. i'm little confused , needing insight might able do. love use array if possible since i'm going searching many strings. here snippet of code need help: var checkname = setinterval(function() { if ($("span[id^='fb-timeline-cover-name']").length) { var str = document.getelementbyid("fb-timeline-cover-name").innertext; var res = str.tolowercase(); if (res.substring(0,3) == "ssg") { $("button[id^='u_0_12']").click(); } clearinterval(checkname); } }, 50); instead of: if(res.substring(0,3) == "ssg&q

python - Insert selected rows from one Sframe to another Sframe -

i aware of append() function append rows of 1 sframe another. want insert specific row 1 sframe anaother. there way pick 2nd row sframe1 , append sframe2? structure of promocodes sheet: column 1:item_code column 2: item_name import graphlab import pandas pd tc = graphlab.sframe('totalcodes.csv') pc = graphlab.sframe('promocodes.csv') row in tc: me = graphlab.sframe({'item_code': [row['item_code']],'item_name': [row['item_name']]}) pc = pc.append(me) i want pick single row tc , append pc https://turi.com/products/create/docs/generated/graphlab.sframe.append.html sf = graphlab.sframe({'id': [4, 6, 8], 'val': ['d', 'f', 'h']}) sf2 = graphlab.sframe({'id': [1, 2, 3], 'val': ['a', 'b', 'c']}) sf = sf.append(sf2) sf

android - Implement RxJava with Sync Adapters -

i'm trying use rxjava through rxandroid , others librarys rxlifecycle update activity after fetching data syncadapter . know how execute network call throug service when call activity . example: observable<string> fetchfromgoogle = observable.create(new observable.onsubscribe<string>() { @override public void call(subscriber<? super string> subscriber) { try { string data = fetchdata("http://www.google.com"); subscriber.onnext(data); // emit contents of url subscriber.oncompleted(); // nothing more emit }catch(exception e){ subscriber.onerror(e); // in case there network errors } } }); fetchfromgoogle .subscribeon(schedulers.newthread()) // create new thread .observeon(androidschedulers.mainthread()) // use ui thread .subscribe(new action1<string>() { @override public void call(string s) { view.settext(view.gettext() + "\n" + s)

jquery - Append multiple divs to new location (using .prev) -

basically need move links in selection of divs inside div.item <div class="item"> <div class="inner"> <a class="link">hello</a> </div> </div> <div class="item"> <div class="inner"> <a class="link">hello</a> </div> </div> ive been playing ab out following script cant seem nail it $( ".link" ).each(function(){ var prevbox = $(this).prev('.item'); $(this).appendto(prevbox); }); $(".link").each(function() { var prevbox = $(this).closest('.item'); $(this).appendto(prevbox); }); console.log($('.item')[0].outerhtml) .inner { background-color: green } .link { background-color: yellow } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="item"> <div class=&

xcode - IOS Memory and Memory Management -

Image
i'm new , earning ios application development , let me tell don't know single bit memory , memory management . while playing tabviewcontroller make 2 tabs , 3 viewcontroller , connect them via navigationalcontroller , link them cycle like:- navigationcontroller1 firstviewcontroller -> secondviewcontroller -> thirdviewcontroller -> firstviewcontroller navigationcontroller2 firstviewcontroller -> secondviewcontroller -> thirdviewcontroller -> firstviewcontroller and run them on simulator , noticed getting viewcontrollers on stack memory increasing .1 mbs. than add single image of size 4.5 mb on firstviewcontroller (navigationcontroller1) , run app noticed memory reached 66 mb as app starts , add viewcontrollers on stack memory increasing @ same rate last time (.1 mbs) don't understand reason behind , whats logic of whole seen ? "and apologies reason buttons not showing in tabbar there 2 title on tabbar navigation1 , na

javascript - Selecting Child fields of a div -

i have multiple div child fields. these child fields share similar names. trying show child fields of particular. getting child fields of first div. does have child field's name html <div class="row childfields" id="parent-question1"> <p class="subtitle">give full details here: </p> <div class="col-md-6 colchildfields" style="display:none" name="condition"> <label class="poclabel">nature of condition</label> <input type="text" name="condition" class="form-control"> </div> <div class="col-md-6 colchildfields" style="display:none" name="datesandduration"> <label class="poclabel">dates , duration</label> <input type="text" name="datesandduration" class="form-control&qu

javascript - Populate html table with http API request in Meteor -

i have table <table> <thead> <tr> <th>year</th> <th>value</th> </tr> </thead> <tbody> <tr> <td>1990</td> <td>-</td> </tr> ... </tbody> </table> and want make request world bank api fill out values in table. my request in meteor method meteor.methods({ getdata: function () { try { const url = 'http://api.worldbank.org/countries/br/indicators/ny.gdp.mktp.cd?date=1990:2000&format=json'; const request = http.get(url); return request; } catch (e) { console.log(e); return false; } }, }); and call method client with meteor.call('getdata', function(error, result) { console.log(result); }); so values in console, want replace - in html table correct values. you use {{#each}} block helper loop through array. e.g. <tbody> {{#each getdata}} <tr> <td>

See what images were uploaded to imgur using my app ClientID? -

i'm using https://api.imgur.com/3/image upload images javascript without oauth . possible see images uploaded using client-id ? unfortunately it's not directly possible think following approach give results: use following endpoint retrieve associated images: https://api.imgur.com/3/account/ {username}/images or following account submitted images: https://api.imgur.com/3/account/ {username}/submissions/ for username can use 'me' , need send client-id using correct header: 'authorization: client-id your_client_id' this return images uploaded account , need filter them yourself. if uploading them gallery , want know these can set time window in request ( week, day, etc.)

csv - how to enter data into mysql table with wrong date format -

i have csv file lots of different columns, 1 column having date in dd-mm-yyyy format . mysql's default format yyyy-mm-dd . planning load csv file directly mysql table , may cause problem. should . ps- not planning run code other language on file , appreciate solutions include use of mysql itself. if able perform multiple steps first import csv intermediate table has same properties real data table, except date columns. then can insert real table , format date-string while selecting insert realtable (/* ... */) select /*.... */, str_to_date('01-5-2013','%d-%m-%y') intermediatetable; when ready truncate table, done. should done in transaction can rollback if goes wrong. edit: seems better way: https://stackoverflow.com/a/4963561/3595565 should able format date while importing using variable

axapta - Consuming web service using C#- Unable to catch exception in AX(2009) -

i have created aif- document service in ax 2009. doing picking list registration update in ax. have code in try , catch in ax. my issue: when test service in ax through test job, can able catch exception in catch code. but, when consume service through c#, can't able catch exception. in other words, code not coming catch part. i don't know why can't catch exception when consuming service. any suggestions helpful.. thanks in advance!

asp.net mvc 4 - Upgrading a project to MVC 5 -

i have been looking solution upgrade current mvc 4 app have use new mvc 5 binaries. cannot find solution anywhere. anyone have ideas? visual studio 2013 automatically upgrade project allowing nuget package manager run updates. steps: in visual studio 2013, open project , right click on project name open properties window. change target framework @ least 4.5. then, on project right click on references item, , select manage nuget packages. on right side of window select "updates", , underneath select "all". should begin search packages needing updated. when search completes "update all" button appear if clicked, update packages. note, project had upgrademvc3tomvc4 package. not upgrade uninstalled first, allowed dll's remain when asked.

c++ - How to prevent Visual Studio 2015 Update 2 to add telemetry_main_invoke_trigger? -

Image
a simple c++ console app int main() { return 0; } compiled in visual studio 2015 update 2 adds call telemetry_main_invoke_trigger both debug , release binaries. how can prevent this? according microsoft’s steve carroll (development manager visual c++ team), can remove telemetry calls adding notelemetry.obj command options of linker: steve carroll explained removed in upcoming update 3: our intent benign – our desire build framework investigate performance problems , improve quality of our optimizer should reports of slowdowns or endemic perf problems in field. apologize raising suspicion levels further not including crt source, oversight on our part. despite that, of investigated how mechanism works in nice detail. have called out, code trigger etw event which, when it’s turned on, emit timestamps , module loads events. event data can interpreted if customer gives symbol information (i.e. pdbs) data applicable customers actively

sql - Update MySQL Query that selects records with a certain non-unique value -

i'm looking creating mysql query. have following database table: +----------------+-----------+-------------+------------+-------------------+---------+-------------+---------------+--------+ | option_type_id | option_id | sku | sort_order | customoptions_qty | default | in_group_id | dependent_ids | weight | +----------------+-----------+-------------+------------+-------------------+---------+-------------+---------------+--------+ | 552 | 137 | 13071727 | 1000 | 0 | 0 | 0 | | 0.0000 | | 553 | 137 | 13071727b | 1000 | 0 | 0 | 1 | | 0.0000 | | 554 | 137 | 13071727c | 1000 | 1 | 0 | 2 | | 0.0000 | | 555 | 137 | 13071727d | 1000 | 1 | 0 | 3 | | 0.0000 | | 556 | 138 | 13085

2 X-Axis row, 1 Y-Axis Column and 2 Z-Axis Value Pivot Table SQL Server 2008 query -

i have sql server database table below- id | consignee | shipper | lss | cm1 | month 1 | hnm | | 101 | 25 | jan 2 | hnm | b | 102 | 35 | jan 3 | hnm | | 103 | 45 | feb i want have output below- consignee | shipper | jan | feb | | cm1 | lss | cm1 | lss| hnm | | 25 | 1 | 45 | 1 | hnm | b | 35 | 1 | 0 | 0 | here count function applied on lss , sum applied on cm1. don't know if possible in sql server query. have seen searching people converting rows columns or 1 x-axis, 1 y-axis , 1 z-axis queries, nothing this. can on excel using pivot, need data database format , export excel file. note: working on asp .net application using c# , oledb. yes. possible. select consignee , shipper , jan_cm1 = max (case when month = 'jan' cm1 end), jan_lss = max (case when month = 'jan' lss end), feb_cm1 = max (case when month = '

python "No module named" error when calling a submodule -

i'm having trouble import statement python reports there no module named the_page or the_generator. task_a.py contains import generator.the_page thepage , , when run main script, causes no problem. the_generator.py contains import tasks.task_a , when run main script, python throws following error.. traceback (most recent call last): file "/generator/the_generator.py", line 7, in <module> import tasks.tasks_a file "/generator/tasks/tasks_a.py", line 3, in <module> import generator.the_page thepage importerror: no module named the_page here's structure. generator/ __init__.py the_generator.py the_page.py tasks/ __init__.py task_a.py maybe can problem guys. help! running scripts middle of package bad idea, number of reasons, obvious of 1 you're running into: when import generator.the_generator somewhere, generator ends package, absolute import of generator.the_page , or rela

javascript - How to structure my project folder when building a secured NodeJs REST API -

i building rest api using nodejs , express, powered mongodb database. i've been struggling days trying right folder structure nailed down. far, can connect database , add new users without api, doing get, post, etc. requests. i've seen several tutorials online on how build api using node, none of them have more standardized way setting folder structure. , reason why having such hard time making work given current folder structure. here folder structure app ---models ------user.js ---api.js ---routes.js config ---auth.js ---database.js ---passport.js public views package.json server.js server.js // server.js // set ====================================================================== // tools need var express = require('express'); var app = express(); var port = process.env.port || 2016; var mongoose = require('mongoose'); var passport = require('passport'); var flash = require('connect-flash');