Posts

Showing posts from April, 2012

jQuery DataTables: Save the same state for multiple tables -

i want when change state of table (example: number of lines per page), change recorded , applied tables. tried statesave: true , saved table made change. $('#currenttab').datatable({ "order": [[0, "desc"]], statesave: true }); $('#twowavetab').datatable({ "order": [[0, "desc"]], statesave: true }); $('#evoltab').datatable({ "order": [[0, "desc"]], statesave: true }); how can save same state table , @ same time other generic tables? it possible using statesaveparams event , state.save() api method. there no direct way copy state of 1 table another, need set each state property individually. code below copies page length 1 table others $(this).datatable().page.len(data.length) . you need replace example1 , example2 , example3 ids of tables ( currenttab , twowavetab , evoltab ). var table1 = $('#example1').datatable({ "order": [[0

Prolog: copy list to already assigned list -

i struggling feel should simple, doesn't seem in prolog! make list2 equal list1, list2 has been assigned in past (i.e. not variable). if list2 variable, unify list1 , list2 : list2=list1. but in case list2 exists (and not equal list1 ) , predicate fails. i have tried following: copy(list1,list2). copy(l,r) :- ccp(l,r). ccp([],[]). ccp([h|t1],[h|t2]) :- ccp(t1,t2). but fails, presumably same reason? could steer me in right direction? teaching myself prolog apologies if overlooking simple. thanks. context: i trying add term l list list2 each time predicate add_to_list run. far have following: add_to_list(list2,list1):- generatel(l), ( \+ memberchk(l,list2) -> list1=[l|list2] ; list1 = list2). so hoping there way reassign list2 equal list1, perhaps not prolog way of thinking. instead, have attempted pass through list1 follows: my_predicate(list1,listout):- add_to_list(list1,listout), write(listout),nl,nl. add_to_list(list2,list1):-

android - Config.DEBUG deprecated -

i trying add following code. if (config.debug) { // } else { // } i realized config.debug deprecated in api 14. alternative if it? you use: if(buildconfig.debug){ // }else{ // } it's not documented anywhere seems work in both eclipse , android studio (latest versions respectively). returns true if current build debug build , false if it's release. since it's not documented anywhere wary of using in production code since may stripped @ time (and there reports of incorrectly attributing releases debug builds).

javascript - How to run jquery function after the animation has completed? -

so i'm new javascript , jquery. need on how run 2nd function after 1st 1 has completed? first function progress bar , second 1 form want fade in after progressbar animation completed. the script: $(function() { var msecsperupdate = 1000 / 60; // # of milliseconds between updates, gives 60fps var progress = $('progress'); var duration = 1; // secs animate var interval = progress.attr('max') / (duration * 1000 / msecsperupdate); var animator = function() { progress.val(progress.val() + interval); if (progress.val() + interval < progress.attr('max')) { settimeout(animator, msecsperupdate); } else { progress.val(progress.attr('max')); } } $('a#forgot').click(animator); }); $(function(e) { e.preventdefault(); $('generator#forgot').css('bottom', '5px'); $(this).fadeout('medium', function() { $('a#back').fadein(); })

c# - Android AlarmManager (sometimes) provides extra notification -

Image
i working on application uses alarmmanager generate notification user @ later date. alarm arrives (on devices tested) 1 device (samsung galaxy tab3, android 4.4.2) receives 2 notifications (presumably 1 alarmmanager, , 1 broadcast receiver of app). code both of course same, , haven't seen issue before. the code written in c# xamarin, pretty vanilla. alarmmanager creates broadcast broadcast filter picked elsewhere in app (and works fine): private pendingintent createintent (models.notifications.localnotificationmodel notification, pendingintentflags flag) { if (notification.isactive) { //create broadcast intent var broadcastintent = new intent (broadcastfilter); //add information receiver of should done notification var id = notification.id; var message = notification.message; var badgenumber = notification.badgenumber; var dateofevent = notification.eventdat

python - How to remove 1 of 2 decimal points in a number using Pandas -

i have column of numbers in excel ... e.g. 1.2345.678 i want remove second decimal point data. is possible via import csv dataframe? thanks. the following preserve digits , rid of final decimal point wanted: in [80]: t="""val 1.2345.678""" df = pd.read_csv(io.stringio(t)) df out[80]: val 0 1.2345.678 in [94]: (df['val'].str[0:df['val'].str.rfind('.')[0]]+df['val'].str.split('.').str[-1]).astype(np.float64) out[94]: 0 1.234568 dtype: float64 note above shows display truncation, full value present so above slices string beginning position of last decimal point, split string , add last split, can convert float using astype edit a better way think second part not split rather re-use rfind positioning: in [113]: df['val'].str[0:df['val'].str.rfind('.')[0]]+df['val'].str[df['val'].str.rfind('.')[0]+1:] out[113]: 0 1.

Writing out a csv file from list of dictionary in python -

i'm pretty new python , i'm struggling save list of dictionary in csv file. i want write out list in csv file ,using pipe character delimiter my list : [{'coast': {'max_load': 18779, 'month': 8, 'day': 13, 'hour': 17, 'year': 2013}}, {'east': {'max_load': 2380, 'month': 8, 'day': 5, 'hour': 17, 'year': 2013}}, {'far_west': {'max_load': 2281, 'month': 6, 'day': 26, 'hour': 17, 'year': 2013}}, {'north': {'max_load': 1544, 'month': 8, 'day': 7, 'hour': 17, 'year': 2013}}, {'north_c': {'max_load': 24415, 'month': 8, 'day': 7, 'hour': 18, 'year': 2013}}, {'southern': {'max_load': 5494.157645, 'month': 8, 'day': 8, 'hour': 16, 'year': 2013}}, {'south_c': {'max_load

.net - How to Redirect Trace Information to syslog? -

i want override default trace listener route trace information syslog server. i using kiwi syslog server. now, sending message syslog server using nuget library syslognet.client 0.2.3. var _syslogsender = new syslogudpsender("localhost", 514); _syslogsender.send( new syslogmessage( datetime.now, facility.securityorauthorizationmessages1, severity.informational, environment.machinename, "application name", "message content"), new syslogrfc5424messageserializer()); instead of sending message syslog server want override listener send message directly syslog using trace info or error. basically need want listener listen trace info , if comes in trace info should write syslog.

awk - Adding new lines in XML file -

i have bunch of xml-files start xml-declaration <?xml version="1.0" encoding="utf-8"?> after final ">" goes on directly start of following tag - this: <?xml version="1.0" encoding="utf-8"?><tag> i split there make new line followed new line. this: <?xml version="1.0" encoding="utf-8"?> new line new line <tag> how done? many in advance:-) /paul with sed : amd$ sed 's/<?xml version="1.0" encoding="utf-8"?>/&\n\n\n/' file <?xml version="1.0" encoding="utf-8"?> <tag> just replace pattern <?xml version="1.0" encoding="utf-8"?> same pattern followed 3 newlines (this create 2 newlines before <tag> . use sed -i.bak 's/<?xml version="1.0" encoding="utf-8"?>/&\n\n\n/' file inplace substitution.

android - in Linux kernel module how can I read a file into this ? static const struct fw_data GSL1680_FW[] = {filecontent} -

i attempting modify existing linux kernel module load firmware data file on filesystem. have examined many ways of doing in other module code require major modification existing code. use .h file contain modifications , retain driver file modified driver can more portable. the way driver written calls .h file obtain needed values, pre-set in .h file have .h file obtain data configuration file on disk (flash driver android) . have searched extensively comparable method of reading data file none store data in form needed module. here hold data : struct fw_data { u32 offset : 8; u32 : 0; u32 val; }; static const struct fw_data gsl1680_fw[] = { {0xf0,0x3}, {0x00,0xa5a5ffc0}, {0x04,0x00000000}, {0x08,0xe810c4e1}, {0x0c,0xd3dd7f4d}, {0x10,0xd7c56634}, {0x14,0xe3505a2a}, {0x18,0x514d494f}, {0x1c,0xb83a7121}, {0x20,0x00000000}, {0x24,0x00000000}, {0x28,0x00000000}, {0x2c,0x00000000}, {0x30,0x00001000}, {0x34,0x00000000}, {0x38,0x00000000}, {0x3c,0x00000000}, {0x40,0x00000001}, {0x44,

android - Unable to integrate crashlytics in eclipse with ADT -

i followed setting plugin integrate crashlytics link https://www.crashlytics.com/onboard from eclipse, logged fabric account , selected project. plugin made necessary changes manifest , launch activity. it asked build & run app complete step 1. but getting - ../kit-libs/com-crashlytics-sdk-android_crashlytics/bin(missing) ../kit-libs/com-crashlytics-sdk-android_crashlytics-core/bin(missing) ../kit-libs/com-crashlytics-sdk-android_beta/bin(missing) ../kit-libs/com-crashlytics-sdk-android_answers/bin(missing) ../kit-libs/io-fabric-sdk-android_fabric/bin(missing) please guide me how build crashlytics , integrate further. in project, there 5 fabric libraries under "kit-libs" folder. right click build.xml in every library -> run -> ant build it should solve issue.

java - How to move the mouse cursor and apply a left click? -

Image
in java trying following, none working (even though compiles well). doing wrong? import java.awt.robot; import java.awt.event.inputevent; public class kiosk { public static void main(string[] args) { try { robot robot = new robot(); // move cursor robot.mousemove(300, 500); // , then, left click robot.mousepress(inputevent.button1_mask); robot.mouserelease(inputevent.button1_mask); } catch (exception e) { e.printstacktrace(); } } }

glassfish - Java EE, differentiate context by path -

i'm working on workaround problem, glassfish not support individual certificates virtual hosts. my application supposed running context dependent based on customer wants access data. wanted use seprarate domains that, since not possible, i've come different idea: i want differentiate customers path entering. example: www.application.com/customer1/pages/page.jsf or www.application.com/customer2/pages/page.jsf but dont know how implement that. far know, these adresses indicate paths on webserver. can somehow this, application still finding pages? preferebly want store these entries (customer1 , customer2) in external file can add new entry without having touch code. i'm assuming mean ssl certificates. consider setting reverse proxy handles multiple domains , ssl encryption , forwards requests normal http on glassfish. in application distinction customers can made via login use (roles/groups, ...). if using path or domain distinguish it's quite easy

html - How to Access and set value to element inside Multi-Nested Frames -

<html><head> <title>content</title> </head> <frameset rows="68,*,20" border="0" frameborder="no" framespacing="0"> <frameset cols="0,0,*" frameborder="0" border="0">...</frameset> <frameset cols="170,*" frameborder="0" border="0"> <frame src="/html/main/menu.asp" name="menufrm" id="listfrm" frameborder="no" border="0" scrolling="auto" target="_self" marginwidth="0" marginheight="0" noresize="">...</frame> <frameset rows="70,*" border="0" frameborder="0" framespacing="0"> <frame src="/html/main/tab.asp" name="tabfrm" id="tabfrm" frameborder="no" border="0" scrolling="no&q

sqldatatypes - correct mysql data type for column that contain multiple index ids -

in sql have table (trades) contains list of trades each trade has id. i have table (companies) contains list of companies, in table there trades column, in here there id's trades, there more 1 trade. what best data type trades column in companies table? sorry if terminology isn't correct! to keep atomarity (modularity) of data items in tables , flexibility of future select queries (joins, grouping, searching , etc.) best practice have table have fields keeps relation of these data items. have many-to-many relation. here example: -- create syntax table 'companies' create table `companies` ( `id` int(11) unsigned not null auto_increment, `name` varchar(100) not null, primary key (`id`) ) engine=innodb default charset=utf8; -- create syntax table 'trades' create table `trades` ( `id` int(11) unsigned not null auto_increment, `name` varchar(100) not null, primary key (`id`) ) engine=myisam default charset=utf8; -- create syntax

azure active directory - User identification claim in OpenID connect -

i'm setting authentication auth0 , using openid connect. i've set owin startup class according this example . problem users auth0 database provide different claims users authenticated enterprise connection (i'm using azure ad test scenario). my question is, claim should use user in application's database perform authorization, i.e. use user id? note comment in link above, says might need "read/modify claims populated based on jwt". openid connect has standardized sub claim primary user identifier. alternatively may able use mail claim, caveat e-mail addresses can reassigned, , sub should not be.

Meteor: Showing extra sign up field conditionally using meteor-accounts-ui-bootstrap-3 -

i using meteor-accounts-ui-bootstrap-3 create sign form. in sign form have 2 options doctor , advisor . if during sign process user selects doctor want show more fields (required fields) based on selection , if user select advisor field should remain hidden. below code of sign form: accounts.ui.config({ requestpermissions: {}, extrasignupfields: [{ fieldname: 'phone', fieldlabel: 'phone number', inputtype: 'text', visible: true, validate: function(value, errorfunction) { if (!value) { errorfunction("please write phone number"); return false; } else { return true; } } }, { fieldname: 'type', showfieldlabel: false, fieldlabel: 'user type', inputtype: 'radio', radiolayout: 'vertical', data: [{ id: 1, label: 'doctor', value: 'doctor'

ios - Disabling touch detection UIScrollView -

i'm making drawing app , accept pictures bigger screen. this, put image view in scroll view. however, when drawing tool enabled want disable detection of touch events on scroll view can use touchesbegan , touchesmoved , touchesended methods drawing. seems if scroll view has scroll disabled, these methods not getting called. how can go doing this? try turning userinteractionenabled no. maybe helps.. :)

javascript - how can I get the full url of a href attribute? -

<a id="next" href="/housing/__1_0_0_0_1_0_0/">next page</a> when put mouse on href value, there a link full url "http://esf.zs.fang.com/housing/__1_0_0_0_1_0_0/" how can full url instead of relative url? i used xpath("//a/@href"),but gets relative url "/housing/__1_0_0_0_1_0_0/" any appreciated! window.location can give want know current browser location, use compose qualified url.

how to retrive JSON data by using swift -

i retrieving datas json using swift. new json. don't how retrieve nested values. previous question issue raised, while retriving datas json using swift . got clarified. new me. json format below. kindly guide me. json response formats: { "salutation": { "id": 1, "salutation": "mr" }, "firstname": "aaa", "middlename": "bbb", "lastname": "c", "employeeid": "rd484", "station": { "id": 86, "stationcode": null, "stationname": "ddd", "subdivision": null, "address": null }, "subdivsion": { "id": 11, "divisioncode": "11", "divisiondesc": "eee",

shell - php to write a file as root user -

i have script running on plesk latest version , plesk not have write permissions. have write configuration file values database. i tried following, $pathconn = $_server['document_root']."/mysite/_conn.php"; if(file_exists($pathconn)){ chmod($pathconn, 0777); } $file_contents = file_get_contents($pathconn); $file_contents = str_replace("webuser_admin", $username."_admin", $file_contents); $file_contents = str_replace("webpass", $mysql_password, $file_contents); $file_contents = str_replace("web_db", $username."_ss", $file_contents); file_put_contents($pathconn, $file_contents); the php variables coming database , need update _conn.php file variables run website. cannot because of permission issue. is there other way that? read somewhere can apache or root user. not sure mean. please.. depending on linux distribution installed in vps have type different commands steps remain same : 1.you h

c++ - virtual inheritance constructor order -

i trying understand better concept of virtual inheritance, , perils. i read in post ( why default constructor called in virtual inheritance? ) (= virtual inheritance) changes order of constructor call (the "grandmother" called first, while without virtual inheritance doesn't). so tried following see got idea (vs2013): #define tracefunc printf(__function__); printf("\r\n") struct { a(){ tracefunc; } }; struct b1 : public { b1(){ tracefunc; }; }; struct b2 : virtual public { b2() { tracefunc; }; }; struct c1 : public b1 { c1() { tracefunc; }; }; struct c2 : virtual public b2 { c2() { tracefunc; }; }; int _tmain(int argc, _tchar* argv[]) { a* pa1 = new c1(); a* pa2 = new c2(); } the output is: a::a b1::b1 c1::c1 a::a b2::b2 c2::c2 which not expected (i expected order of 2 classes different). what missing? can explain or direct me source explains better? thanks! in example, output expected. virtual inher

An error occurred while publishing Sitecore -

when publishing site in sitecore giving error. job started: publish 'web'|#exception: system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.formatexception: unrecognized guid format. please guide me how can resolve error. did upgrade recently? if so, maybe help: http://reasoncodeexample.com/2015/03/26/sitecore-linkdatabase-unrecognized-guid-format/

amazon web services - Frontend and communication for EC2 based cloud application -

we implementing system take image input, processing on it, , return results. have processing on ec2 instance. i'm pretty new cloud computing in general, , haven't worked web either, , i'm trying decide best way create frontend system. (the backend c++ code running on amazon ec2). frontend, have 2 options: a desktop app somehow communicate ec2 instance. 1 simpler build, i've experience this, don't know how able talk backend. there's ssh, don't know how suitable is. a webserver running on ec2 instance itself. sounds better idea , haven't done webdevelopment, might end taking more time. i'm not looking create fancy uis, functional lets end user upload image, , view results. option should go for? there pros , cons of both approaches, given brief description , simplicity of application web based approach seem match. this gives advantages: easy deploy (nothing install on users machines) easy upgrade (again no impact on users machi

Why sometime we use -> void for completion handler in swift but sometime not? -

i have watched 2 tutorial. first 1 basic completion handler in swift. tutor shows example of code: func istextvalid(input: string, completion: (result: bool) -> void) { if (input == "hello") { completion(result: true) }else{ completion(result:false) } } istextvalid("hello", { (result) -> void in if (result == true) { println("people hello") }else{ println("people not hello") } }) the second tutorial http request code looks this: /* 4. make request */ let task = session.datataskwithrequest(request) {data, response, downloaderror in if let error = downloaderror { println("could not complete request \(error)") } else { /* 5. parse data */ var parsingerror: nserror? = nil let parsedresult = nsjsonserialization.jsonobjectwithdata(data, options: nsjsonreadingoptions.allowfragm

release android app updates and not not push auto updates -

this repeated question have not got answer . hope @ , answer . i have android application has number of downloads . want update app major fixes , updates . because of update, end user may failed authentication , need reenter credentials dont like. @ same time want keep same package name keep downloads , app reputation on playstore. so how can achive these 1.update android app on playstore not push automatic updates if end user turn-on autoupdate in settings . previous app downloads , userfeedback should there way old users still continue using old version , new users download app playstore enjoy new app . thank you ok, mentioned keeping package name , stuff... changing should never option. user have ten of same app, different features because updates packaged separately. there isn't way stop google play auto updating apps, users may have deal reentering credentials. since there isn't way around this, apologize user. example: when user logs in, save boolean

How do I shorten to write {{id}} instead of {{object.id}} in angularjs? (when 'object' is json) -

this maybe basic question, couldn't google ages. say have $scope $scope.object = {id:1, name:"stackoverflow"}; and in html, want call simply {{id}} instead of {{object.id}} is there simple way achieve this? (without loop map json attributes $scope variables etc) maybe simple like... (i know won't work) <div ng-scope="object"> {{id}} </div> ==== update === guess there's no default (natural or easy) way of achieving without manipulating $scope. (i.e. adding more watches (= overheads) etc) well... after more research, think maybe bad idea in angularjs. see video. https://egghead.io/lessons/angularjs-the-dot i wanted use existing code laravel (blade templating engine). guess have write '.'(dots) prevent unexpected behaviors now. have 100s of them, feels repetitive. this simple task in backend frameworks. i vote relevant answers! :d thanks! can simple directive that: mymodule.di

Topic stability in LDA models -

my major bioinformatics , want use lda (latent dirichlet allocation) explain histone code of lot of genes. i used lda model in project, when re-run topic models different random seed, topic terms seem change dramatically. i not want results artifact of random seed. there can figure out?

c++ - why does a variation in the if statement of this bitwise operation cause an error? -

i writing function print bits ran problem. 2 loops seem identical me reason 1 commented out not print right bits. int main() { unsigned int bits = 0x570fa1; unsigned int mask = 0x800000; printbits(bits, 24, mask); return 0; } void printbits(unsigned int bit, int numbofbits, unsigned int& mask){ (int = 1; <= numbofbits; i++){ if ((mask & bit) == 0 ){ cout << "0"; } else { cout <<"1"; } mask = mask >> 1; if ( %4 == 0 ){ cout << " "; } } /* for(int i= 1 ; <= numbofbits ; i++ ){ if ((mask & bit) ==1){ cout << "1"; } else{ cout << "0"; } mask = mask >> 1; if(i% 4 ==0){ cout << " "; } }*/ } reason's simple: mask value might start @ 128, right-shifted 64, 32, etc.. so,

jquery - Update MySQL using AJAX and PHP -

i'll go slow, not sake..for mine. i'm real new @ trying to this. i'm trying update live mysql db html table. how each built. echo ("<td id=\"callsign:$row[recordid]\" contenteditable=\"true\" onclick=\"showedit(this)\" onblur=\"savetodatabase(this,'callsign',$row[recordid])\" style='text-transform:uppercase'> $row[callsign]</td>"); this how renders. <td id="callsign:6" contenteditable="true" onclick="showedit(this)" onblur="savetodatabase(this,'callsign',6)" style="text-transform: uppercase; background-color: rgb(253, 253, 253); background-position: initial initial; background-repeat: initial initial;"> ka0sxy</td> here function gets called. function savetodatabase(editableobj,column,id) { $(editableobj).css("backgro

ios - HTML file upload "Could not create a sandbox extension" using WKWebView -

i'm running strange issue while using wkwebview in ios 8 app. html page shown inside view allows file upload. when images selected, works fine - files returned html/javascript , can upload them. however, if select video (.mov) during file selection, appears wkwebview crashes. when happens, following spit out in xcode - "could not create sandbox extension '/var/mobile/media/dcim/100apple/img_0745.mov'" appreciated! seems strange image files can handed on fine, video breaks. there bug in safari crashes browser when try upload videos <input type="file"> "multiple" attribute set. fixed in latest ios 8.4 release, still affects wkwebview. source: https://github.com/fineuploader/fine-uploader/issues/990 i've been studying @ least 3 hours , came these 3 solutions: 1.) capture/upload single video only <input type="file" accept="video/*" capture="camcoder"> 2.) capture/upload

typescript - Why is public property not visible after importing it? -

i have typescript file: /// <reference path="../scripts/typings/requirejs/require.d.ts" /> /// <reference path="../scripts/typings/knockout/knockout.d.ts" /> /// <reference path="../scripts/typings/durandal/durandal.d.ts" /> import app = require("durandal/app"); class appviewmodel { currentcourseid = ko.observable(); currentnativelanguageid = ko.observable(); currentlanguageid = ko.observable(); currentlevelid = ko.observable(); currentlessonid = ko.observable(); setmessage(message) { app.trigger('message:new', message); } } export = appviewmodel; the intent singleton , import elsewhere: import dataservice = require("dataservice"); import app = require("durandal/app"); import appviewmodel = require("appviewmodel"); class selectnativelanguage { manager = new breeze.entitymanager('breeze/data'); items= ko.observablearray(); sectio

ruby mysql2 equivalent of data_seek(n).fetch_hash -

what equivalent statement in mysql2 this result = mysql.query('select cache_amount_with_discount_and_tax t_payment organization_id = 1 , receipt_id = '+param['receipt_id'].to_s).data_seek(3).fetch_hash // mysql original mysql client i'm new ruby , still trying wrap ahead around documentation. i don't think mysql2 supports data_seek , can use sql native offset , better since limits amount transfered client in first place. mysql2 returns rows hashes default, that's non-issue. so... sql = <<-sql select cache_amount_with_discount_and_tax t_payment organization_id = 1 , receipt_id = #{client.escape(param['receipt_id'])} limit 1 offset 3 sql result = client.query(sql, as: :hash, symbolize_keys: false) hash_row = result.first the options have given ( as: :hash, symbolize_keys: false ) default, , can left off unless have changed defaults; or can mess them customise result (e.g. having symbolic column keys instead of

Incorrect size of div in Bootstrap -

goodnight everyone. i'm having trouble combining drag , drop script , bootstrap example can seen here: http://goedgevonden.net/laurent/index.html as can see, when try drag eyes or mouth (in left menu) droparea colors yellow. drop area set width of 55% (showing correctly) , height of 100% (only small yellow bar shows up). whats causing shrinkage of div in height? has solution this? thanks in advance. greetings, alfred kwak. that's because element , parent don't contain parent takes height of normal row, in case 20px. hence element's 100% height makes equal parent's height, 20px. you need manually set either element's or parent's height specific (e.g. 100px).

objectify - Generate unique Long Id on App Engine -

i've 3 possible ways user can sign in our service: login , password google+ facebook i want keep user id's in 1 entity. avoid id collisions between e.g. google , facebook prefix added id ( g- , f- respectively). users standard login, unique long value generated app engine (using objectify @id long value set null id). to keep in 1 entity key must same type should string . there's no option in objectify auto generate key string . what need generate unique long value given entity prefixed c- (custom login). that'd give string id similar of google , facebook. i've searched objectify's code found nothing related generate unique long id null long fields annotated @id . if want value equivalent autogenerated id, call: factory().allocateid(thing.class).getid(); alternatively, can use allocateids method on underlying datastoreservice of low level api. or uuid.randomuuid() . however, sounds weird. want able map facebook id or go

java - Is it safe to assume that a static variable always exists -

this question has answer here: when static variables initialized? 7 answers in java i've seen class variables (defined keyword static) equivalent of global variables in other languages such c, defined inside class avoid name conflicts. in c can refer global variable function @ time exists while program running. what static variables in java. exist? loaded when they're referred? wanna know if it's safe when use static variable static method of class. also static variable ever destroyed? a static variable initialized when class initialized, , valid ( initialization of classes , interfaces ). initialization of class consists of executing static initializers , initializers static fields (class variables) declared in class. if value of static field changed, , there no other references previous value, previous value garbage collected. howev

html - Positioning a button within an image in CSS -

i want insert button within image using css; image has fixed width , height, centered in page. button must remain stationary within image @ different resolution. css doesn't allow other elements inside <img> tag. common go-to in situation put both image , button inside 2 wrapper <div> elements act table (vertically , horizontally centered). like so; html <div class="wrapper"> <div> <img src="[your image src]"> <a class="button" href="[go page]">button</a> </div> </div> css .wrapper{ display: table; width: 100%; /* add or remove depending on layout */ } .wrapper > div{ display: table-cell; vertical-align: middle; text-align: center; } as long image has no size constraints should sit flush in center of image :). enjoy! edit --- alternatively, remove <img> tag , put background-image of .wrapper , use background-size: cover; center

webpage - How to download the entire page with wget when the url has parameters? -

i want download entire page objects, including images, js, css, etc. however, url may contain parameters, eg. www.youtube.com/results?search_query=star+wars i have tried options suggested in similar questions: wget -p -k "www.youtube.com/results?search_query=star+wars" wget -p -k ‐‐post-data "search_query=star+wars" "https://www.youtube.com/results" but none of them works. can me that? many thanks! find answer: wget -e -h -k -k -p -e robots=off $url note: url must quoted ''. ref: https://superuser.com/questions/55040/save-a-single-web-page-with-background-images-with-wget

How to add dot '.' in the name of individuals in Sparql? -

is possible have . (dot) in qname of individuals or rdf resources in general? something this? select ?tablename ?fieldname { ?fieldname hrdata:relatedfield hrdata:ps_ti0002.emplid. } the dot in ps_ti0002.emplid problematic. your code right , should work. possible use dot in individual's name. i think should check data property (relatedfield), maybe not clarified right.

ios - contractDictionary.Type does not have a member named aDictionary -

the following code produces error contractdictionary.type not have member named adictionary but don't understand why or how fix it. import foundation class contactdictionary { var adictionary:[contact] = [contact]() var bdictionary:[contact] = [contact]() var cdictionary:[contact] = [contact]() var ddictionary:[contact] = [contact]() var edictionary:[contact] = [contact]() var fdictionary:[contact] = [contact]() var gdictionary:[contact] = [contact]() var hdictionary:[contact] = [contact]() var idictionary:[contact] = [contact]() var jdictionary:[contact] = [contact]() var kdictionary:[contact] = [contact]() var ldictionary:[contact] = [contact]() var mdictionary:[contact] = [contact]() var ndictionary:[contact] = [contact]() var odictionary:[contact] = [contact]() var pdictionary:[contact] = [contact]() var qdictionary:[contact] = [contact]() var rdictionary:[contact] = [contact]() var sdictionary:[contact] = [contact]() var tdictionary:[contact] = [contact]() var

organization - How can I organize my Java code? -

the title not entire question. know how organize code, theoretically, specific, useful, pointers. please read on before griping. i'm beginner java , oop (object oriented programming) , learn how better organize code! on course of month or two, made calculator program little functions thought of here , there few small jokes built it. after looking @ second time realized extremely poorly formatted , incomprehensible.if may, ask more experienced programmers point me in right direction on should fix (for example, things can turn objects, can compartmentalize, etc). please note first time posting on forum if need clarify me, i've done wrong, i'm asking much, please tell me can resolve , can help. please dont mark invalid , file away oblivion (as happens in stackoverflow). also, before asks, no not homework, product of own crack @ teaching myself java (probably why not working well). here source code: // original calculator code without objects in single class. not e

Python change Accept-Language using requests -

i'm new python , trying infos imdb using requests library. code capturing data (e.g., movie titles) in native language, them in english. how can change accept-language in requests that? all need define own headers: import requests url = "http://www.imdb.com/title/tt0089218/" headers = {"accept-language": "en-us,en;q=0.5"} r = requests.get(url, headers=headers) you can add whatever other headers you'd modify well.

sql - Are these two PostgreSQL functions equivalent? (RETURNS TABLE and RETURNS SETOF) -

i dealing 2 postgresql installs @ same time: local environment , real remote server. sadly server has old version (8.3.11) , local environment newer (9.4). i don't have means update remote server @ moment, converting function runs in 9.4 (it uses returns table ) function should fine in 8.3.11 (it should use returns setof ). but while local environment function works , gives results, remote 1 yields no result (using same tables!) so, these 2 equivalent? newer function local environment: create or replace function pra2.getgamesondate(date) returns table (game_date date, is_home varchar, is_away varchar) $$ begin return query select g.game_date, p1.team_name plays_at_home, p2.team_name plays_away pra2.game g join pra2.team p1 on g.is_home = p1.team_id join pra2.team p2 on g.is_away = p2.team_id g.game_date = $1; if not found raise exception 'no hay partidos para la fecha %.', $1; end if; return; end $$ language plpgsql;

c++ - Store Data to PE(Portable Executable) -

i have exe binder, 1 binds 2 executables single one, here command line e.g.: cmd-> binder.exe 1.exe 2.exe output new binded.exe runs both of 1.exe 2.exe itself. question: how insert/store additional info/text/data binded.exe binder.exe? later 2.exe 1 runned binded.exe should read info binded.exe. goal is: 1.exe - common exe 2.exe - executable 1 depending on info/text binded.exe, prevent 1.exe running , delete binded.exe disk. for example, use additional parameter (time, date) cmd-> binder.exe 1.exe 2.exe 13may so new binded.exe appear, , binded.exe run untill data isnt expired. 2.exe read data/info time binded.exe , take care deleting bindex.exe coming may 13.

if statement - MySQL IF IS NULL ERROR -

i want test if select-statement null i'am failing case analysis: set @dublicate = null; if @dublicate null select * mysql.user; end if; this should ever return selection following error: #1064 - have error ... near 'if @dublicate null select * mysql.user; end if' @ line 2 and dont know whats wrong. many in advance killermelone it working database put query within begin , end create procedure `new_procedure` () begin declare dublicate text default null; set dublicate := null; if (dublicate null) select * destinations; end if; end

json - How to fix the invalid mesh construction? -

Image
there sample here: http://amegas.github.io/gera/custom.geometry it shows rotating swords, represented custom loaded geometry mapped uv-texture. as can see sample uses part of texture ignoring other parts of image. want load other models using the sample github, last attempt unsuccessful. result shown here: i rather don't understand how solve problem. have learned information library used in sample. must prepare vertex/texture coordinates rendering custom 3d model. thought try use other webgl drawing mode ( triangles, triangle_strip, triangle_fan , etc.. ), because library sample provides optional way set custom draw mode each mesh: var mesh = new gera.mesh({ geometry: new gera.geometry({ type: gera.geometry.type.custom, vertices: object3d.jsonmodel.vertices, indices: object3d.jsonmodel.indices, uvcoordinates: object3d.jsonmodel.uvcoordinates }), material: new gera.material( object3d.texture ), drawmode: gera.renderer.dra