Posts

Showing posts from June, 2011

javascript - Return value from firebase in ng-repeat -

i use angularjs front-end , firebase database. i have ng-repeat displays firebasearray of stories. each of these stories connected number of collections can part of. collections , stories stored in 2 different locations on firebase server , use keys tie these together. my model story object in database looks this: storyid: { title: 'title', in_collections: { 0: collectionid //collection id refers specific collection in database 1: collectionid } } so whenever display story object don't have access title, id. in order title need call server name. have this: template: <div> {{story.title}} in collections: <span ng-repeat="(key, collection) in story.in_collections"> {{getcollectiontitle(key)}} <span> </div> controller: app.controller("explorectrl", function($scope, stories, collections){ $scope.story = stories.getstory(storyid); //comes firebase array $scope.getcollecti

javascript - How to open set this to any object in jquery? -

if have function this function foo(a) { $(this).html(a); } var r = $("#hello"); and can't change function foo , can call foo using r , such inside foo , this refer object selected r ? i tried this r.each(function(i, x) { foo(1); }); but did not work. this referred window object. that's because when call function itself, this set global object (or undefined ) unless function scope bound. to use function way wanted, write this: r.each(foo); that pass function directly , ensure this set same value if body of foo inside of anonymous function. if want pass additional parameters foo not passed each , have call using call or apply : r.each(function() { foo.call(this, 1); });

oracle10g - No matching unique or primary key for column-list in oracle -

create table student_details01 (usn varchar(20) not null, student_name varchar2(20) not null, branch varchar2(20) not null, contact_no number(10) not null, fathers_name varchar2(20) not null, home_address varchar(50) not null, dob date not null, local_address varchar2(50), email_id varchar2(20), doj date, hid number not null, primary key (usn,hid) ); create table mess( s_no number not null, hid number references student_details01(hid), no_of_breakfast int, no_of_meals int, amt_of_breakfast int, amt_of_meals int, total int not null, primary key(s_no) ); student_details01 table executed, mess table gives following error: no matching unique or primary key column-list. the ora-2270 : no matching unique or primary key column-list error quite simple: happens when columns reference in foreign key not match primary key or unique constraint on parent table. common reasons are the parent lacks constraint altogether the parent table's constraint compound

intellij idea - Set import layout for xtend files in IntellJ -

i want set specific layout imports (for example, java.* followed com.google.* followed else) xtend files in intellj. java files can setting import layout under "settings->editor->code style->java->imports->import layout". cannot find xtend, i.e., don't see "settings->editor->code style->xtend" when run "optimize imports" xtend files formatted in default order , unable find way change default order. most features in intellij idea have implemented separately each language, , lot of features supported java not exist in other language plugins. if don't see feature, because developers of xtend plugin did not implement it. can file feature request asking them support it.

javascript - node js app with redis backend - how to send a "SCAN" command -

i've installed redis client node application. package information follows: me@mydevbox:/var/www/html/node/test$ cat package.json { "name": "test", "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www" }, "dependencies": { "body-parser": "~1.13.2", "cookie-parser": "~1.3.5", "debug": "~2.2.0", "ejs": "~2.3.3", "express": "~4.13.1", "morgan": "~1.6.1", "redis": "^2.6.2", "serve-favicon": "~2.3.0" } } i need run following command in node js application: 127.0.0.1:6379> scan 0 match widget:914* 1) "0" 2) 1) "widget:9145090003_13:00_17:00" 2) "widget:9145090003_00:00_00:00" 3) "widget:9145090003_08:00_12:00" 12

angular - How to instantiate and render Angular2 components? -

i'm trying learn angular2 (and typescript) , having followed quick start guide , few unofficial tutorials i've made progress have simple application components. i understand process of binding model data dom element using bracketed notation in templates: <h1>{{title}}</h1> what i'm struggling understand how dynamically instantiate new component within typscript code, , render in dom. if import component file , instantiate new one, trigger component's constructor in model. angular2 allow me render this, or append component component or queried div element? import {listcomponent} './list.component'; ... export class mainappcomponent { buttonclicked(){ // i'm creating new list component. proper way render within mainappcomponent? this.list = new listcomponent(); } } you missing many concepts angular2 . in angular not instantiate components , add them dom, angular takes care of everything, pattern : h

android - ActivityThread error -

every time compile android code phone (not emulator), kind of code before app begins start. (it's warning, app runs perfectly) 09-09 22:13:04.785 26459-26459/com.adrastel.niviel w/activitythread: application com.adrastel.niviel can debugged on port 8100... 09-09 22:13:07.355 26459-26459/com.adrastel.niviel w/art: failed find oatdexfile dexfile /data/data/com.adrastel.niviel/files/instant-run/dex/slice-slice_8-classes.dex ( canonical path /data/data/com.adrastel.niviel/files/instant-run/dex/slice-slice_8-classes.dex) checksum 0x2dd48748 in oatfile /data/data/com.adrastel.niviel/cache/slice-slice_8-classes.dex 09-09 22:13:08.250 26459-26459/com.adrastel.niviel w/art: failed find oatdexfile dexfile /data/data/com.adrastel.niviel/files/instant-run/dex/slice-slice_7-classes.dex ( canonical path /data/data/com.adrastel.niviel/files/instant-run/dex/slice-slice_7-classes.dex) checksum 0x5a6c56b9 in oatfile /data/data/com.adrastel.niviel/cache/slice-slice_7-classes.dex 09-09 22:13:09

ios - Firebase - Save unique ID in a class variable and send its data to another controller - Swift -

i created unique id firebase using childbyautoid. able print id within reference function used create it, when assign value class variable , print in console comes out nil. i trying send data view controller using override func prepareforsegue method. works when data string not work when variable holding uniqueidkey. here code: class mainviewcontroller: uiviewcontroller, cllocationmanagerdelegate{ var ref: firdatabasereference! var refhandle: uint! let locationmanager = cllocationmanager() let regionradius: cllocationdistance = 1000 var currentlocation: cllocation! var location: cllocationcoordinate2d! var latitude: double! var longitude: double! let geocoder = clgeocoder() var placemark: clplacemark? let date = nsdate() var currentorderidkey = "" @iboutlet weak var mapview: mkmapview! @iboutlet weak var useremaillabel: uilabel! @iboutlet weak var pickupaddress: uitextfield! @iboutlet weak var deliv

Spark scala filter tuples in a list -

i have rdd below val m = sc.parallelize(seq(("a",("x",1)), ("a",("y",2)), ("a",("z",2)), ("b",("x",1)),("b",("y",2)))) i transformed above rdd using groupbykey below val b = m.groupbykey.mapvalues( _.tolist) result: (a,list((x,1), (y,2), (z,2))) (b,list((x,1), (y,2))) now, want filter tuples max values in each list expected result be (a,list((y,2), (z,2))) (b,list((y,2))) considering sequence given is: val m = seq(("a",("x",1)), ("a",("y",2)), ("a",("z",2)), ("b",("x",1)),("b",("y",2))) val r1 = m.groupby(_._1) .map { case (k, v) => k -> v.map(_._2) } .map { case (k, v) => k -> { val sorted = v.sortwith { case (x, y) => x._2 > y._2 } val max = sorted.head._2 sorted.takewhile(_._2 == max) } }

Java StreamCorrupted Exception, using JSON -

i'm not sure why getting error @ bottom of code? appreciated. understand has use of objectoutputstream or objectinputstream? not entirely positive. in advance. //main import java.io.serializable; class libraryofmoviedescriptions implements serializable { public static void main(string[] args){ movielibrary movielibrary; movielibrary = new movielibrary("movies.json"); movielibrary.tojsonfile("movies.json"); } } //movie description class import org.json.jsonexception; import org.json.jsonobject; import org.json.jsonarray; import java.io.serializable; public class moviedescription implements serializable { private string title; private string rating; private string release; private string runtime; private string plot; private string filename; private string genre; private string actors; public jsonobject tojsonobject() throws jsonexception { jsonobject obj = new jsonobject(); obj.put("title", title);

docker - Why is Internal memory in java Native Memory Tracking increasing -

my application running in docker container, use scala , use "openjdk 64-bit server vm (build 25.102-b14, mixed mode)", xmx set 16gb , container memory limit 24gb, after running time container killed: last state: terminated reason: oomkilled exit code: 137 however can't find "java.lang.outofmemoryerror: java heap space" errors in log, not once in last 2 weeks in 48 nodes. it's not normal heap oom. dmesg output: $ dmesg -l err,crit,alert,emerg stdin not terminal [1647254.978515] memory cgroup out of memory: kill process 10924 (java) score 1652 or sacrifice child [1647254.989138] killed process 10924 (java) total-vm:34187148kb, anon-rss:24853120kb, file-rss:23904kb [1655749.664871] memory cgroup out of memory: kill process 1969 (java) score 1652 or sacrifice child [1655749.675513] killed process 1969 (java) total-vm:35201940kb, anon-rss:24856624kb, file-rss:24120kb [1655749.987605] memory cgroup out of memory: kill proce

c# - How to get the FirstOrDefault added/updated/deleted data Row in a data Table? -

i'm developing external .dll epicor erp calls in bpm's pre/post processing. .dll written in c# , epicor passes .dll dataset. i've seen code examples either changed rows or firstordefault not both. this code null never gets called. var ttquotedtl = ds.quotedtl.where(r => r.rowmod == icerow.rowstate_added || r.rowmod == icerow.rowstate_updated || r.rowmod == icerow.rowstate_deleted); var ttquotedtl_xrow = (from ttquotedtl_row in ttquotedtl select ttquotedtl_row).firstordefault(); if (ttquotedtl_xrow != null) { //do } i can ttquotedtl not null , perform work if call this: var ttquotedtl_xrow = ds.quotedtl.firstordefault(); but i'm concerned won't row has been added, updated or deleted. you can combine two, linq statements composable. var quotedtlrow = ds.quotedtl .where(r => r.rowmod == icerow.rowstate_added || r.rowmod == icerow.rowstate_updated || r.rowmod == icerow.rowstate_deleted ).firs

c# - How to get Date without Time from DateTime while join tables -

i joining 3 tables , date without time. var query = anobjective in db.objective join anobjectivetype in db.objectivetype on anobjective.idtype equals anobjectivetype.idobjectivetype join statuscode in db.statuscode on anobjective.idstatuscode equals statuscode.idstatus select new { idobjective = anobjective.idobjective, objectivename = anobjective.objectivename, datecreation = anobjective.datecreation, //get date without time dateend = anobjective.dateend, //get date without time }; i know there method dbfunctions.truncatetime , returns time 0 values. want date without time. i've seen this answer , cannot figure out how apply when joining, not grouping. model class: public partial class objective { public int idobjective { get; set; } public string objectivename { get; set; } public nullable<system.datetime> datecreation { get; set; } public nullable<

asp.net - C# Connecting a console app to a Library Class project containing Entity Framework database access -

i'm working on asp.net mvc 5 application. have solution 3 projects: one contains asp.net mvc app another class library contains entity framework data models , data context and console application service needs access database well i'm having trouble figuring out how allow console app connect class library project data. need do? i have static class in class library project acts db helper. when make call in console project ado.net errors. i've tried add connection strings app.config , start errors how can't attach instance because there database same name. what steps need take access data in console project class library project contains entity framework data models?

Hyperledger new user register -

hyperledger has membership service, keeps initial members in membersrvs.yaml file, e.g lukas, jim etc. then user has log network, posting restapi /registrar enrollmentid , secret. my question how create new user network users not defined in ca? seems admin user can that, how invoke /registrar api admin security context? thanks rest api /registrar can used log in network. if add new user membership service have 2 options: add new record membersrvc.yaml, reset cluster state removing /var/hyperledger/production, , restarting membership service. in case information new users imported @ first start. you can use node.js skd , add new user shown in example fabric v0.6: https://github.com/hyperledger/fabric/blob/ceefb12425b7ccb09fc0f88dc78d395a459dca55/sdk/node/test/unit/registrar.js

active directory - PHP LDAP (AD) Search for members of nested groups -

i'm looking possibility check, if user member of group or not. problem ... group can nested. example: group_a member of master_group group_b member of master_group user_a member of group_a i've check, if user_a member of master_group (or nested groups). $result = ldap_search($ldap, $_global["ldap_basedn"], "(????)"); $info = ldap_get_entries($ldap, $result); do have foreach through every group , check if there nested group? thank in advance

Add properties to Firebase analytics event -

we using firebase analytics log of events in our game. since missed recording of attributes along these events, wondering if possible add attributes recorded events. if export big query able add them in big query,but won't reflected in firebase dashboard, instead build own custom dashboard google data studio.

sql server 2012 - Change field when 2 conditions met -

i have timesheet database , need change typeofpay in following example if person gets paid stat holiday (typeofpay = stat holiday) , worked on day (typeofpay = regular), change lines typeofpay = stat in. date description employee typeofpay timespent 2016-09-05 abc_company bobjones stat holiday 8.00 2016-09-05 bcd_company bobjones regular 1.25 2016-09-05 lift_check bobjones regular 0.25 thanks in advance gerry this pretty simple update. join table using conditions supplied (same date, holiday vs regular, , same employee) , update type of pay. can see correlation doing join without update. select * #timesheet t left join #timesheet holiday on t.date = holiday.date , t.employee = holiday.employee , t.typeofpay = 'regular' , holiday.typeofpay = 'stat holiday' this table setup used. replace #timesheet whatever actual table name create table #timesheet ( [date] date not null, [description] varchar(20) nul

amazon web services - error using Python Elasticserarch-py package -

so trying create connection aws es. have connected s3 bucket in same zone. however, when try connect es, message every time. please install requests use requestshttpconnection. i have imported correct module nothing seems fix issue. here code import elasticsearch elasticsearch import elasticsearch, requestshttpconnection boto3 import client, logging, s3, session host = 'search-esdomain-t3rfr4trerdgfdh6t4t43ef.us-east-1.es.amazonaws.com' es = elasticsearch( hosts = host, connection_class = requestshttpconnection, http_auth = ('user', 'password'), use_ssl = true, verify_certs = false) this looks same every example can find reason not connect. this python 3.5 , dev environment vs 2015. as per documentation elasticsearch-py . note requestshttpconnection requires requests installed. there need explictly install requests module if not exist in pythonpath

joomla - analytics.js loaded but no sign of visitors in my Google analytics Profile -

i own website running joomla, have problem in using google analytics on website. put analytics code snippet, on pages of website , according gtmetrix result, analytic.js loaded when visit website prjmarket.com here gtmetrix results . please me going on , why can not perceive visitors. use google analytics free that best plugin

javascript - How does Mutter/Window Groups work in Gnome? -

the shelltile-extension gnome 3 ( https://extensions.gnome.org/extension/657/shelltile/ find link github) can group windows such treated 1 gnome. i understand how done since looks might useful me... a @ source code suggests magic hidden in javascript library imports.gi.meta, points me mutter , gnome, documentation ( https://developer.gnome.org/meta/stable/core-reference.html ) isn't helpful new topic, or @ least me... has more information? (of course, might looked @ wrong part of source code , might looking in wrong direction... anyhow, appreciated!)

Comparing nested list Python -

i guess code explain i'm going for... list1 = [("1", "item 1"), ("2", "item 2"), ("3", "item 3"), ("4", "item 4")] list2 = [("1", "item 1"), ("2", "item 2"), ("4", "item 4")] newlist = [] i,j in list1: if not in list2[0]: entry = (i,j) newlist.append(entry) print(newlist) if call nested tuples [i][j] i want compare [i] once has been done want keep corresponding [j] value. i have found lots of information regarding nested tuples on internet refer finding specific item. i did use expression below, worked perfectly, seems similar, won't play ball. for i,j in highscores: print("\tplayer:\t", j, "\tscore: ", i) any apppreciated. if understand correctly comment take newlist: newlist = [("3", "item 3")] you can using: 1) list comprehension: newlis

.htaccess - What is the htaccess rule to do this? -

what htaccess rule achieve following please ? i have bunch of deleted urls 301 redirect homepage. the urls have format, showthread.php?tid=405 any parameter additional can redirected homepage. eg. showthread.php?tid=405&pid=112 i redirect range, save myself making individual entries, eg tid=405-420 they must redirected homepage (example.com) , site running in https. i know need this rewritecond %{request_uri} ^/showthread\.php$ rewritecond %{query_string} ^id=([0-9]*)$ rewriterule https://www.example.com [r=301,l] but short of stuying htaccess rules hours, can't figure out. i'd appreciate help. thanks

java - Sorting an array of objects? user input and comparator -

this question has answer here: why have nullpointerexception in sort implementation? 2 answers trying sort array of objects overallvisits greatest smallest error. goal pass in website objects array have them sorted out according greatest overall visit least visit. following error: exception in thread "main" java.lang.nullpointerexception @ java.util.comparabletimsort.binarysort(comparabletimsort.java:258) @ java.util.comparabletimsort.sort(comparabletimsort.java:185) @ java.util.arrays.sort(arrays.java:1246) @ project1.main(project1.java:32) import java.util.scanner; import java.util.arrays; public class project1 { public static void main (string args[]) { scanner input = new scanner(system.in); website [] websites = new website[20]; string temp; string temp2; int days = 4; for(int i=0; < 10; i++) { sy

jquery - Decode Base64 to Hexadecimal string with javascript -

needing convert base64 string hexadecimal javascript. example: var base64value = "oaaabtuaag==" need conversion method output (decoded data (hexadecimal)) a0000005350002 i know correct because can use website http://tomeko.net/online_tools/base64.php?lang=en and punch in base64 string of oaaabtuaag== , a0000005350002 what have tried? https://github.com/carlo/jquery-base64 https://jsfiddle.net/gabrieleromanato/qaght/ i have found lot of questions atob() charcodeat() give binary & tostring(16) give hex. function base64tohex(base64) { var raw = atob(base64); var hex = ''; ( = 0; < raw.length; i++ ) { var _hex = raw.charcodeat(i).tostring(16) hex += (_hex.length==2?_hex:'0'+_hex); } return hex.touppercase(); } console.log(base64tohex("oaaabtuaag=="));

python - Find generic sub-lists within a list -

just learning python first coding language. given list many possible sub-lists have variable number of elements, there way of using regex (or similar) identify lists contain sub-lists 1) number of elements specified , 2) given type of content in order (including other sub-lists)? example (in pseudocode): list1 = [1, 4, 7, ["a", 5, "b"], 2, 4,7,"k",9] list2 = [1, 4, 7, ["a", "h", "b"], 2] list3 = [1, 4, 7, ["a", ["a", 6, "b"], "b"], 5, 3] list4 = [1, 4, 7, ["a", "b"], 3, 4] list5 = [1, 4, 7, ["a", 5, "b", 7], 3, 4] if ["a", ., "b"] in listx: # "." stands anything, sub-lists print("yes") else: print("no") list1, list2, , list3 should print "yes", list4 , list5 should print "no". as bonus, there way return 1) number of times specified generic sub-list found , 2

SyntaxError: invalid syntax Python 3.5 when trying to print in python, even with a simple print("Hello World") -

i finished deleting bunch of files off desktop , other misc. folders. re-opened project have been working on , won't print, simple 'hello world' line 144. i have opened new python project , printed("hello world") , works fine, tried coping code same sheet , saving different name , same error. this code using below; print way @ bottom. from pandas_datareader import data dreader import pandas pd datetime import datetime import dateutil.parser tkinter import * # sets max rows can displayed # when program executed pd.options.display.max_rows = 200 # df name of dataframe, # reading csv file containing data loaded # yahoo finance(date,open,high,low,close # volume,adj close,)the name of ticker # placed before _data.csv i.e. ticker aapl # have csv file named aapl_data.csv. df = pd.read_csv("cde_data.csv") # resets index pandas default # i.e. index starts @ 0 first row , # 1 second , continues 1 till # end of data in above csv file. df.reset_in

c++ - Busy loop slows down latency-critical computation -

my code following: do long-running intense computation (called useless below) do small latency-critical task i find time takes execute latency-critical task higher long-running computation without it. here stand-alone c++ code reproduce effect: #include <stdio.h> #include <stdint.h> #define len 128 #define useless 1000000000 //#define useless 0 // read timestamp counter static inline long long get_cycles() { unsigned low, high; unsigned long long val; asm volatile ("rdtsc" : "=a" (low), "=d" (high)); val = high; val = (val << 32) | low; return val; } // compute simple hash static inline uint32_t hash(uint32_t *arr, int n) { uint32_t ret = 0; for(int = 0; < n; i++) { ret = (ret + (324723947 + arr[i])) ^ 93485734985; } return ret;

Java emulation of MySQL COMRESS DECOMPRESS functions -

i'd insert byte data mysql varbinary column. data large want store in compressed way. i'm using percona 5.6 mysql. emulate compress function of mysql in java , insert result in database. use mysql decompress function in order access data. there way it? i have tried using standard java.zip package. doesn't work. edit . phrased differently, java equivalent of php's gzcompress (zlib)? the result of compress four-byte little endian length of uncompressed data, followed zlib stream containing compressed data. you can use deflater class in java compress zlib stream. precede result of four-byte length.

entity framework - System.Data.SqlClient.SqlException: Invalid object name 'dbo.__TransactionHistory' -

i error "system.data.sqlclient.sqlexception: invalid object name 'dbo.__transactionhistory'." when try creating new dbcontext using transactioncontext in ef 6.1.3. seems bug it's using transactioncontext api before dbmigrator/initializer has chance create since these operations done within transaction. below code replicates problem using system.data.entity; using system.data.entity.infrastructure; using system.data.entity.sqlserver; namespace consoleapplication1 { class program { static void main(string[] args) { new somedbcontext().database.initialize(false); } public class person { public virtual int id { get; set; } public virtual string name { get; set; } } public class myconfiguration : dbconfiguration { public myconfiguration() { settransactionhandler(sqlproviderservices.providerinvarian

How to convert plain text to html but keep the display format? -

i have 1 plain text program output, want display in html page. still want keep formats (like space/tab/enter , etc.), it's code block of stackoverflow, how can display in html ? thanks use "pre" , "code" html tags: <pre><code> code in here... </code></pre>

objective c - How to apply multiple arrays in expandable tableview in ios -

hi have tried apply multiple arrays in expandable tableview. but when run code it's showing exception. exception:'invalid update: invalid number of rows in section 1. number of rows contained in existing section after update (4) must equal number of rows contained in section before update (0), plus or minus number of rows inserted or deleted section (0 inserted, 0 deleted) , plus or minus number of rows moved or out of section (0 moved in, 0 moved out) how solve exception (or) other example available please suggest me. please me. my code: .m file #import "expandablelistviewwithservices.h" @interface expandablelistviewwithservices (){ backgroundpostserviceclass3 * back; nsmutablearray *arrayforbool,*totallistofarray,*resparray; nsarray *sectiontitlearray; uitableview *tablelist; } @end @implementation expandablelistviewwithservices - (void)viewdidload { [super viewdidload]; tablelist = [[uitableview alloc] initw

php - Apai-io Amazon Adversting -

i using apai-io, , got response problem response bery long string , can see links in there, how can solve , know should use transfomer of responses , , need view xml dont understand how , have tried ->setresponsetransformer(new \apaiio\responsetransformer\xmltodomdocument()); but still long string, how can solve it, thank in advance can provide.

c# - Using directive for basic types like C++ typedef -

i[m trying mimic c++ typedef on c# using using clause: using mystring = system.string; using myint = system.int32; using mybool = system.boolean; using myfloat = float; it works types, except float type, basic type. is there way similar c++ ? typedef float myfloat; using myfloat = system.single; references: msdn - built-in types table (c# reference)

sql - Relational Division: Exact Division -

i came across following problem: write query find users same friends user u. here tables (and sql fiddle: http://sqlfiddle.com/#!9/457260/1 ): users: user_id: int friendships: user_id: int friend_id: int the issue have query returns users have same friends or more user u. select * users inner join friendships on users.id = friendships.user_id users.id != 1 , friendships.friend_id in ( select distinct friendships.friend_id friendships friendships.user_id = 1 ) group users.id having count(distinct friendships.friend_id) = ( select count(distinct friendships.friend_id) friendships friendships.user_id = 1 ); the simplest way aggregate friends , comparison: with f ( select user_id, array_agg(friend_id order friend_id) friends friendships f group user_id ) select user_id f f.friends = (select friends f user_id = 1) , f.user_id <> 1;

java - How to map XML to POJO -

i have following result: <result xmlns="urn:buscape" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" totalresultsavailable="1" totalresultsreturned="1" totalpages="1" page="1" totallooseoffers="0" xsi:schemalocation="http://developer.buscape.com/admin/lomadee.xsd"> <details> <applicationid>999999999999999</applicationid> <applicationversion>1.0</applicationversion> <applicationpath/> <date>2016-09-12t23:50:19.722-03:00</date> <elapsedtime>19</elapsedtime> <status>success</status> <code>0</code> <message>success</message> </details> <lomadeelinks> <lomadeelink> <id>1</id> <originallink>link</originallink> <redirectlink>link2</redirectlink> <code>0</code> </l

c# - how to exclude some list properties to make data table -

in below utility function (list data table), how can exclude member of list. like, don't want send 2 properties "uniquekey" & "pointtopointdata" utility method below, public class pointdataclone { public int dataid { get; set; } public string uniquekey { get; set; } public int count { get; set; } public list<pointtopointdata> pointtopointdata { get; set; } } utility function, public static datatable todatatable<t>(this list<t> ilist) { datatable datatable = new datatable(); propertydescriptorcollection propertydescriptorcollection = typedescriptor.getproperties(typeof(t)); (int = 0; < propertydescriptorcollection.count; i++) { propertydescriptor propertydescriptor = propertydescriptorcollection[i]; type type = propertydescriptor.propertytype; if (type.isgenerictype && type.getgenerictypedefinition() == typeof(nullable<>))

android - How to use Authorization Token token=A-123456789qwertyuio12 Header in Retrofit 2.0 -

im trying consume api has authorization header, can 200 response in postman data cant work in retrofit may need add token using okhttp interceptor. okhttpclient client = new okhttpclient.builder() .addnetworkinterceptor(mtokeninterceptor) .build(); then add retrofit : retrofit retrofit = new retrofit.builder() .client(client) .baseurl(base_url) .build(); the mtokeninterceptor : interceptor mtokeninterceptor = new interceptor() { @override public response intercept(chain chain) throws ioexception { request request = chain.request(); if (mtoken != null) { request.builder requestbuilder = request.newbuilder() .addheader("authorization", mtoken); request newrequest = requestbuilder.build(); return chain.proceed(newrequest); } return chain.proceed(request); } }; when token , assign mtoken ,

In Oracle Database, how do you extract text in-between characters? (SQL) -

i'm new @ sql , have been trying practice working oracle database. while working on activity, came across 1 confounds me -- trying extract specific text in-between characters. specific activity cannot seem figure out using these functions is: for table called users in column called emails , extract email domain (that is, text in-between @ , .), full email addresses: mjane@yahoo.com jdoe@aol.com jbarry@outlook.com becomes new column called domains values: yahoo aol outlook so far have been able write code isolates username to: mjane jdoe jbarry using code: `select rtrim(emails,substr(emails,instr(emails,'@'))) studentemails;` any extremely appreciated! i've been scratching head hours! thank you!!! select substr(emails, instr(emails, '@') + 1, instr(emails, '.') - instr(emails, '@') - 1) domains users caveat: i assume emails have single dot separating domain name

haskell - What is the monomorphism restriction? -

i'm puzzled how haskell compiler infers types less polymorphic i'd expect, example when using point-free definitions. it seems issue "monomorphism restriction", on default on older versions of compiler. consider following haskell program: {-# language monomorphismrestriction #-} import data.list(sortby) plus = (+) plus' x = (+ x) sort = sortby compare main = print $ plus' 1.0 2.0 print $ plus 1.0 2.0 print $ sort [3, 1, 2] if compile ghc obtain no erros , output of executable is: 3.0 3.0 [1,2,3] if change main body to: main = print $ plus' 1.0 2.0 print $ plus (1 :: int) 2 print $ sort [3, 1, 2] i no compile time errors , output becomes: 3.0 3 [1,2,3] as expected. if try change to: main = print $ plus' 1.0 2.0 print $ plus (1 :: int) 2 print $ plus 1.0 2.0 print $ sort [3, 1, 2] i type error: test.hs:13:16: no instance (fractional int) arising literal ‘1.0’ in first argument of ‘plus’, nam