Posts

Showing posts from June, 2011

node.js - MongoDB: Update user data based on varying JSON POST data -

using mean environment (including mongoose database access) send varying json data web form (user profile input form) server. there, want update user's document based on data sent server. problem: user related information optional end broad variety of json objects sent server, e.g. 1) {(name: 'fooman', email: 'foo@man.com')} 2) {(name: 'fooman', email: 'foo@man.com', adress:'fooadress')} 3) {(name: 'fooman', email: 'foo@man.com', hasdog:'true')} 4) {(name: 'fooman', email: 'foo@man.com', location: 'footown')} on server side, end checking every possible json structure update user's document using appropriate mongoose instruction like: user.update({ _id: userid}, {name: json.name, email: json.email}) ->for case 1 user.update({ _id: userid}, {name: json.name, email: json.email, hasdog: true}) ->for case 3 as can see, leads me ugly , redundant code. hoping architecture advice ...

c++ - Check function overwriting in the derived class in CRTP pattern -

i'm trying implement compile-time checking of correct implementation of crtp pattern. here code: #include <iostream> #include <type_traits> using namespace std; #define static_interface_check(baseclass, derivedclass, funcname) \ static_assert(!std::is_same<decltype(&derivedclass::funcname), decltype(&baseclass<derivedclass>::funcname)>::value, "crtp error: function " #baseclass "::" #funcname " not overwritten in class " #derivedclass); template <class t> class interface { public: interface(); void foo1() { static_cast<t*>(this)->foo1(); } void foo2() { static_cast<t*>(this)->foo2(); } }; // checking inside interface<t> declaration results in incomplete type error, had move default constructor template <class t> interface<t>::interface() { static_interface_check(interface, t, foo1); static_interface_check(int...

css - Angular 2: How to style host element of the component? -

