Posts

Showing posts from July, 2015

python - add fields in admin.py from a ManyToMany -

Image
i display each question page corresponds have 4 items in class page ( "visit 1 visit 2 visit 3 visit 4") for seem pages @ once ... want if example question "how old you?" defined visit 1 turn around in admin panel "visite 1" only i can share screenshot see my models.py : class page(models.model): title = models.charfield(max_length=30) def __str__(self): return self.title class question(models.model): label = models.charfield(max_length=30) page = models.manytomanyfield(page) def __str__(self): return self.label class reply(models.model): question = models.foreignkey(question) user = models.foreignkey(personne) answer = models.charfield(max_length=30) creationdate = models.datetimefield(default=datetime.datetime(2016, 1, 20, 15, 4, 21, 467165)) def __str__(self): return str(self.answer) my admin.py : class replyadmin(admin.modeladmin): list_display = [...

microsoft metro - Design My Windows Store App in Potrait -

Image
i windows phone developer , started windows store apps. want app work in portrait mode when device tilted landscape (i don't want app change landscape mode). how can set windows store app accomplish this? in app manifest, can set supported rotations: that said may have issue in certification result, since snapped mode requirement . snapped mode applies landscape orientation, seem wouldn't need do, this thread suggests , may have issue. possible workaround provide nominal landscape view says app runs in portrait mode, heavily document rationale supporting portrait in "notes testers" when submit app store.

c++ - Argument passing standardization -

my c++ project getting huge. in situations i'm passing arguments reference own convenience, in don't. here's example: struct foo{ foo(int &member){ this->member = &member; } private: int *member; }; i'm using pattern when don't want create 2 instances of int variable. don't have implement get or modify methods manipulate value. instead can change variable without accessing foo object. i'm using different way of managing member variables: struct foo{ foo(int member){ this->member = member; } void modify_member(){ this->member = 6; } int get_member(){ return this->member; } private: int member; }; i'm not sure whether mixing these 2 methods of managing members in same struct practice. should normalize it? example every function in given struct using "pass value" method? your first case recipe disaster. you'll end...

javascript - Difference between two statements that declare an object -

what difference between statement var x = x || {}; and this. same thing? there performance difference? var x = typeof x === "undefined" ? {} : x; they're not same. the || return object when x any possible falsy value. typeof check only return {} if x undefined . according this test , undefined check twice fast. that's because no type casting required.

java - AWS Lambda: How to extract a tgz file in a S3 bucket and put it in another S3 bucket -

i have s3 bucket named "source". many '.tgz' files being pushed bucket in real-time. wrote java code extracting '.tgz' file , pushing "destination" bucket. pushed code lambda function. got '.tgz' file inputstream in java code. how extract in lambda ? i'm not able create file in lambda, throws "filenotfound(permission denied)" in java. amazons3 s3client = new amazons3client(); s3object s3object = s3client.getobject(new getobjectrequest(srcbucket, srckey)); inputstream objectdata = s3object.getobjectcontent(); file file = new file(s3object.getkey()); outputstream writer = new bufferedoutputstream(new fileoutputstream(file)); <--- throws filenotfound(permission denied) here don't use file or fileoutputstream , use s3client.putobject() . read tgz file, can use apache commons compress. example: archiveinputstream tar = new archiveinputstreamfactory(). createarchiveinputstream("tar", new gzipin...

c# - How to get a normalized value to change a UI text element in Unity? -

i have normalized value coming current position of animation. how convert text output depending on value within string ? for example if (animation.time < 0.1) { text = january; } else (0.1 < animation.time < 0.2) { text = february; } etc, way until 1, because of normalized value. i realise code won't work @ all, think logic needed work, far i've had no luck. edit, elaborated question. have slider moves depending on progression of animation, via converting animationtime normalized value slider fills in relation animation. i'd take value of normalized time display current related date of animation, on screen, if animation shows years progression, slider moves , normalized value can have text count in months. i hope makes more sense now. to "month string" in unity this... say have "3" .. string monthstring = new system.datetime(1,3,1).tostring("mmmm"); debug.log("teste " + monthstring ); ...

r - lsmeans and difflsmeans return no output for lmer object -

i'm trying calculate confidence intervals fixed effects in lmer mixed model, , difflsmeans , lsmeans return empty table. i've tried lme() having trouble model convergence (hence using lmer). the data (where bout dependent level 1 variable , twaverage independent level 2 variable of interest , sex, location , ra further nesting levels): id bout twaverage sex location ra 1 17 3.748333333 1 big society 1337 1 59 3.748333333 1 big society 1337 1 14 3.748333333 1 big society 1337 1 9 3.748333333 1 big society 1337 1 9 3.748333333 1 big society 1337 1 14 3.748333333 1 big society 1337 1 21 3.748333333 1 big society 1337 2 40 3.055833333 0 big society 1337 2 63 3.055833333 0 big society 1337 2 7 3.055833333 0 big society 1337 2 75 3.055833333 0 big society 1337 2 13 3.055833333 0 big society 1337 2 3 3.055833333 0 big society 1337 2 16 3.055833333 0 big society 1337 3 103 3.696666667 1 big socie...

c++ - Insert an `__asm__` block to do a addition in very large numbers -

i doing program, , @ point need make efficient. using haswell microarchitecture (64bits) , 'g++'. objective made use of adc instruction, until loop ends. //i removed every carry handlers preview, yo more simple size_t anum = ap[i], bnum = bp[i]; unsigned carry; // carry flag set here common addtion anum += bnum; cnum[0]= anum; carry = check_carry(anum, bnum); (int i=1; i<n; i++){ anum = ap[i]; bnum = bp[i]; //i want remove line , insert __asm__ block anum += (bnum + carry); carry = check_carry(anum, bnum); //this block not working __asm__( "movq -64(%rbp), %rcx;" "adcq %rdx, %rcx;" "movq %rsi, -88(%rbp);" ); cnum[i] = anum; } is cf set only in first addition? or every time adc instruction? i think problem on loss of cf , every time loop done. if problem how can solve it? you use asm in gcc family of compilers: int src = 1; int dst...

facebook - page-id/notifications returns an empty array -

i'm writing desktop application using facebook sdk .net. app must somethink every post, comment or message sent facebook page. i'm using page-id/notifications api command: page-id/notifications?fields=id,title,unread,application,from,message,object&limit=250 this command returns correct unseen count in summary section data array empty: { "data": [ ], "summary": { "unseen_count": 2, "updated_time": "2016-02-05t14:53:10+0000" } } if write new wall post on page or send private message page, unseen_count updated data array empty. if someoune write comment exisiting wall post unseen_count updates , data array populated comment notification (only type of notification added data array): { "data": [ { "id": "notif_xxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxx", "title": "yyyyy yyyyyyy commented on post.", "unread": 1, "ap...

javascript - Template level reactivity in Meteor -

Image
i'm working on problem want display data in dashboard both chart (via perak:c3 ) , in table (via aslagle:reactive-table ). issue data pulled collection in mongodb, , it's format instantly amenable plotting via c3, needs transformed local collection used reactive-table package, suggested in this answer previous question. when change dataset displayed want chart updated, , table also. requires changing values in local collection, however, slows things down , rather chart being smoothly redrawn, there freeze on page, , new data displayed. i have created sample project on github here problem can replicated easily. if run app , select dataset in browser see mean to see reactive behaviour want preserve in chart go client/templates/dashboard/dashboard.html , comment out table template {{> dashboardtable}} and change dataset see how chart smoothly redrawn. trying ensure both templates dashboardchart , dashboardtable render independently of 1 another. update...

Randomly swap two elements in an array in c++ -

is there way randomly swap 2 elements (two different index) in array in c++? idea randomly pick first index, randomly pick second 1 till second index different first index. swap these 2 elements. wondering there better way this? i think different random_shuffle because each time want swap 2 elements in array , keep others in original order. yes, pick 2 numbers first [0...n-1] , second [0..n-2] . if first <= second ++second second ends in [0...first-1] or [first+1...n-1] . no retries needed. example: have n=10 first runs 0-9 inclusive. imagine pick first=5 . know have 9 elements left pick second , namely 0-4 , 6-9 . pick number 0-8 instead, , map subrange of possible results 5-8 6-9 adding one. <= important. if added 1 if first!=second , chances of swapping 5 , 6 double, , chances of swapping 5 , 9 0%.

haskell - How to omit fields that will be filled in by the database -

i've started off persistent yesod , have hit first roadblock. share [mkpersist sqlsettings, mkmigrate "migrateall"] [persistlowercase| user email string createdat utctime maybe default=current_time updatedat utctime maybe default=current_time deriving show |] u <- insert $ user "saurabhnanda@gmail.com" nothing nothing i'm coming rails background , schema design conventions advocated them. in particular case, having every table have created_at , updated_at timestamp. however, there way not specify createdat , updatedat fields every object created? i don't know persistent, usual technique kind of thing define parameterized types. example, might write data dated = dated { created :: utctime , updated :: utctime , value :: } then bare values need not worry metadata, , metadata can handled uniformly across different types. e.g. might expose api this: new :: -> io (dated a) new = <- getutctime ...

asp.net - No mapping data was returned from the server in Visual Studio Page Inspector -

to debug web app, need run on specific domain. i've created domain mappings in hosts file, mapping 127.0.0.1. site runs in local iis 8. but when try run page inspector on app, error stating "no mapping data returned server". i've set debugging urls in project properties, , site runs fine when hit f5. how page inspector work on non-localhost urls (or rather, how iis serve mapping data page inspector needs)?

json - JsonConvert::DeserializeObject erro c++ cli -

i'm trying open file , .json sends class. error when doing. ref class cutannotationjson { public: int index; string^ nometipo; double pontox1; double pontoy1; double pontox2; double pontoy2; double height; int r; int g; int b; int numbercut; }; ref class panoramicannotationjson { public: int index; string^ nometipo; double pontox1; double pontoy1; double pontox2; double pontoy2; int r; int g; int b; }; ref class dadosjson { public: list<panoramicannotationjson^>^ panoramicannotation = gcnew list<panoramicannotationjson^>; list<cutannotationjson^>^ cutannotation = gcnew list<cutannotationjson^>; }; using dadosjson^ dadosjson = jsonconvert::deserializeobject<dadosjson^>(file::readalltext("c:/movie.json")); error message: 103 intellisense: more 1 instance of overloaded function "newtonsoft::json::jsonconvert::dese...

java - Clickable relief (picture) of a country -

Image
i want have picture of country in android application. country has split in regions. when user click on specific region, specific screen should open. regions should separated lines, user can see start/end of region. here example of country (this lines not regions example of them - 5-6 regions in reallity): i don't know how make: layout kind of shape lines, separate regions onclicklisteners specific region. any suggestion help. you can try imagemap android. following links contains more info , related project on git hub: http://catchthecows.com/2011/08/09/imagemap_for_android/ https://github.com/catchthecows/androidimagemap

python - Django multiple forms one Submit -

i know question has been answered before on site, life of me can't figure out. want submit 2 forms @ once, one submit button. please, can identify wrong code, driving me insane. html template (edited) <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <form action="{% url "list" %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <p>{{ form.non_field_errors }}</p> <p>{{ form.docfile.label_tag }} {{ form.docfile.help_text }}</p> <p> {{ form.docfile.errors }} {{ form.docfile }} </p> <p>{{ form.non_field_errors }}</p> <p>{{ form.docfile.label_tag }} {{ form.docfile.help_text }}</p> ...

excel - Changing values of a specific column within a range -

i want set values of column within current selected range. example, current selected range (which vary) a5:d10, want values in column b of range "something". i'm guessing like: activecell.columns("b").value="something" thanks. you use intersect() function... sub intersection_example() dim rngb range dim rngresult range set rngb = columns("b") set rngresult = intersect(selection, rngb) rngresult.value = "something" end sub

javascript - else if statement with different paremeters -

i making statements site, , can't understand, how make such type of statement. here code function checkwindowsize() { var pagewidth = $(window).width(); if (pagewidth < 751) { $('.tab-content div').removeclass('tab-pane'); $('#mytabs a').removeattr("data-toggle", "tab"); } else if (pagewidth < 751 && $(window).scrolltop()>=580;) { $('#faq .col-sm-3').addclass('fixed-faq'); $('.tab-content div').addclass('padd-top'); } else { $('#faq .col-sm-3').removeclass('fixed-faq'); $('.tab-content div').removeclass('padd-top'); $('#mytabs a').attr("data-toggle", "tab"); $('.tab-content div').addclass('tab-pane'); }; }; $(window).load(checkwindowsize); $(window).resize(checkwindowsize); it works fine checking width , statements if, , else, when try make else if, 2 parameters...

java - JustTouched works on windows? -

i'm using justtouched manipulate easly touches , released in android, cause istouched method acumulates many touches; works same in windows? meaning, 1 event when keep pressed? or need method/invoker/listener? on desktop builds, libgdx treats mouse button presses touches. justtouched acts same, except polls mouse buttons instead of screen taps. , how on mobile can't tell finger touched screen, can't tell mouse button pressed. if need know mouse button or finger touched down, need use inputprocessor, gives far more information using gdx.input convenience methods. if don't care mouse button pressed, need is: if (gdx.input.justtouched()){ //... } based on comments under question, seem trying distinguish button touched || gdx.input.isbuttonpressed(input.buttons.left)) return true on every frame long left button held down. , if instead did && gdx.input.isbuttonpressed(input.buttons.left)) , wouldn't sure it's left button pressed. (m...

ios - PHFetchOptions mediaSubtype predicate -

following predicate should fetch screenshots only, work fine. options.predicate = [nspredicate predicatewithformat:@"(mediasubtype & %d) != 0", phassetmediasubtypephotoscreenshot]; however if try exclude screenshots using follwing predicate, of images excluded options.predicate = [nspredicate predicatewithformat:@"(mediasubtype & %d) = 0", phassetmediasubtypephotoscreenshot]; all im trying exlude screeshots asset fetch. is known bug or missing ? i made quick check , seems work me: phfetchoptions *options = [[phfetchoptions alloc] init]; options.predicate = [nspredicate predicatewithformat:@"(mediasubtype & %d) == 0", phassetmediasubtypephotoscreenshot]; note double equal in predicate comparison instead of single one.

python - Drop row and column of a dataframe that contains the non-zero minimum -

i have symmetric pandas dataframe. want drop column , row contains non-zero minimum of whole dataframe. for example if consider: b c d e 0 2 1 5 3 b 2 0 7 4 8 c 1 7 0 10 6 d 5 4 10 0 11 e 3 8 6 11 0 i want drop [row a, col c] , therefore [row c, col a] contains 1 (minimum). expected output is: b d e b 0 4 8 d 4 0 11 e 8 11 0 what fastest method can that? iiuc select data dataframe without dropping loc : mask = ~(df ==1).any() in [29]: df.loc[mask, mask] out[29]: b d e b 0 4 8 d 4 0 11 e 8 11 0 edit to find minimum value dataframe except 0 use twice min , first find minimum value through column , second find minimum value of resulted series : in [48]: df[df != 0].min().min() out[48]: 1.0 then pass in above solution: min_val = df[df != 0].min().min() mask = ~(df == min_val).any() in [50]: df.loc[mask, mask] out[50]:...

jquery callback function only working on last loop -

for(var i=0; i<barvalues.length; i++) { actualbarheight = math.floor((barvalues[i]/chartmaxy)*barchartheight); var barchartid = "#barchart" + (i+1) $(barchartid + " .value span").css('background-color','transparent'); $(barchartid + " img").animate({ height: actualbarheight }, 500, function(){$(barchartid + " .value span").css('background-color','white');} ); $(barchartid + " .value span").html("$"+math.floor(barvalues[i])); $(barchartid + " .value").css("bottom",actualbarheight+"px"); $(barchartid + " .ylabel").html(chartmaxy); }; the above bit of jquery inside loop. each iteration of loop following: sets background of span animates object upon finishing, resets background of span i'm using call function reset background finishes animation before doing so. however, ends aff...

mysql - Apply DISTINT on the JOIN table is not working -

my query summing fee based on woks table (which 3 parts) result should 13000 getting 39000. # order table ------------------------------------------- | id | order | name | fee | ------------------------------------------- | 1 | select statement | ab | 13000 | ------------------------------------------- # work table ----------------------------- | id | user id | order id | ----------------------------- | 1 | 123 | 1 | | 2 | 123 | 1 | | 3 | 123 | 1 | ----------------------------- # query select o.order_id, sum(o.fee) total_words users u left join works wr on wr.user_id = u.id left join orders o on o.order_id = wr.order_id u.id = 123 # output => array ( [order_id] => 1 [fee] => 39000 ) i have tried distinct , group same result. sql fiddle demo select `user_id`, sum(orders.`fee`) (select distinct `user_id`, `order_id` works ) user_work join orders on use...

javascript - Bootstrap Month-Year Picker -

Image
i need add couple of month-year pickers form i'm creating in bootstrap template. have found plugin need, written in older version of jquery , therefore breaks... can't roll previous version break other plugins on page. what need here: http://techbrij.com/month-range-picker-jquery-ui-datepicker it's simple way enter date range using month/year options. used select periods of employment. can steer me in right direction migrate jquery 2.1.*? edit 2016-02-08 seems conflict lies bootstrap template. template i'm using adminlte almsaeed studio this gets rendered after following steps load jquery/jquery-ui it appears work fine, reconstructed example using following script url's jquery(version 2.1.3) , jqueryui(version 1.11.2). make including both in script tag right before closing </body> tag. original code online article @ http://techbrij.com/month-range-picker-jquery-ui-datepicker . cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js c...

java - Why Object class have static block? -

Image
i want know why object,string etc. have static{} block @ end.what use of static block in object class. open cmd prompt , type javap java.lang.object what looking @ method , field declarations. since static block method, see empty declaration of static-initalizer. if @ openjdk source code java.lang.object on line 40, code says public class object { private static native void registernatives(); static { registernatives(); } a simple explanation of static block block gets called once , no matter how many objects of type create. if want more information command line, javap -verbose java.lang.object outputs this static {}; descriptor: ()v flags: acc_static code: stack=0, locals=0, args_size=0 0: invokestatic #16 // method registernatives:()v 3: return linenumbertable: line 41: 0 line 42: 3 } or, less verbose javap -c java.lang.object static {}; ...

asp.net mvc - How to make web API Post method call -

i have solution 2 project , 1 webapi service , mvc project . calling service controller. service has get,post,put methods. in view using submit button , calles post controller method in turn call service . here issue facing is calling method. want fire post method in service controller post method [httppost] public actionresult create(test test) { if (modelstate.isvalid) { test objtest = myservice.create(test); if (objtest == null) { return httpnotfound(); } return redirecttoaction("index"); } } here calls service **public test create(test test) { string uri = baseuri + "test/"; using (httpclient httpclient = new httpclient()) { task<httpresponsemessage> response = httpclient.pos...

idl - How to specify non-default Thrift Protocols and Transports -

i have read official apache thrift docs . have read excellent thrift example docs . have read more excellent thrift: missing guide . nowhere can figure out how specify, say, tcompactprotocol on default ( tbinaryprotocol ). or, say, tframedsocket on default ( tsocket ). can elaborate here? a protocol in thrift describes format how actual data bits written to/read underlying storage medium. typically 1 such thing needed, stacking them not necessary, since need 1 physical layout serialize data. in contrast, designed stacked called "layered transports". transports operate on lower level of abstraction. typical examples tframedtransport , tbufferedtransport . layered transports add functionality byte stream, such adding frame size, buffering data or offering multiplexing capabilities. technically these located between protocol , underlying "endpoint transports" write/read bytes to/from storage medium (e.g. socket). consequently, if need change co...

jquery - Create JSON with data from database and JavaScript generated -

Image
i need create calendar view fullcalendar.io. dates, have specific price in database , retrieve it, dates (without specific prices) need put usual rates in objects need create javascript. problem because don't know how make json that. in short: need have price every date, dates data database. how create such json objects in javascript? i have code: var db_data = [ { "id": 5, "user_id": 1, "article_id": 5, "title": "", "start": "2016-03-25 15:18:46" }, { "id": 4, "user_id": 1, "article_id": 5, "price": 55, "title": "", "start": "2016-03-15 15:18:46" }, { "id": 3, "user_id": 1, "article_id": 5, "price": 35, "title": "", "start": "2016-03-07 15:18:46" }, { "id...

xcode - OSX System Log location -

Image
i trying export localizations on osx application using xcode 7.0.1 (7a1001) beta. unfortunately i'm getting 'localization failed read strings file' error. states 'please check system log more details' - idea of can find (or read from) logfile? i running osx 10.11.1. as trojanfoe pointed out, it's in console.app under files sub-heading.

jquery - getJSON() callback not working with PHP file -

php code=>` <?php //request data database //code here connect database , data want /* example json format { "item1": "i love jquery4u", "item2": "you love jquery4u", "item3": "we love jquery4u" } */ //return in json format echo "{"; echo "item1: ", json_encode($item1), "\n"; echo "item2: ", json_encode($item2), "\n"; echo "item3: ", json_encode($item3), "\n"; echo "}"; ?> js=> $(document).ready(function(){ //attach jquery live event button $('#getdata-button').click(function(){ $.get('json-data.php', function(data) { //alert(data); //uncomment debug //alert (data.item1+" "+data.item2+" "+data.item3); //further debug $('#showdata').html("...

node.js - Use different database for the npm test phase -

environment: heroku, node.js - express, testing mocha. how can configure heroku launch npm test node_env="test" , invoke server (" node server.js ") node_env="production" . this means need 2 server invocations - once testing (where connect test db) , once production (where connect production db) i want use different db in " npm test " phase since tests create fake data. here how test like: var supertest = require("supertest"); var should = require('chai').should(); var config = require('../server/config'); var server = supertest.agent(config.baseurl); describe("user controller", function () { describe("http verbs", function () { it("get", function (done) { console.log(config.dburl); console.log(config.baseurl); server.post("/api/user") { .send(utils.createmockeduserplainobject()) ...

swift - Why am I allowed to create multiple instances of Singleton, even though its constructor is private? -

the code below singleton example book study swift. isn't aim of creating singletons having 1 object of type? in playground, i've been able create multiple gamemanager s ( var = gamemanager() , var b = gamemanager() etc.) by way aware there 1 defaultmanager object , cannot changed due being static , constant (let). couldn't use of private constructor since able create multiple gamemanager s. class gamemanager { static let defaultmanager = gamemanager() var gamescore = 0 var savestate = 0 private init() {} } playground can access private constructor because swift lets access private long code in same file private code. since typed directly playground editor's window considered single file, can access everywhere. once put code outside playground, though, constructor's visibility enforced, preventing code creating instances of gamemanager intended.

registry - How to disable registered OpenCL platforms on Windows? -

i using opencl 2.0 on windows. machine has 2 platforms: cuda gpu (with opencl 1.2) intel cpu/gpu (with opencl 2.0) i don't want opencl api return cuda platform @ all. according article , opencl.dll returns registered platforms looking @ windows registry. however, there no mention of registry keys searched for. how can disable opencl driver/platform on windows not returned api? as mention, opencl icd loader gets list of available opencl platforms windows registry. prevent opencl platform appearing opencl application running on system, need remove corresponding value 1 or both of these registry keys: for 32-bit machines or 64-bit apps on 64-bit machine: hkey_local_machine\software\khronos\opencl\vendors for 32-bit apps on 64-bit machine: hkey_local_machine\software\wow6432node\khronos\opencl\vendors the name of registry value full path .dll providing opencl runtime implementation. this heavy-handed approach solving problem, in opinion. opencl applicatio...

android - How to manage all local storages in all versions (primary, secondary storage, sd card, usb) -

intro managing primary storage files + secondary storage files (local only): list informations have , extend them or correct me question becomes overview summarises main informations has know before starting work local storages. i'm sure many people looking such overview... overview normally have following storages: a primary storage (always directly accessible, on internal storage, it's phone manufactorer) a secondary storage (directly accessible android <=4.3) other external storages usb otg example... following questions raise up: how find out available local storages + find out type (primary, secondary resp. internal, sd card, usb)? list available files on storages 2.1 storages indexed via mediastore ? 2.2 how files via mediastore ? 2.3 how files without mediastore ? how edit files on storages? most of things know, questions based on data indexed media store, how find out storages available, how identify storage... post answer answers of p...

android - Alarm manager setRepeating for only fixed number of days -

i need set alarm, go off, @ particular time fixed number of days. aware of setrepeating method, keep triggering alarm, after specified time interval. need trigger specified time duration. for eg: have 'start date', 'end date', 'interval' , 'time trigger' user. alarm should trigger start date end date. how should implement this? check whenever alarm schedule check if end_date has reached , if has cancel alarm , or use alarmmanager set method set alarm each time after checking end date

Create Unique Sub List within List in Sharepoint Online -

im trying create unique sub list within list in sharepoint online (2013). i realize sub lists arent possible , can use lookup fields attach list. doesn't seem work situation. i trying have list item allows upload unique files per list item. example: reports may 2015 ---school.xml ---food.xml reports jun 2016 ---university.xml ---beach.xml each list item have set of unique files related it.the user needs able make list item (reports ... in case), of course have other fields , descriptions attached (hence list) , able upload unique documents list item. im having problems figuring out how in sharepoint. if there way go better it. you're right - sublists aren't thing in sharepoint. reading requirements, i'm not sure if need 2 lists looking for. possible have single document library custom field "category" or "report month". field either single line of text field or choice field. there create custom view group field , give hierarchi...

c# - Returning a date from a class -

what want have user enter date , have class returns last day of month. so, i've put in class module: public static class stringextensions { public static datetime lastdayofmonth(datetime mydate) { datetime today = mydate; datetime eom = new datetime(today.year,today.month, datetime.daysinmonth(today.year, today.month)); return eom; } } in code-behind, have this: datetime ldom = stringextensions.lastdayofmonth(txtcit.text); i've tried hard-coding date like: datetime ldom = stringextensions.lastdayofmonth('1/12/2016'); i'm getting these errors: error 14 best overloaded method match 'clientdpl.stringextensions.lastdayofmonth(system.datetime)' has invalid arguments and error 15 argument 1: cannot convert 'string' 'system.datetime' can see i'm doing wrong? as @mason pointed out in comment, better way use...

carousel - Handle swipe events in Sencha Touch 2 -

i use carousel in sencha touch 2. how can handle swipe-left , swipe-right events ? one way listen swipe event on carousel items along using ext.event.event.direction handle direction of swipe: listeners: { initialize: function(c) { this.element.on({ swipe: function(e, node, options) { if(e.direction == "left") { alert("hey! swipe left"); } else { alert("hey! swipe right"); } } }); } } working demo: http://www.senchafiddle.com/#tlbzb

javascript - Getting Highcharts tooltip to return an angular directive? -

we trying create complex tooltips our highcharts graph, showing dynamic data thats in app not displayed graph, figured best bet create angular directive formatting , such, , enable usehtml : true attribute of highcharts along custom formatter function. $compile() doesn't throw error.. however when code runs, tooltip shows object.object text, , not content of directive's template. missing something, or not going possible? below example of we're trying... tooltip: { usehtml: true, formatter: function () { return $compile("<pm-error-rate-tooltip ></<pm-error-rate-tooltip>")($scope); } } i'm wondering if needs 'appended' dom element work, if i'm not sure element named tooltip? you giving formatter dom element, , wants html string. converting html works, seems inefficient way accomplish goal. http://jsfiddle.net/...

sql - For Loop With Object Table? -

say object functions etc. defined on , have table create table person_obj_table of person_typ; now want use loop iterate through table so x in (select value(t) person_obj_table t lastname = 'smith') loop dbms_output.put_line(x.get_fullname); end loop; this seems fail though x not recognized person_typ. clue here? give value(x) expression name v , , use name: for x in (select value(t) v person_obj_table t lastname = 'smith') loop dbms_output.put_line(x.v.get_fullname); end loop;

SAS--exclude the first few rows -

Image
i have set of data below. need exclude first few rows 'counts <100' based on model. once counts >100, following rows kept no matter counts > 100 or <100. |make |model |soldmonth|counts| |ford |class_c |jan_2015 |80 | |ford |class_c |feb_2015 |90 | |ford |class_c |mar_2015 |70 | |ford |class_c |apr_2015 |120 | |ford |class_c |may_2015 |130 | |ford |class_c |jun_2015 |50 | |ford |class_c |jul_2015 |70 | |ford |class_c |aug_2015 |140 | |ford |class_c |sep_2015 |110 | |ford |maxi |jan_2015 |20 | |ford |maxi |feb_2015 |50 | |ford |maxi |mar_2015 |80 | |ford |maxi |apr_2015 |120 | |ford |maxi |may_2015 |130 | |ford |maxi |jun_2015 |110 | |ford |maxi |jul_2015 |180 | |ford |maxi |aug_2015 |90 | |ford |maxi |sep_2015 |110 | here want get: |make |model |soldmonth |counts| |ford |class_c |apr_2015 |120 | |ford |class_c |may_2015 |130 | |ford |class_c |jun_2015 |50 |...

join - mysql count records by subquery on same table -

my problem joining 4 tables left join cant use group rather sub query. how count of main table based on specific column tips . possible. in advance i have tried way. select * ,sql_1.trans table1 left join table b on condition left join ( select count(*) trans,dentist_id did3 table1 group dentist_id ) sql_1 on did3=a.dentist_id a.current_tab='pack'

bash - Substitute the remaining part of line after pattern matching with input from user -

i looking bash command matches pattern in file , substitutes remaining part of line input script asks user.is possible in bash script? for example :i have file input file program.i wish change parts of using bash script. karyotype ='red.txt' chromosomes_units = 1000000 <ideogram> <spacing> default = 0.001r </spacing> radius = 0.9r thickness = 20p fill = yes so,is possible can search 'karyotype = ' using grep/sed command , change remaining part of line based on user prompt.for example,i wish change red.txt file name provided user. you can use sed this: # user input string str='foo.bar' # use sed replacement sed -i.bak "s~^\( *karyotype *= *\).*$~\1'$str'~" input # check results cat input karyotype ='foo.bar' chromosomes_units = 1000000 <ideogram> <spacing> default = 0.001r </spacing> radius = 0.9r thickness = 20p fill = yes alternatively can use safer a...

Linux kernel module, concept of configuration and persistent state -

i work on linux kernel loadable module , proper way configure , way load/store binary data when module loaded/unloaded. module needs read configuration data in time of loading, may change data , save them in run-time. read on many places reading/writing file not recommended , read sysfs can used such purpose. can binary configuration data stored in sysfs ? or exist more suitable solution ? can provide link example or doc can found details how load/save persistent configuration module ? peter maybe can use firmware interface in module. should able load binary file include settings request_firmware(..) i think isn't required write binary file hardware...?

protobuf-net: Encoding for DateTime -

i'm using python protobuf library read message sent .net application use protobuf-net. .net app sends datetime. datetime encoding not seems trivial , don't know how parse it. know formatting of datetime in protobuf-net library? if doing on again, have done simpler - might still add option make simpler! but: bcl.proto basically, chooses correct scale guarantee value. need multiplication of .value based on .scale .

javascript - Debug Meteor server side in WebStorm -

i have followed these instructions debug meteor js in webstorm. allows me debug client side javascript code in ide, want import server side javascript code. i found this question . debugging server side in browser works, there way debug both, server , client side in webstorm?

watchkit - WKPickerItem in Objective C throwing errors -

i've got issue wkpickeritem in objective c that's driving me nuts. according examples i've seen following code should work... interfacecontroller.h #import <watchkit/watchkit.h> #import <foundation/foundation.h> @interface interfacecontroller : wkinterfacecontroller @end interfacecontroller.m #import "interfacecontroller.h" @interface interfacecontroller () @property (unsafe_unretained, nonatomic) iboutlet wkinterfacepicker *picker; @end @implementation interfacecontroller - (void)awakewithcontext:(id)context { [super awakewithcontext:context]; // configure interface objects here. nsmutablearray *arritems = [[nsmutablearray alloc] init]; (int z = 0; z <= 100; z++) { wkpickeritem *item = [wkpickeritem alloc]; // line 1 item.title = [nsstring stringwithformat:@"%d",z]; // line 2 [arritems addobject:item]; // line 3 } [self.picker setitems:arritems]; // line 4 } ...but i...

vector - moving my object with transform.Translate make it move in wrong way -

i'm having hard time unity trying translate simple object. object move in 3 dimension world on x , z axis. function i'm using translate function of transform of gameobject. x , z position i'm trying move object. transform.translate (( new vector3(x - transform.position.x ,0,z - transform.position.z)).normalized * time.deltatime * speed,space.world); so here's problem i'm dealing : if result of calcul following vector : (0,0,-1.0) , object move in wrong direction. example : starting position (25.16, 1.0, 12.0) final position after translate function : (25.6, 1.0, 12.1) any appeciate me understand this. i'm using script in 1 of projects move gameobject point, attach on game object , enter x , y in finpos. using unityengine; public class movementanimation : monobehaviour { public vector3 finpos; public bool loop = true; public int speed = 1; private vector3 startpos; private float start...

exchangewebservices - EWS C# property LastModifiedTime time not updated after read or unread message -

i doing search mails using specific date. use or filter parameters datetimecreated, datetimereceived , lastmodifiedtime. search specific property. the search query working messages received or modified (i.e. moved other folder) after specific date. i noticed messages created before specific date , changed read or unread after specific date not being retrieved. expected messages changed read or unread had lastmodifiedtime property changed. below code using: list<searchfilter> searchfilterorcolletion = new list<searchfilter>(); searchfilterorcolletion.add(new searchfilter.isgreaterthanorequalto(itemschema.datetimecreated, utcfromdate)); searchfilterorcolletion.add(new searchfilter.isgreaterthanorequalto(itemschema.datetimereceived, utcfromdate)); searchfilterorcolletion.add(new searchfilter.isgreaterthanorequalto(itemschema.lastmodifiedtime, utcfromdate)); searchfilter searc...

xaml - VS 2015 Live Visual Tree Always Blank -

question similar this one except see nothing in live visual tree window (for solution worked recently). post suggested checking "enable native code debugging" in project debug settings. i've tried no avail. more suggestions?

android - IllegalArgumentException: Could not locate call adapter for rx.Observable RxJava, Retrofit2 -

i getting above error while calling rest api. using both retrofit2 , rxjava. servicefactory.java public class servicefactory { public static <t> t createretrofitservice(final class<t> clazz, final string endpoint){ retrofit retrofit = new retrofit.builder() .baseurl(endpoint) //.addconverterfactory(gsonconverterfactory.create()) .build(); t service = retrofit.create(clazz); return service; } } movieservice.java public interface movieservice{ //public final string api_key = "<apikey>"; public final string service_end = "https://api.mymovies.org/3/"; @get("movie/{movieid}??api_key=xyz") observable<response<movies>> getmovies(@field("movieid") int movieid); } inside mainactivity movieservice tmdbservice = servicefactory.createretrofitservice(movieservice.class, movieservice.service_end); observable<response<movies>> responseob...

python - How to respond with 400 in Django on `MultiValueDictKeyError`? -

coming flask, request.args[key] , request.form[key] responds 400 if key doesn't exist. has nice property of failing fast . in django, request.get[key] , request.form[key] raises httpresponsebadrequest if key doesn't exist, causes api respond 500 status if unhandled. i've seen other answers recommending request.get.get(key) , inadvertently loosens api contract allow client-side bugs slip (e.g. query parameter typo, forgetting include param, etc). i manually check required query params: arg1 = request.post.get('arg1') if not arg1: raise httpbadrequest('"arg1" not provided.') arg2 = request.post.get('arg2') if not arg2: raise httpbadrequest('"arg1" not provided.') arg3 = request.post.get('arg3') if not arg3: raise httpbadrequest('"arg3" not provided.') but leaves lot of room error. (did notice typo?) i manually handle httpresponsebadrequest : def my_view(request):...

Java reflection and generics - parameterized type info missing "extends" -

i reconstitute signature of method using reflection in java 8. i've run issues generic methods. in particular, find nothing recover information cases of "extends" or "super" in template type declaration. here's specific test case, based on known source code: signature of method source code: public static <t extends assertdelegatetarget> t assertthat(t assertion) first of all, there elegant way reconstitute <t extends assertdelegatetarget> part without having parse strings? here's main info able reflection: method.tostring() : public static org.assertj.core.api.assertdelegatetarget org.assertj.core.api.assertions.assertthat(org.assertj.core.api.assertdelegatetarget) method.togenericstring() : public static <t> t org.assertj.core.api.assertions.assertthat(t) what happened "extends assertdelegatetarget"? method.getreturntype.tostring() : interface org.assertj.core.api.assertdelegatetarget method.getg...