Posts

Showing posts from June, 2012

ios - iCloud: disable incremental backup on file -

in documents directory of app big binary file needs in backup (isexcludedfrombackup = false). works fine, icloud incremental backup , big binary file can change lot, i'd disable incremental backup on file (otherwise backup size grow fast). does know if possible? maybe can try follows: do { var url = url.init(fileurlwithpath: "") var resourcevalues = urlresourcevalues() resourcevalues.isexcludedfrombackup = true try url.setresourcevalues(resourcevalues) } catch { }

xamarin - How do I get the Mac Address for and Android Device using 6.0 or higher in c#? -

i have found few examples using java, having trouble constructing method c#. can please post straightforward c# example gets mac address of device, marshmallow (6.0). understand there other methods of obtaining unique id, not interested in having import components @ time. using xamarin visual studio 2015. i have these permissions active: access_wifi_state internet read_phone_state the codes have tried simple methods used below android version 6.0. appreciated. edit: i not believe duplicate requested c# version of code specifically unfortunately, you're out of luck. starting version 6.0, android restricts access mac address. if try query mac address of current device, you'll constant value of 02:00:00:00:00:00 you can still access mac addresses of nearby devices, stated in official android documentation : to access hardware identifiers of nearby external devices via bluetooth , wi-fi scans, app must have access_fine_location or access_coarse_locatio

How do I submit a Visual Studio bug if the normal channels are not working? -

i using visual studio 2013. keeps crashing under circumstances, i'm trying submit bug report. i have tried help > feedback > report bug , after logging in @ connect.microsoft.com/visualstudio either has message saying not authorized submit feedback connection (whatever means), or page blank under top banner. in either case, can click "feedback" link on banner, takes me list of submitted items. list, there no direct way add item, instructions "after searching, option submit new feedback enabled." if search (which takes literally minutes), "submit feedback" button @ top of list. if click this, goes blank page saw before clicked "feedback" on banner. how supposed submit bug? how can report failure of bug reporting service? if having troubles submitting built in tools can go https://connect.microsoft.com/visualstudio , manually submit bug report there. using built in tools preferred because can record etl trace ,

Is it possible to create a shortcut that opens windows cmd in specific folder? -