i have component in angular 2 called my-comp: <my-comp></my-comp> how 1 style host element of component in angular 2? in polymer, use ":host" selector. tried in angular 2. doesn't work. :host { display: block; width: 100%; height: 100%; } i tried using component selector: my-comp { display: block; width: 100%; height: 100%; } both approaches don't seem work. thanks. there bug, fixed in meantime. :host { } works fine now. also supported are :host(selector) { ... } selector match attributes, classes, ... on host element :host-context(selector) { ... } selector match elements, classes, ...on parent components selector /deep/ selector (alias selector >>> selector doesn't work sass) styles match across element boundaries update: sass deprecating /deep/ . angular (ts , dart) added ::ng-deep replacement that's compatible sass. see load external css style angular 2 component /deep/...

jquery - Text appear to right of links -

i have more text appear next links when hovered over, so; link---text further explaining link i've used several methods none need. heres code far; html <!doctype html> <html> <head> <link href='http://fonts.googleapis.com/css? family=righteous|oswald|slabo+27px' rel='stylesheet' type='text/css'> <link rel='stylesheet' href='style.css'/> <script src='script.js'></script> </head> <body> <h1> mangopulp</h1> <header> <div class="nav"> <ul class="nav"> <li class="home"><a href="#">home</a></li> <li class="purchase"><a href="#"> purchase</a></li> <li class="products"><a href="#">products</a></li> <li class="soggynotions"><a href=...

jquery - Rounded Animated Navigation -

i'm trying reproduce effect : codyhouse but more simple. so try begin. didn't manage expand circle top hand left corner . , cover page without scrollbar :-/ it's not simple. after content appears. didn't manage :-( my jsfiddle $('.toggle-menu').click(function (e) { e.preventdefault(); $('h4.toggle-menu').text($(this).text() == 'menu' ? 'close' : 'menu'); $('.circle, #overlay-menu').toggleclass('opacity'); $('.circle').addclass('open'); }); there css instead of js codes. please check following fiddle once. updated fiddle $('.toggle-menu').click(function (e) { e.preventdefault(); $('h4.toggle-menu').text($(this).text() == 'menu' ? 'close' : 'menu'); $('.circle, #overlay-menu').toggleclass('opacity'); $('.circle').toggleclass('open'); });

junit - java.lang.IllegalArgumentException: Not a mock: java.lang.Class on PowerMock and EasyMock -

i have test case using powermock test on static method math, as @runwith(powermockrunner.class) @preparefortest( { math.class }) public class test{ @test public void test2(){ powermockito.mockstatic(math.class); easymock.expect(math.abs(-123)).andreturn(1); easymock.replay(math.class); long returns = math.abs(-123); easymock.verify(math.class); org.junit.assert.assertequals(1,returns); } } my pom.xml looks as <dependency> <groupid>org.mockito</groupid> <artifactid>mockito-all</artifactid> <version>${mockito.version}</version> <scope>test</scope> </dependency> <dependency> <groupid>org.easymock</groupid> <artifactid>easymock</artifactid> <version>3.3.1</version> </dependency...

audio - OpenAL Sound don't play normally in Java -

i write program use openal , run. however, sound don't play normally. the sound played in amazing speed. also, sound become noisy if change pitch of sound. what's that? code. i consulted source cord exists in lower url. http://wiki.lwjgl.org/wiki/openal_tutorial_1_-_single_static_source package other; import java.io.bufferedinputstream; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.ioexception; import java.nio.floatbuffer; import java.nio.intbuffer; import org.lwjgl.bufferutils; import org.lwjgl.lwjglexception; import org.lwjgl.openal.al; import org.lwjgl.openal.al10; import org.lwjgl.openal.al11; import org.lwjgl.util.wavedata; public class music { /** position of source sound. */ floatbuffer sourcepos; /** velocity of source sound. */ floatbuffer sourcevel; /** position of listener. */ floatbuffer listenerpos; /** velocity of listener. */ floatbuffer listenervel; /** orientation of listener. (first 3 elements "at...

pointers - C++ new and delete ptr wrapper class -

there question asked c++ wrapper class is, , think provided answer. username: gmannickg stack overflow provided following code answer: class int_ptr_wrapper { public: int_ptr_wrapper(int value = 0) : mint(new int(value)) {} // note! needs copy-constructor , copy-assignment operator! ~int_ptr_wrapper() { delete mint; } private: int* mint; }; that code prompted me question. i've heard several different people considered bad practice use new , delete keywords. there situation in should use new or delete? if wrote code above below, considered better practice? class int_ptr_wrapper { public: int_ptr_wrapper(int value = 0) : m_int(&value) {} private: int* m_int; }; there (almost) better way using new . there absolutely better way using delete . have @ documentation std::shared_ptr<> , std::unique_ptr<> . between them cover every scenario ever need regard scoped memory management, automatic re...

html - Limiting links to appropriate text -

i trying make navigation menu footer. it's going quite well, both contain links. , having trouble limiting "link click area" small square around text. can point cursor several px next name in menu , still hit link. how fix or rather: how limit link, hover function, appropriate text? doing in html , css! footer { font-family: moon flower bold; font-size: 40px; color: black; background: rgba(0,138,99,0.4); list-style-type: none; padding-bottom: 45px; } footer ul { list-style-type: none; margin: 0; padding: 0; } footer ul li { display: inline-block; float: left; width: 200px; } footer a:visited, a:link { color: black; text-decoration: none; } footer a:hover { background-color: grey; text-decoration: none; } <footer> <ul> <li>&copy; gruppe 3</li> <li><a href="kontaktos.html">kontakt os</a></li> ...

lucene - How much space does a field take in Elasticsearch index? -

is there api or other way find out how disk space field taking in elasticsearch index? we'd pare down on fields without knowing how space field takes, it's shooting in dark. we use elasticsearch, i'm ok looking @ single lucene index (=es shard) information.

java - Why Spring Integration management configuration doesn't work by default? -

i investigating new spring integration benefit - integration management configuration, in basis of java docs 1 provided 4.2 release. i've written simple java based context. /** * @author eugene stepanenkov */ @configuration @enableintegration @enableintegrationmanagement @integrationcomponentscan(basepackages = { "com.stepsoft.study.flow", "com.stepsoft.study.configuration.flow", "com.stepsoft.study.flow.messaging" }) @componentscan(basepackages = { "com.stepsoft.study.flow", "com.stepsoft.study.configuration.flow", "com.stepsoft.study.flow.messaging" }) @import({ datacontext.class, importflowcontext.class }) @propertysource("classpath:flow.properties") public class flowcontext { @value("${flow.defaultpoller.fixeddelay}") private int fixeddelay; @value("${flow.defaultpoller.maxmessagesperpoll}") private...

image processing - Error using IDCT (OpenCV) -

Image
everytime run code program don't respond , msg , don't know problem ? can me ? message: my code: int main(){ mat image,dctimage; image=imread("2.jpg"); cvtcolor(image,image,cv_bgr2gray); image.convertto(image,cv_32fc1); mat freq; dct(image,freq); imwrite("dctimage.jpg",freq); int start;int col=0;int rows=0; stringstream ss; for(start=100;start>0;start=start-1){ for(int x=start;x<freq.rows;x++){ for(int y=start;y<freq.cols;y++){ freq.at<double>(x,y)=0.0; } } mat dst(freq.size(),freq.type()); idct(freq,dst); ss<<start<<".jpg"; cout<<ss.str()<<endl; imwrite(ss.str(),dst); ss.str(""); cout<<ss.str()<<endl; } try change freq.at<double>(x,y)=0.0; freq.at<float>(x,y)=0.0; because feed image.convertto(image,cv_32fc1); , should expect same element type.

SAS macro to read multiple rawdata files and create multiple SAS dataset for each raw data file -

sas macro read multiple rawdata files , create multiple sas dataset each raw data file hi there my name chandra. not @ sas macro looping part , resolving &&. etc. here problem statement. problem statement: have large number of raw data files (.dat files) stored in folder in sas server. need macro can read each of these raw data file , create sas data set each raw data file , store them in separate target folder in sas server. these raw data files have same file layout structure. need automate operation every week, macro reads raw data files source folder , creates corresponding sas dataset , stores them in target folder in sas server. example, if there 200 raw data files in source folder, want read them , create 200 sas datasets 1 each raw data file , save them in target folder. not @ constructing looping statement , resolving && or &&& etc. how do it? i highly appreciate kind assistance in regard. respectfully chandra you don't...

ios - UISwitch decides if another UITableViewCell is editable -

i have 3 custom table view cell in 1 section. first cell have uiswtich . want when uiswitch on other 2 table view cell's uitextfield editable, otherwise not. possible? you can adding listener switch, check state, , set editability of 2 text fields there: // goes viewdidload sw.addtarget(self, action: selector("statechanged:"), forcontrolevents: uicontrolevents.valuechanged) // function work func statechanged(switchstate: uiswitch) { if switchstate.on { textfield1.editable = true textfield2.editable = true } else { textfield1.editable = false textfield2.editable = false } } i assuming textfield1 , textfield2 outlets referencing uitextfield s in 2 table cells.

sql - How to ignore unique Index on multiple columns based on column value while inserting new record -

we have table 3 columns, studentid , subjectid , active (and few other columns not related question). active column indicates whether record active or not(we set active column 0 if deletes records ui) definition of index on columns studentid , subjectid below: create unique nonclustered index [uq_studentsubject_subjectid_studentid] on [dbo].[studentsubject] ( [studentid] asc, [subjectid] asc )with( pad_index = off, statistics_norecompute = off, sort_in_tempdb = off, ignore_dup_key = off, drop_existing = off, online = off, allow_row_locks = on, allow_page_locks = on ) on [primary] go from our application, if try insert record combination of subjectid , studentid insert failing , java throwing below error: caused by: com.microsoft.sqlserver.jdbc.sqlserverexception: cannot insert duplicate key row in object 'dbo.studentsubject' unique index 'uq_studentsubject_subjectid_studentid'. duplicate key value (113...

r - Simulate competing risk data -

my goal simulate data set can used test competing risk model. trying simple example survsim::crisk.sim function not lead results expect. require(survival) simulated_data <- survsim::crisk.sim(n = 100, foltime = 200, dist.ev = rep("weibull", 2), anc.ev = c(0.8, 0.9), beta0.ev = c(2, 4), anc.cens = 1, beta0.cens = 5, nsit = 2) model <- survreg(surv(time, status) ~ 1 + strata(cause), data = simulated_data) exp(model$scale) ## cause=1 cause=2 ## 4.407839 2.576357 i expect these numbers same beta0.ev . pointers might wrong or other suggestions how simulate competing risk data. for completion: events in simulated data occur following weibull distribution different each risk. able specify str...

dns - How do I set up Google Compute Engine as a HTTPS server? -

i'm running app on vm instance (instance-1) , myproject.appspot.com requests served instance-1. i read https://cloud.google.com/appengine/docs/java/modules/routing wasn't clear. there way "send traffic 1 instance"? if go (ephemeral) external ip address instance, can see server. but, won't work oauth2 domain (no ip addresses allowed), need go through named domain. i'd ok if use constant instance-1-dot-myproject.appspot.com prefer base myproject.appspot.com "any instances? great! use that." i think want use managed vms . give flexibility of google compute engine work more paas google app engine. you don't create google compute engine vm instances yourself, however, managed vms spin them on demand, using docker image provide container of code, data, etc. note of 29 sep 2015, per the docs : beta this beta release of managed vms. feature not covered sla or deprecation policy , may subject backward-incompatible c...

cuda - What will happen to the allocated memory on GPU, after the application using it exits, if cudaFree() was not used? -

if cudafree() not used in end, memory being used automatically free, after application/kernel function using exits? yes. when application terminates (be gracefully or not), of memory reclaimed os, regardless of whether had free d or not. similarly, memory allocated on gpu managed driver, release resources application held, cudafree d or not. it practice every allocation has matching deallocation, don't use excuse not deallocate memory :)

What is the default setting for continueFilterChainOnUnsuccessfulAuthentication on Spring Security 4.x -

what default setting setcontinuefilterchainonunsuccessfulauthentication() method on spring security's abstractpreauthenticatedprocessingfilter? javadoc summary @ http://docs.spring.io/spring-security/site/docs/4.0.2.release/apidocs/ says: by default , filter chain proceed when authentication attempt fails in order allow other authentication mechanisms process request. reject credentials immediately, set continuefilterchainonunsuccessfulauthentication flag false. the documentation on method http://docs.spring.io/spring-security/site/docs/4.0.2.release/apidocs/org/springframework/security/web/authentication/preauth/abstractpreauthenticatedprocessingfilter.html#setcontinuefilterchainonunsuccessfulauthentication(boolean) says: ... if false (the default ), authentication failure result in immediate exception. thanks in advance clarification. not sure confusion these links saying default set true continue validating other included authentication filters. im...

automata - Does a language compiler use a complex DFA to accept programs? -

i reading on theory of computation. , have no practical experience of programming compiler. so occurred me, c or java compiler use huge dfa validate program (string in toc parlance)? are compilers practical implementations of dfa? some compilers do, others don't. use dfas typically use scanner-generators lex/flex build dfa. of course, dfa take far (up regular language, in fact). no practical programming languages can described regular expression, since regular expressions cannot handle recursive structures parenthesized expressions or nested control-flow blocks. dfa, if any, used break input sequence of tokens. tokens parsed kind of pushdown automaton, or recursive descent parser, or pure black magic on part of coder. again, pda (if any) may generated automatically, using tool bison, antlr, , many others . it's rare find language pure enough simple two-phase dfa scan / pda parse correctly create parse tree. there seems temptation add syntactic construct can...

c++ - calculate sum of integers from a file using structure pointer -

struct data { int *pdata; int nsize; int nsum; int nmax; int nmin; float fmean; }; struct data readdatafile(const char *pfilename); int main(void) { data stdata = readdatafile ("data.txt"); printf("we read %d numbers\n", stdata.nsum); printf("sum: %d\nmean: %f\nmax: %d\nmin: %d\n", (float)stdata.nsum / stdata.nsize, stdata.nmax, stdata.nmin); return 0; } how assign values data.txt *pdata , calculate nsum ? have done storing values array. unable assign , complete using pointer? i did using arrays below. if (infile.is_open()) { while (infile.good()) { infile.getline(cnum, 256, ' '); arrays[count]= atoi(cnum) ; ++count ; } infile.close(); min = arrays[0]; max = arrays[0]; for(int j=0; j<count; j++) { if(min > arrays[j]) min = arrays[j]; ...

makefile - Better rules for gnu make with docker -

suppose source files located in ~/dev/root inside ~/dev/root number of projects. e.g. ~/dev/root/libraries/libx ~/dev/root/apps/app/appy ~/dev/root/docker/appy the build tool use called tundra2 , invoked root level. so if run tundra2 production appy it'll produce it's output to ~/dev/root/t2-output/linux64-gcc-production-default the binary directly below directory. there intermediate files located within sub-directories in directory. now annoying bit. whatever reason, docker build uses daemon process copies directory it's being run temporary directory. produces it's image there. haven't yet spent time try , extend tundra2 cope docker i've been using makefile. so inside docker/appy directory have dockerfile. alongside have makefile. idea cd directory , run make. if builds, should copy outputs t2-output docker/appy directory , run docker build. so far, i've specified build targets like: t2out=../../t2-output/linux64-gcc-produ...

python - Debugging a PyQt application using PyDev+Eclipse -

i routinely use pydev in eclipse python development. however, i'm trying pyqt first time in same environment. works well, 1 exception. if program errors out anywhere within qt main event loop, including within own code, no error information output pydev console. to demonstrate created following simple pyqt app: import sys pyqt5 import uic pyqt5.qtwidgets import qapplication # test.ui contains single push button named pushbutton base, form = uic.loaduitype("../ui/test.ui") class mainwindow(base, form): def __init__(self, parent=none): super(base, self).__init__(parent) self.setupui(self) self.pushbutton.clicked.connect(self.button_pressed) def button_pressed(self): print('button pressed') print(invalid_variable) # intentional error pass if __name__ == '__main__': app = qapplication(sys.argv) app.setstyle("fusion") main_window = mainwindow() main_window.show() ...

arm - Having trouble understand assembly language stuff -

i'm having troubles understanding code means in assembly language. assume r3 = 0x4000 r4 = 0x20 want effective address.. . strh r9, [r3, r4]; 0x00004020 ldrb r8, [r3, r4, lsl #3];0x00024000 (**?**) ldr r7, [r3], r4;**?** strb r6, [r3], r4 , asr #2; from know, lsl #3 should shift bit left 3 bits, mean 0x20 become 0x20000 ? other 1 don't seem understand logic well. can maybe give me guides or a little walk through? thanks.

c++ - How to add correct Content-Type when uploading file with Wininet? (HTTP PUT) -

i uploading file wininet sharepoint server http put. however, when specify file name .xlsx extension, got on sharepoint server file says it's named .xlsx , when downloading it, gets .zip extension. also, on sharepoint, file not little excel icon next it, more generic icon. have tried every combination of setting content-type ("mime-type") httpaddrequestheaders , @ httpsendrequest come with. the code below uploads file, sharepoint gets content-type wrong: static int upload_file_to_sharepoint(lpcstr filename, lpcstr server, lpcstr location) { hinternet hintrn = internetopena( "magic", internet_open_type_preconfig_with_no_autoproxy, null, null, 0 ); if (!hintrn) return printf("no internet connection: %li.\n", getlasterror()); hinternet hconn = internetconnecta( hintrn, server, internet_default_https_port, null, null, internet_s...

asp.net mvc - I want to store and retrieve html data in mvc by setting validate(false) -

if use @html.raw() html executing well.. people saying displaying data(html) using @html.raw() lead xss attacks. but alternatively don't have choice display html data in mvc... there way achieve this? <h1 class="art-heading">@html.displayfor(model => model.article_name)</h1> <div> @html.displayfor(model => model.article_content) </div> <section> @html.raw(model.code) </section> try use: mvchtmlstring here more information class public mvchtmlstring outputhtml() { return mvchtmlstring.create("<div>my div</div>"); } then in view: @outputhtml()

ruby on rails - heroku run rake db:migrate:status down in heroku? -

when run heroku run rake db:migrate:status i have last 4 migration down this 20150916190326 add fields purchase 20150923012744 create friendly id slugs 20150923013732 add weight product 20150926012254 add stste purchase 20150930015516 add shipping rate purchase down 20150930025547 add country purchase down 20150930025742 add country again purchase down 20150930031326 add countryy purchase down 20150930042706 add countryyy purchase what should run make of them without deleting database in heroku? step 1) check version numbers of migrations down using below command. heroku run rake db:migrate:status step 2) below command migrate table respective version numbers. heroku run rake db:migrate:up version= 20150930025547

Parse Fortran String Like A File -

i want pass string c fortran , process line-by-line if reading file. possible? example string - contains newlines file description: file contains stuff 3 values 1 description 2 description 3 more text then, parse string line-by-line, file. similar this: subroutine read_str(str, len) character str(len),desc*70 read(str,'(a)') desc read(str,*) n 10 i=1,n read(str,*) parm(i) 10 continue not without significant "manual" intervention. there couple of issues: the newline character has no special meaning in internal file. records in internal file correspond elements in array. either need first manually preprocess character scalar array, or use single read skipped on newline characters. if did process string array, internal files not maintain file position between parent read statements. need manually track current record yourself, or process entire array single read statement accessed multiple records. if have variable w...

android - How to add a dynamic listview layout inside a parent list view? -

Image
i new android in android layout got listview inside listview both listviews should repeat dynamically.here have acheive curriculum fragment layout.in curriculum creation:making idea center title parent list view , bellow creation: audio , workbook sub listview.how can achieve it.

node.js - How do I write a conditional for express-sessions login/logout in my main handlebars layout? -

i have login/logout routes written in controllers. //login form app.get('/login', function (req, res) { res.render('../views/signup-signin/login'); }); //login post app.post('/login', function (req, res) { user.find(req.body.username, function (user) { bcrypt.compare(req.body.password, user.password, function (err, result) { if (result) { req.session.currentuser = user.id; res.redirect('/'); } else { res.redirect('/login'); } }); }); }); //logout app.delete('/logout', function (req, res) { req.session.currentuser = null; res.redirect('/'); }); what i'm having trouble being able write if/else statement in 'main.handlebars' layout renders sign up/login when req.session.currentuser = null, , logout when req.session.currentuser = user.id <div id="signin_up"> <a href=...

.net - SQL UDT Type parameter pass in C# -

i have sql udt type create type [dbo].[udtname] nvarchar(50) null go and using in procedure insert data db. procedure this create procedure [dbo].[proc_name] ( @param1 int, @param2 int, @param3 udtname, @param4 udtcomment, @param5 udttype = '' output, @param6 udttype = '' output ) when calling procedure c# code, udt type data not saving in table. my c# code: private idictionary<string, string> runquery(string procname, list<parameter> input) { foreach (parameter inputpair in input) { sqlparameter sp = new sqlparameter("@" + inputpair.name , inputpair.type); // have tried sqldbtype varchar, nvarchar sp.direction = system.data.parameterdirection.input sp.sqldbtype = sqldbtype.udt; // have if condition around check if udt type add udttypename sp.udttypename = "udtname"; // have tried dbo.udtname sp.size = inputpa...

rabbitmq - Fanout exchange behaving as Direct exchange in Spring AMQP -

i facing issue while using rabbitmq in fanout exchange due unknown reason behaving direct exchange. i using following binding , queue configuration <bean id="testfanout" class="com.test"> <constructor-arg name="exchange" ref="test" /> <constructor-arg name="routingkey" value="test" /> <constructor-arg name="queue" value="testq" /> <constructor-arg name="template"> <bean class="org.springframework.amqp.rabbit.core.rabbittemplate"> <constructor-arg ref="connectionfactory" /> </bean> </constructor-arg> <constructor-arg value="true"/> </bean> <rabbit:fanout-exchange name="test" id="test"> <rabbit:bindings> <rabbit:binding queue="test"/...

java - How to read last word or latest word in JTextArea -

i making source code editor using jtextarea.in want following task." while user typing on editor window(jtextarea),each , every time updated text(last word) should compare set of words in database, if matches 1 of word definition open in new popup frame." coding following string str = textarea.gettext(); class.forname(driver).newinstance(); conn = drivermanager.getconnection(url+dbname,username,password); string stm="select url pingatabl functn=?"; preparedstatement st = conn.preparestatement(stm); st.setstring(1, str); //excuting query resultset rs = st.executequery(); if (rs.next()) { string s = rs.getstring(1); //sets records in frame jframe fm = new jframe(); fm.setvisible(true); fm.setsize(500,750); jeditorpane jm = new jeditorpane(); fm.add(jm); jm.setpage(classloader.getsystemresource(s)); in above coding string str = textar...

c - Handling hardware with polyspace -

i working mathworks polyspace code analysis. have hardware register write key+mode , read register check value in register equal mode. the problem is, polyspace considers 'always fail' writing , reading different values in consecutive steps. is there option in polyspace handle issue.? since key+mode different mode, polyspace logically consider test your_hardware_register == mode failed (fortunatly). it seems key , mode bit flags register. see 2 options: use bitwise , operator test register : if (your_hardware_register & mode) make register volatile (by adding qualifier volatile declaration of register) polyspace consider can take value (including mode).

php - Doctrine not importing particular tables -

i working on symfony2 , trying create entities database .my problem have 12 tables in database 10 entities getting generated . those 2 tables not getting imported when trying import them individually. i have tried commands mentioned in thread but when run command php app/console doctrine:mapping:import appmybundle \ metadata_format --filter="yourtablename" it says database not have mapping information. sorry new symfony , doctrine .please suggest me should do? at first, try convert annotation --from-database argument, described in this answer : step1 php app/console doctrine:mapping:convert annotation /src/app/mybundle/resources/config/doctrine --from-database --filter="table_name" step2 can apply importing php app/console doctrine:mapping:import appmybundle annotation --filter="table_name" step3 php app/console doctrine:generate:entities appmybundle --no-backup

javascript - How to read property of Object -

i selecting value drop down , want use in following way. here returning value drop down in variable selectedtext. <p style="font-size:150%;margin-left:20%; margin-top:50px"> sources : <select id="drop" name="drop"> <option value="0">select source</option> <option value="1">rbsk</option> <option value="2">midrs</option> <option value="3">atm </option> <option value="4">rt </option> </select> <script type="text/javascript"> $(function () { $("#drop").change(function () { var selectedtext = $(this).find("option:selected").text(); //var selectedvalue = $(this).val(); //alert("selected text: " + selectedtext + " value: " + selectedvalue...

Python Date Conversion. How to convert arabic date string into date or datetime object python -

i have convert date normal date string/object. ١٩٩٤-٠٤-١١ 11-04-1994. var arabicdate = "١٩٩٤-٠٤-١١"; var europeandate = arabicdate.replace(/[\u0660-\u0669]/g, function(m) { return string.fromcharcode(m.charcodeat(m) - 0x660 + 0x30); }).split('-').reverse().join('-'); console.log(europeandate); // => 11-04-1994 edit: derp. python, not javascript. i'll leave here rewrite.

html - Strange spacing above an image placed in anchor tag -

i have big banner placed on top of page below top menu , link placed on it. check below link. http://dev.shy7lo.com/shoes.html?___store=en&___from_store=arabic if check spacing above image in firebug or in chrome developer tools, a tag adding 17 20px top space. strange. can body suggest why spacing there , how remove it? its because of .main-container { padding: 30px 30px 0; } you should replace .main-container { padding: 0 30px; } and make height:0px in #header-search @media screen , (min-width: 771px) #header-search { display: block; position: relative; top: -48px; float: right; width: 25%; /*height: 50px;*/ height: 0; padding: 0; }

java - Read data from Google Spreadsheets -

am looking read data google spreadsheets. here things tried far: import com.google.gdata.client.spreadsheet.*; import com.google.gdata.data.spreadsheet.*; import com.google.gdata.util.*; import java.io.ioexception; import java.net.*; import java.util.*; public class myspreadsheetintegration1 { public static void main(string[] args) throws authenticationexception, malformedurlexception, ioexception, serviceexception { spreadsheetservice service = new spreadsheetservice("spreadsheetsample"); // todo: authorize service object specific user (see other sections) // define url request. should never change. url spreadsheet_feed_url = new url( "https://docs.google.com/spreadsheets/d/1jeo8zov34wvmix3rl48gkszgj0ixghx_cwdcdzyqkcg/edit#gid=0"); // make request api , spreadsheets. spreadsheetfeed feed = service.getfeed(spreadsheet_feed_url, spreadsheetfeed.class); list<spreadsheetentry> spreadsheets = feed.ge...

ios - Unable to simultaneously satisfy constraints Warnings with AVPlayerViewController embedded in storyboard -

Image
i'm trying set avplayerviewcontroller through storyboards embedding in separate view controller. steps: create single view application in xcode. embed vc in navigation controller. add toolbar @ bottom.(pinned superview (leading, trailing, bottom layout guide, height(44)). add container view in parent view controller.(pinned superview (leading, trailing), top layout guide, toolbar top). remove default view controller comes container view. drag av player view controller object object library. connect embed segue container view av player view controller. no code added. this storyboard looks like: view hierarchy: everything runs fine: but problem is: run these warnings in debugger: 2015-09-30 12:58:35.904 avplayertest[9352:446772] unable simultaneously satisfy constraints. @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constrain...