Image
is possible create desktop shortcut or task bar shortcut opens cmd window in specified directory on windows os? yes, possible , easy, without creating else shortcut: create shortcut of cmd.exe (command prompt) on (drag'n'drop icon desktop) edit properties , change "start location" (not sure of english name. me it's démarrer dans : sorry french edition) required directory

html - how to display images correctly on mobile devices? -

Image
the background image have 1920x1080p , displays correctly on desktop browsers not on mobile (not in portrait or landscape mode). anyway fix issue? need multiple images or there way automatically resize? .css file. #tf-home{ background: url(../images/odysseytitleimage.jpg); background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat; color: #cfcfcf; } #tf-home .overlay{ background: -moz-linear-gradient(top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.73) 17%, rgba(0,0,0,0.66) 35%, rgba(0,0,0,0.55) 62%, rgba(0,0,0,0.4) 100%); /* ff3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.8)), color-stop(17%,rgba(0,0,0,0.73)), color-stop(35%,rgba(0,0,0,0.66)), color-stop(62%,rgba(0,0,0,0.55)), color-stop(100%,rgba(0,0,0,0.4))); /* chrome,safari4+ */ background: -webkit-linear-gradient(top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.73) 17%,rgba(0,0,0,0.66) 35%,rgba(0,0,0,0.5

How can I scroll content horizontally with fullcalendar scheduler? -

using heavily customized version of scheduler, i'm getting reports users having trouble figuring out how scroll horizontally. imagine it's because scrollbar @ bottom of schedule , on mac os, it's potentially hidden if user has trackpad. my schedule functions similar this one minus vertical scroll. if you're on apple laptop , using trackpad it's won't see scrollbar @ all. if scroll bar visible, it's buried under page's fold. ideally, i'd have arrows near times users click left or right , view scroll left or right. i've been unable figure out way programmatically call $.animate({ scrollleft: ... }) on piece of scheduler , scroll both contents events and header times are. it looks can , set position of @ least timeline $( '.fc-time-area .fc-content table' ).offset() won't move contents of schedule itself. any idea how can move schedule content (events) , timeline in sync each other? bonus internet points if can tell me h

entity framework - AutoMapper with EF6 not populating one of the mapped objects -

i have ef6 mvc app using code first generate models. trying create mapping using automapper between model , viewmodel representation of model. i don't have errors, resulting object missing details ptcredential object. missing ptcredential object nested within ptcredential. don't believe ignores causing this, can't pin down. have tried suggestions other posts on automapper, nothing has proven useful. could provide assistance on can use automapper in situation? here code how configuring , initializing mapper: var ptconnections = _db.ptconnections.include(p => p.ptconnectionclass).tolist(); mapper.initialize(cfg => { cfg.createmap<ptconnection, ptconnectionviewmodel>() .aftermap((s, d) => { foreach (var in d.ptcredentialassignments) i.ptconnection = d; }); cfg.createmap<ptcredentialassignment, ptcredentialassignmentviewmodel>() .formember(m => m.ptcredential, op

jquery - Configure a specific JavaScript function to reload on a page -

i trying configure javascript function sort of 'reload' on particular web page. site has overarching js , css framework, want particular function load bit differently. the js function in js framework sets height of grid element dynamically. example, if have 3 elements have height of 155px, 34px, , 100px, takes element highest value , applies height of grid elements, making them 155px. for rest of pages in site, code fine because js script executes on page load. however, page i'm using function on doesn't seem adhere js script. still retains differing heights when supposed have same height. what's different particular page application coded in it. there filtering application in page features search text box , checkbox similar amazon's application filters categories men's or women's clothing. however, unlike amazon, checking/unchecking checkboxes or typing else in search box loads/reloads 'content' page doesn't reload , content links.

node.js - aurelia-fetch-client - a promise was rejected with a non-error: [object Response] -

i'm using aurelia-fetch-client , error when send request nodejs backend api: warning: promise rejected non-error: [object response] @ http://localhost:9000/scripts/vendor-bundle.js:39700:20 @ array.reduce (native) @ applyinterceptors (http://localhost:9000/scripts/vendor-bundle.js:39696:33) @ processresponse (http://localhost:9000/scripts/vendor-bundle.js:39688:12) @ http://localhost:9000/scripts/vendor-bundle.js:39603:18 previous event: @ http://localhost:9000/scripts/vendor-bundle.js:39602:24 previous event: @ httpclient.<anonymous> (http://localhost:9000/scripts/vendor-bundle.js:39590:64) @ httpclient.fetch (http://localhost:9000/scripts/vendor-bundle.js:39574:23) @ authservice.login (http://localhost:9000/scripts/app-bundle.js:126:30) @ login.login (http://localhost:9000/scripts/app-bundle.js:190:30) @ callscope.evaluate (http://localhost:9000/scripts/vendor-bundle.js:24067:21) @ listener.callsource (http://localhost:9

algorithm - Relation between DFS and pre-order traversal -

i have 2 statements , i'm confused correct. is depth first search(dfs) similar pre-order traversal. is pre-order traversal similar depth first search(dfs). if graph tree pre-order traversal type of dfs. have 3 different tree-traversal styles (pre-order, in-order, post-order). types of dfs. see this more information.

bluetooth - Zebra ZQ 510 Mobile Printer compatible with Motorola MC32NO (Windows Embedded Compact 7.0) -

have problem connect new purchased zebra zq 510 mobile printer motorola mc32n0 via bluetooth using following legacy code(referencing inthehand.net.personal dll): using inthehand.net; using inthehand.net.bluetooth; using inthehand.net.sockets; using inthehand.net.ports; bluetoothaddress mac = bluetoothaddress.parse("b0b44879581d"); bluetoothendpoint btendpoint = new bluetoothendpoint(mac, bluetoothservice.serialport); bluetoothclient bluetoothclient = new bluetoothclient(); bluetoothclient.connect(btendpoint); my workaround use bluetoothsecurity.pairrequest() function pair printer, manually assign serial port( either com5 or com9) using btui application. use following code(referencing zebra link os sdk(zsdk_api.dll)): using zsdk_api.comm; // instantiate connection zpl serial port on com5. zebraprinterconnection theprinterconn = new serialprinterconnection("com5"); // open connection - physical connection established here. theprinterconn.open(); to conne

my jquery ajax does not work in asp.net mvc -

i want send data via jquery ajax in asp.net mvc but when function create called error section excuted here java script function create() { $.ajax({ url: "@url.action(actionname:"create",controllername:"tag",routevalues:new { area="admin"})", contenttype: "application/json", type: "post", datatype: "json", data: $("#myform").serialize(), success: function (response) { eval(response.script); }, error: function () { alert("error"); } }); here action method [validateantiforgerytoken,httppost, ajaxonly] public actionresult create(tag tag) { jsondata data = new jsondata(); if (modelstate.isvalid) { if (tagoperation.where(x => x.text == tag.text) != null) {

What is the explanation for these bizarre JavaScript behaviours mentioned in the 'Wat' talk for CodeMash 2012? -

the 'wat' talk codemash 2012 points out few bizarre quirks ruby , javascript. i have made jsfiddle of results @ http://jsfiddle.net/fe479/9/ . the behaviours specific javascript (as don't know ruby) listed below. i found in jsfiddle of results didn't correspond in video, , not sure why. am, however, curious know how javascript handling working behind scenes in each case. empty array + empty array [] + [] result: <empty string> i quite curious + operator when used arrays in javascript. matches video's result. empty array + object [] + {} result: [object] this matches video's result. what's going on here? why object. + operator do? object + empty array {} + [] result [object] this doesn't match video. video suggests result 0, whereas [object]. object + object {} + {} result: [object][object] this doesn't match video either, , how outputting variable result in 2 objects? maybe jsfiddle wrong. array(16).join("wat

file - PHP directory listening with permissions -

i have webpage (apache2) based on linux ubuntu server 14.04 lts (32bit). i found, according me, , simple php directory/file listener. my problem is: don't know how show directories/files have 0700 permission. open file. don't want change permissions because on webpage, users have login use website. mean files have 0700 permission not public, , want members of website can use/download files. my code is: <?php $dirlist = getfilelist("./uf/"); ?> <table border="1"> <thead> <tr><th>name</th><th>type</th><th>size</th><th>last modified</th></tr> </thead> <tbody> <?php // output file list table rows foreach($dirlist $file) { echo "<tr>\n"; echo "<td><a href=\"{$file['name']}\">",basename($file['name']),"</a></td>\n"; echo "<

node.js - piping variables into res.render function parameter names in express -

i have written code loads json data dom. full code: var express = require('express'); var router = express.router(); // var money = require('./routes/money'); var duckstorysection = { para1: "i first met boa-duck through lene-cow's intervention. had been scoping out possibility of illicit affair green party of england , wales' amelia womack, party propaganda machine had other ideas. indeed, began show interest militant ecological wing , more threatening sections of womens' society , lgbtqi (i have suspicion many election posts contested single candidate because of internal factional bullying , whispering campaigns, originating these factions, have no direct evidence of causation in these cases) began concerted campaign of is, in parlance of political operatives, known 'this.'", para2: "but not story green party of england , wales, story of group of forest animals , 1 human companion: myself (dragon-bear), boa-duck, lene-cow

grafana - Graphite - graph a related metric form a series list -

i want graph mean response time 10 api calls called most. i have: api.<route>.count api.<route>.mean i want graph mean value series highest counts. i have 10 highest count using highestcount( api.*.count ) how take list , replace .count .mean the useseriesabove method close want... don't want provide static count. useseriesabove(serieslist, value, search, replace) compares maximum of each series against given value. if series maximum greater value, regular expression search , replace applied against series name plot related metric e.g. given useseriesabove(ganglia.metric1.reqs,10,’reqs’,’time’), response time metric plotted when maximum value of corresponding request/s metric > 10 &target=useseriesabove(ganglia.metric1.reqs,10,"reqs","time") use limit(sortbymaxima(api.<route>.mean),10) getting top 10 results. also, maybe mean time not want if want measure latency - use 95th or 999th

amazon web services - Associated Public IP instead of EIP with terraform -

i'm trying associate public ip address me instance instead of eip there's no "aws_public_ip" resource in terraform. i've reached limit of eip's , don't need eip - can take advantage of public ip addresses. does mean it's not possible yet attach public_ip in terraform? have been successful in attaching public ip instance/interface using terraform? thank you you don't assign public ip addresses resource after has been created. , don't treat public ips separate resources. use public ips place resource in public vpc subnet, , set attribute associate_public_ip_address = true

c# - ASP.NET CORE, Web API: No route matches the supplied values -

i have problems routing in asp.net core (web api). i have controller (simplified): [apiversion("1.0")] [route("api/v{version:apiversion}/[controller]")] public class documentcontroller : controller { [httpget("{guid}", name = "getdocument")] public iactionresult getbyguid(string guid) { var doc = documentdataprovider.find(guid); if (doc == null) return notfound(); return new objectresult(doc) {statuscode = 200}; } [httppost] public iactionresult create([frombody] document doc) { //... creating doc //does not work //var val = createdatroute("getdocument", new {guid = doc.guid.tostring("n")}, document); //or this: createdatroute("getdocument", new { controller = "document", guid = doc.guid.tostring("n")}, document); var val = createdatroute("getdocument", new { version = "1", controller = "document", guid = doc.gu

javascript - Load Modal dialog by injecting HTML with JQuery -

i have following function on js file has defined html code modal dialog defined in here i've copied html code , assigned variable on js function: function loadmodaldialog(p1) { var modal = '<div id="mymodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">' + ' <div class="modal-header">' + ' <button type="button" class="close" data- dismiss="modal" aria- hidden="true" >×</button>' + ' <h3 id= "mymodallabel"> modal header </h3>' + ' </div>' + ' <div class="modal-body">' + ' <p>one fine body…</p>' + ' &l

php - Is this the correct way to create a system of infinite-scrolling on my website? -

i've learned basics of sql, ajax , (object oriented) php, i've put use creating user build feed of information. however, @ present feed loads 20 recent posts in database (since loading of them @ once have negative impact on page load time). i've decided trying implement system of infinite-scrolling (similar method used twitter , facebook) best solution problem, i'm not entirely sure how this. i know first thing need function tell whether user has reached bottom of page. this, i've written following simple jquery: $(window).scroll(function() { var scrollbottom = $(document).height() - $(document).scrolltop() - $(window).height(); if(scrollbottom < 200) { // send ajax request } }); this bit of code should work, concerned risk of multiple ajax requests being sent server if user scroll multiple times before feed of posts has been updated. i gather next thing need send off ajax request. naturally, script retrieves first 20 posts i

android - Listview in a table or tableview -

is possible put listview database adapter in scrollable table of table view? me , others might sound sound silly have app coded multiple scrollable table areas. screen split 4 quadrants data in each. data comes 1 table in database. display works great. this part hear: have coded database data displays each quadrant tablerow objects. problem arises when deleting records. application has update other table views. promote 2 monsters: 1:)app way big , 2:) slow performance. have demon crawling tells me programming myself corner. hacks, concerns, or start overs welcome. there open source library whois name tableview located in github. there sample app in repo display how can own app.

c# - GetConstructors doesn't find the declared constructor -

i'm experimenting system.type . in following code, used getconstructors on array type: using system; using system.reflection; class animal { public animal (string s) { console.writeline(s); } } class test { public static void main() { type animalarraytype = typeof(animal).makearraytype(); console.writeline(animalarraytype.getconstructors()[0]); } } the output is: void .ctor(int32) . why? shouldn't void .ctor(system.string) ? you called .makearraytype() you're doing reflection on array of animal , not animal itself. if remove that, you'll constructor expected. type animalarraytype = typeof(animal); console.writeline(animalarraytype.getconstructors()[0]); if wanted element type of array type, can this. type animalarraytype = typeof(animal[]); console.writeline(animalarraytype.getelementtype().getconstructors()[0]); in order construct array of desired size, can use this. type animalarraytype

nfc - PN532 Tag Emulation - Understanding initial response and APDU data field -

i have pn532 i'd present reader passive nfc tag ndef record url on it. following pn532's user manual can put device target mode, , read first adpu command phone. can use iso-14443-4 pdf 2005 see command a4, read file, , 2 parameter bytes indicate "select df name, first occurrence". past though, don't know how interpret data field, should the name of file being requested reading. furthermore, don't know how interpret initial command [e080] phone. the program's output: (comments #'s) usart init. i2c init. pn532 init. firmware: 1.6 sam config done. gen status: err code: 0x00 field: 0x00 number of tags: 0x00 initiating target. # here pn532 waits reader. tginitastarget. length: 5 # callback function once pn532 detects reader , retrieves first command it. mode: baud: 106kbps, 14443-4: yes, dep: no, framing type: mifare. initiator command: 0xe0 0x80 entering tg loop. callback: tggetdata. # tggetdata command

gradle - Why does Android Studio not run my generateConfig but command line does -

i'm trying generate identical assets each of subprojects in project. since same thing has happen each subproject, i'm trying avoid having add generation code each subproject. what i've got far is: // in outer build.gradle allprojects { proj -> gradle.projectsevaluated { def configtemplate = project.file('src/main/templates/configuration.json') def android = proj.getproperties()['android'] if (configtemplate.exists() && android != null) { task generateconfigfiles(type: configuretask) { template configtemplate environments proj.rootproject.file('scripts/environments.json') environmentname host destination new file(project.builddir, 'templates/configuration.json') } android.applicationvariants.all { variant -> variant.mergeassets.dependson generateconfigfiles }

opencobol - How to clear screen and set cursor position to the end of the screen in cobol -

so i'm trying make form-like screen user inputs data , saves in .txt file. i'm using opencobolide , i'm going through problems in clearing screen process. have kind of form made in console screen , when user enters data im refreshing new values of variables, cursor position screwing me because after clear screen gets reseted beginning of console screen, , want go end of text i'm displaying after process. explanation may confusing hope point code: identification division. program-id.pgm001. environment division. data division. working-storage section. 01 ws-data 02 ws-id pic x(03) value spaces. 02 ws-name pic a(15) value spaces. 02 ws-phone pic x(09) value spaces. screen section. 01 clear-screen. 02 blank screen. procedure division. menu. display "id........:" ws-id. display "name......:" ws-name. display "phone.....:" ws-phone. display "-----------". display "id:". ac

ruby on rails - ActiveRecord customize "AS" identifier -

some rails code like: @result = table_one.join(table_two, table_three). where(id = '1'). group(:val1, :val2, :amount). sum(:amount) will execute sql like: select sum(table_one.amount) table_one_amount, table_one.val1 table_one_val1 .... just wondering if there way customize rule of "as", can sql like select sum(table_one.amount) t1_a, table_one.val1 t1_v1 ....

NIfi: How to ingest a big table -

i trying ingest big table in nifi using querydatabasetable or executesql. doesn't seem work.. same query works smaller tables. thoughts? thanks what kind of error getting? may running following: https://issues.apache.org/jira/browse/nifi-1251 if using nifi 1.0 can use generatetablefetch processor. allows choose "page" (aka partition) size, , generate sql statements, each of grab 1 "page" of data. can route executesql , retrieve smaller sets of results @ time. if have nifi cluster, can route generatetablefetch remote process group points @ input port on same cluster, (which distribute sql statements across cluster), input port can connected executesql. allows fetch rows table in parallel.

All Excel options are greyed out -

Image
i found excel document on reddit attempting edit suit needs. having issues , went in options change settings. greyed out , cannot changed. have checked file make sure not read only. admin on computer and, far can see, have permissions file. have tried closing , reopening, restarting computer. there obvious missing? or know how can fix can keep editing file? answer sourced here probably have sheet protection turned on turn off several options make sure not in edit mode hitting esc (escape key), edit mode >will gray out lot of menu options -- notably edit options (except cut >& paste). grayout options under toolbar; many options under data , >under window. tools -> protection -> unprotect worksheet

session - PHP $_SESSION variable not working first time -

$_session['isloggedin'] doesn't seem working on first load. happens on server, not on localhost. session_start() @ top of each page. initialized to: $_session['isloggedin'] = false; when user logs in $_session['isloggedin'] = true; when user logs out $_session['isloggedin'] = false; on home.php: if (!$_session['isloggedin']) { die(header("location: login.php")); } on login.php: if ($_session['isloggedin']) { die(header("location: home.php")); } when login , sent home page $_session['isloggedin'] doesn't seem true redirects login.php. since true redirects home.php causing redirect loop. when redirect loop error pops up, refresh , taken right page. page self refreshes , takes me correct page, still showing redirect error before. why isn't $_session variable working on server? correct value doesn't seem register first time on every page, every site link. edit: e

database - How do you share diagrams in Valentina Studio (DB) -

i'm getting familiar valentina studio. seems useful tool--with easy drag/drop diagrams stay in sync actual schemas. in particular case, i'm using postgres. what's not clear me is, where diagrams stored, , how share them? afaikt export mechanism diagram-by-diagram. nightmare share other developers if create couple dozen diagrams. @ same time, of diagrams magically appear every time start software. haven't figured out if they're being stored in local filesystem somewhere or buried in sql server somewhere. far physical , google searches of turned nothing. the available info on product pretty bleak, appreciated. ok, here's current, hacky solution. each valentina studio connection results in diagrams data file, in subdirectory of: ~/.local/share/paradigma\ software/valentina\ studio/localdata/foreign/ so, copied file ( data.conf ) directory of source code repo , kept valentina studio happy symlink. here's how new developer gets access d

php - Database transactions doesn't prevent id incrementation when testing in Laravel -

so, in laravel 5.3 have following test: class articletest extends testcase { use databasetransactions; /** @test */ public function it_fetches_trending_articles() { factory(article::class, 3)->create(); factory(article::class)->create(['reads' => 10]); $mostpopular = factory(article::class)->create(['reads' => 20]); $articles = article::trending(); $this->assertequals($mostpopular->id, $articles->first()->id); } } what's going on here create 3 articles no 'reads' info, 1 article 10 reads , 1 20 reads. articles, ordered 'reads' , take first 1 , assert it's id equal 1 i'm sure trending. test passes , ok. the problem, though, databasetransactions trait not work expected. yeah, doesn't save articles database, keeps increasing id count on each test run. it great if give me advice on how prevent kind of behaviour. thanks in advance. :)

javascript - Implementation workaround for audio issues for Cordova exported Construct 2 games -

i creating game using construct 2, on previewing on android smartphone, found audio playback , delay issue: this possibly curse of web audio api in many browsers require user touch screen first or no music played. worse, if music played, user must touch screen once again. "by design" of these smartphone browsers. firefox seems allow music played without user initiated touch. i've seen issue has been covered several times (ex. website html 5 audio autoplay , https://stackoverflow.com/a/22331782/144201 ) , of possible suggestions include using other audio javascript libraries entirely such soundjs , howler.js. has have experience bringing in such audio library solve issue above cordova android export option? work android devices? in fact, can provide me link html5 game/page/app, exported c2 uses such audio library , play music without requiring user's initial touch on android check? want confirmation possible. or there more elegant way construct 2?

web services - How to implement instant Live update in android? -

i want live update of data in android. have seen socket.io can work in way in react. want know how use in android exactly? , efficient way live update in android native app? are perhaps talking google firebase? it's realtime database... , works on android... works on more android.

c++ - Compiling OpenCV 2.4.13 with Cmake and MinGW -

i got problem when trying compile opencv using cmake , mingw. for cmake: sourcecode located in "c:\cpp libraries\opencv-2.4.13\opencv\sources" binaries goint build in: "c:/cpp libraries/opencv-2.4.13/opencv/build/x64/mingw" i've used cmake generate makefile. when run makefile: c:\cpp libraries\opencv-2.4.13\opencv\build\x64\mingw>mingw32-make this output after 31% [ 31%] building cxx object modules/highgui/cmakefiles/opencv_highgui.dir/src/window_w32.cpp.obj c:\cpp libraries\opencv-2.4.13\opencv\sources\modules\highgui\src\window_w32.cpp: in function 'int icvcreatetrackbar(const char*, const char*, int*, int, cvtrackbarcallback, cvtrackbarcallback2, void*)': c:\cpp libraries\opencv-2.4.13\opencv\sources\modules\highgui\src\window_w32.cpp:1853:81: error: 'btns_autosize' not declared in scope ws_child | ccs_top | tbstyle_wrapable | btns_autosize | btns_button,

express - sequelize freezeTableName but still plural table name in sql query -

i'm using express+ionic+mysql+sequelize develop app, got error in sequelize. got 3 tables xx_product xx_product_specification_value xx_specification_value the relations between them below: xx_product hasmany xx_product_specification_value xx_specification_value hasmany xx_product_specification_value xx_product_specification_value belongsto xx_product xx_product_specification_value belongsto xx_specification_value here code: models/products.js module.exports = function(sequelize, datatypes){ return xx_product = sequelize.define('xx_product', { price: { type: datatypes.decimal }, full_name: { type: datatypes.string }, name: { type: datatypes.string }, image: { type: datatypes.string }, introduction: { type: datatypes.text }, xxsupplierid: { type: datatypes.bigint, field: 'supplier' }, xxbrandid: { type:

c++ - Installing gcc 6.1 on Windows 10 -

Image
i installed gcc using mingw. gcc version 5.3.0. class teaching in c++ 14. understanding gcc 6.1 or newer defaults in c++ 14 5.4 requires me change settings. heard have change setting on ide (eclipse). added -std=c++14 setting, following this answer . so did that, eclipse still did not understand test code. next tried downloading gcc using cygwin , following these instructions . this gave me gcc version 5.4.0, different version mingw. got step 3, says add command line: $ wget htp://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz (i removed t http stackoverflow doesnt change link) $ tar xf gcc-4.9.2.tar.gz however, cygwin terminal did not understand wget. can me out gcc 6.1 or 6.2 on desktop can start coding in c++ 14?

struts2 - Struts won't pass parameter to jsp file -

i have action (depending on result) redirects suitable file: <!-- /web/addaccount --> <action name="addaccount" class="com.x.y.z.webcreateaccountaction"> <result name="invalidlogin">/delete/confirm.jsp?err=signin</result> <result name="error">/delete/error.html</result> </action> for reason, when redirecting delete/confirm.jsp , parameter err is not passed in. i'm @ loss why happening. incorrect way of passing params jsp via struts? was missing a: type="redirect" <result name="invalidlogin" type="redirect">/delete/confirm.jsp?err=signin</result> note: advised against, redirect directly jsp, considered s2 anti-pattern. see comments below.

apache - Rewrite folder to subdomain with htaccess for cross domain issues -

i've followed instructions in rewrite folder subdomain , i'm running problem rewriterule ^cdn/([^/]+)/?$ http://cdn.example.com/ [nc,r=301,l] i'm expecting example.com/cdn/... redirect cdn.example.com instead it's redirecting cdn.example.com/cdn/.. doesn't me. this attempt around cross domain issues. can let me know how make rewrite how need it, , if solve video cross domain issues? you lack $1 @ end of rewriterule. need rules cdn. subdomain tell content in cdn folder: rewriteengine on rewritecond %{http_host} ^cdn\.example.com$ [nc] rewriterule ^cdn - [l] rewritecond %{http_host} ^cdn\.example.com$ [nc] rewriterule ^(.*)$ cdn/$1 [l,nc] rewritecond %{http_host} ^(www\.)?example.com$ [nc] rewriterule ^cdn/([^/]+)/?$ http://cdn.example.com/$1 [nc,r=301,l]

java - Unable to create alarm in aodh alrming service using openstack4j -

i trying use openstack4j v3.0.1 create alarm in openstack: alarm alarm = projectclient .telemetry() .alarms() .create(builders.alarm().name(alarmname + "@" + serverid).description(alarmname + " high") .type(alarm.type.threshold).thresholerule(rule).alarmactions(actions).isenabled(true).build()); but server fails respond , throws me exception: exception in thread "main" org.jboss.resteasy.client.clientresponsefailure: unable find messagebodyreader of content-type text/plain;charset="utf-8" , type null after track network traffic on server side, seems request sent 8777 port, telemetry metering service. in fact should sent 8042 port, telemetry alarming service running. anybody knows if i'm using openstack4j correctly. thanks!

uber api - Book a cab on my behalf, the code is not production ready, how to proceed then? -

Image
i trying auto-booking of cab code uber, me. have clientid, client secret , access token. how use them can fire request , monitor status whether has been booked or not? or if no cabs available retry @ specific intervals unless cab gets booked. please guide me. in meantime while trying fire v1/me, getting 401 unauthorized. did try following authentication tutorial understand if requests fire expected? also, you're getting down voted because there code or enable debug issue. if hints in tutorial not help, please provide more details on headers add. need have authorization header: authorization: bearer <your_access_token> valid access_token.

Retrieve data from PFObject - Objective C -

Image
i want retrieve nsdictionary : "serverdata" pfobject: "obj". "serverdata" nil. wrong somewhere?

android - How to change text colour for AndroidPlot domain and range labels? -

hi trying out simple xy plot androidplot. having trouble figuring out how change label colours domain , range. examples online use: plot.getgraphwidget().getdomainlabelpaint().setcolor(my_colour); plot.getdomainlabelwidget().getlabelpaint().setcolor(my_colour); however not compile me. can suggest need use? (i have tried using getgraph() instead of getgraphwidget() ) i'm trying set margin space between graph , domain labels, , space between graph , range labels if has suggestion that. plot = (xyplot) findviewbyid(r.id.plot); plot.setplotmargins(0, 0, 0, 0); plot.getbackgroundpaint().setcolor(color.white); plot.setborderstyle(xyplot.borderstyle.none, null, null); plot.getgraph().getbackgroundpaint().setcolor(color.white); plot.getgraph().getgridbackgroundpaint().setcolor(color.white); plot.getgraph().getdomainoriginlinepaint().setcolor(color.transparent); plot.getgraph().getrangeoriginlinepaint().setcolor(color.transparent); // cr

c - Strcmp wont return zero for same two same strings -

i reading in csv file using fscanf has 2 fields. datatype_t*read(file* fp) { char name[66]; char data[1466]; if (fscanf(fp, "%[^,] %[^\n]", name, data) == 2) { datatype_t *d = (datatype_t*)malloc(sizeof(datatype_t)); d->name = strdup(name); d->data = strdup(data); return d; } return null; } csv file data following mr dave,school teacher mike,head sachin,staff member now reading text file has data in it. char buffer[66]; if (fgets(buffer,sizeof buffer, fp) != null ) { keydata_t *k = (keydata_t*)malloc(sizeof(keydata_t)); size_t len = strlen(buffer); if(buffer > 0 && buffer[len-1] == '\n'){ buffer[--len] = '\0'; } k->name = strdup(buffer); return k; } return null; } data of txt file looks this. mr dave ron mr tim now when compare data strings: new_ptr = root; while((keyt = read_key(keyfile))!= null){ printf("%s\n", keyt->name); printf("%s\n&q