Posts

Showing posts from August, 2012

asp.net c# website form actions after 24 hrs -

i have asp.net c# website members complete form stored in sql server. after 24 hrs, send notification specific group of users if form status has not changed. achievable within asp.net?? appreciated i have done several times , there many ways it. 1 simple way check every x minutes if need send notifications. if so, send them. for example: every 60 minutes check if there forms have been on same status 24hs. if so, send notification. if have full control of server, recommend create windows service perform job. asp.net not built long running tasks that's why i'm suggesting create windows service. one more thing, create log table task every time send notification, add row on table. that's gonna debug issues might have. also, remember mark rows have notified customer avoid sending notification twice. add double check before sending notification.

PHP/Jquery - Variable that stores the number of files in a folder and then use it as a loop counter -

short version need creating variable stores number of files in folder , use loop counter. full version: thought found answer here , isn't working me. since don't have enough reputation, can't comment on old thread here am. i created jquery function add images portfolio page. is: $(document).ready(function() { (i = 1; <= 9; i++) { $('.flex-container').append('<aside class="flex-item"><img src="images/portfolio/' + + '.jpg" alt="blah blah"></aside>'); } }); as can see, started 9 images. however, i'd site automatically update when additional images added 'images/portfolio' folder. (images named in numerical order such 1.jpg, 2.jpg, etc.) based on thread linked above, created php file named numberoffiles.php . file contains: <?php return iterator_count(new directoryiterator('../images/portfolio')); ?> (my root directory contains both 'imag

C++ can't implement default constructor -

i have following class: class fraction { private: int x; int y; public: // constructors fraction(long x = 0, long y = 1); fraction(const fraction&)=default;//here problem virtual ~fraction(); }; i'm trying disable default c++ constructor implement own (i intend use copy). so, declared default. but, when i'm trying implement it: fraction::fraction(const fraction&){} compiler throws following error @ me: ./src/fraction.cpp:16:1: error: definition of explicitly-defaulted ‘fraction::fraction(const fraction&)’ fraction::fraction(const fraction&){ ^ in file included ../src/fraction.cpp:8:0: ../src/fraction.h:22:2: error: ‘fraction::fraction(const fraction&)’ explicitly defaulted here fraction(const fraction&)=default; is there way fix it? i'm doing wrong ? found articles defaults, nothing can me fix these errors. = default tells compiler use default implementatio

linq - Concatenating Two Different IEnumerable Objects in C# -

i have got 2 different ienumerable objects, properties similar in both classes,now want concatenate/merge them, both results can assigned repeater datasource, below sample code. ienumerable<icacheditem> cacheold = cache<string>.cacheditems; //my old cache class, here fetching cached items ienumerable<caching.icacheditem> cachenew = caching.cache<string>.cacheditems; //my new class cached items var combined = cachenew.cast<icacheditem>().concat(cacheold); //trying concat both repeater.datasource = combined.orderby(entry => entry.region + ":" + entry.prefix + ":" + entry.key); //assigning datasource repeater.databind(); combined object coming blank, suggestions. update: have got these in class public class cacheditem<t>: icacheditem { public cacheditem(string key, string prefix, t value) : this(cacheregion.site, prefix, key, value) { } } do need modify class? you can use select

c# - unable to handle Amazon.DynamoDBv2.Model.ConditionalCheckFailedException -

when execute following code amazon.dynamodbv2.model.conditionalcheckfailedexception not catching. button click public delegatecommand savecommand { { _savecommand = new delegatecommand(async (arg) => { await this.savecommandexecuted(arg); }, this.savecommandcanexecute); return _savecommand; } set { _savecommand = value; onpropertychanged("savecommand"); } } save method content public async task savecommandexecuted(object parameter) { try { await patientdatasource.instance.savepatient(patient); } catch (amazon.dynamodbv2.model.conditionalcheckfailedexception ex) { exception = ex.message; } } database operation method public async task savepatient(patient patient) { var context = commonutils.instance.dynamodbcontext;

MySQL Implementation of Consecutive Date Ranges -

i have mysql database containing contracts table: create table if not exists `contracts` ( `id` bigint(20) not null auto_increment, `employee_id` bigint(20) default null, `start_date` date default null, `end_date` date default null, primary key (`id`) ) engine=innodb default charset=utf8 collate=utf8_unicode_ci; insert `contracts` (`id`,`employee_id`,`start_date`,`end_date`) values (1, 555, '2010-01-01', '2012-12-31'), (2, 666, '2013-01-01', '2013-05-01'), (3, 666, '2013-05-02', '2013-10-11'), (4, 777, '2012-01-10', '2013-03-01'), (5, 777, '2013-03-02', '2014-07-15'), (6, 777, '2015-01-16', '2015-05-20'); querying 1 or multiple contract lines per employee select * contracts id employee_id start_date end_date 1 555 2010-01-01 2012-12-31 2 666 2013-01-01 2013-05-01 3 666 2013-05-02 2013-10-11 4 777

javascript - CasperJS/PhantomJS - Browsing one page and send HTTP request to other resource -

i need browse 1 page, retrieve data , send data service via http requests. far know, casperjs/phantomjs can work simultaneously 1 web resource. how bypass limitation? upd: need make request casperjs/phantomjs side, not page context through evaluate() . @interloper - able perform integration, need 2 basic requirements: 1 - page requested, must habilidada receive information via http access control (cors). depend on type of application! example, if using c # in project, you'll have add following code in web.config in system.webserver : <httpprotocol> <customheaders> <add name="access-control-allow-origin" value="*" />     <add name="access-control-allow-headers" value="content-type" /> </customheaders> </httpprotocol> with this, project / page enabled can make access / exchange of information other domain ... 2 - can call url domain, , in our case, code casperjs, can

javascript - Request main road / curbside StreetView panoramas instead of back alleys from API -

is there way request main road google streetview panorama data instead of alley panorama data given location (latitude/longitude)? i'm using google maps javascript api retrieve street view panorama home address supplied our users. works quite addresses i've tried, i'm noticing lot of properties in california have street views alleys, , api seams consistently returning alley panorama instead of main road (front of property) panorama. i don't want show user alley panorama of home, instead main road panorama. if lookup same address on maps.google.com see front of house, when request same address through api alley. the process i'm using is: geocode address get panorama given geocode location (lat/long) compute heading , display panorama on page test addresses: 325 s peck dr, beverly hills, ca, usa, 90212 333 s rodeo dr, beverly hills, ca, usa, 90212 any ideas or suggestions appreciated. thanks! use directions service directions desired

facebook graph api explorer return values only for life time -

i searching likes given videos in facebook page.....but returned lifetime values instead of specific date value. i using c#.net windows application for example : below link used values https://graph.facebook.com/2.4/pageid_videoid/insights/period=day returns lifetime value instead of day values. please me find out solution...... thanks in advance you need call endpoint this: https://graph.facebook.com/2.4/{post_id}/insights?period=day where {post_id} post's unique id. see https://developers.facebook.com/docs/graph-api/reference/v2.4/insights#modifiers

r - Assigning grade and adding that as new column -

i want grade students on basis of score . data frame students subject1 subject2 subject3 total s1 20 10 15 45 s2 10 10 12 32 s3 5 10 10 25 s4 8 10 15 33 s5 6 5 5 16 s6 10 -5 -5 0 i want check if total >30 assign p , if <30 a, else 0 output student subject1 subject2 subject3 total grade s1 20 10 15 45 p s2 10 10 12 32 p s3 5 10 10 25 f s4 8 10 15 33 p s5 6 5 5 16 f s6 10 -5 -5 0 0 i tried code df$grade <- ifelse(df$total==0, '0', ifelse(df$total < 30, 'a',ifelse(df$total >30,'p'))) but think not correct way. error

VBA Macro to extract data from a chart in Excel 2007, 2010, and 2013 -

Image
i sent excel sheet 4 charts. data charts in workbook not provided. goal: want extract data charts using vba sub. problem: having trouble "type mismatch." when try assign variant array oseries.xvalues range of cells. option explicit option base 1 ' 1. enter following macro code in module sheet. ' 2. select chart want extract underlying data values. ' 3. run getchartvalues sub. data chart placed in new worksheet named "chartname data". ' sub getchartvalues() ' dim lxnumberofrows long dim lynumberofrows long dim oseries series dim lcounter long dim oworksheet worksheet dim ochart chart dim xvalues() variant dim yvalues() variant dim xdestination range dim ydestination range set ochart = activechart ' if chart not active, exit if ochart nothing exit sub end if ' create worksheet storing data set oworksheet = activeworkbook.worksheets.add oworksheet.n

html - How can I avoid that JQuery reloads in Rails when clicking an option from a menu -

i have menu , has hover property. when click on selected option retains background color (example: red ). i notice when clicking option reloads again whole code , that's why background colour stays seconds until whole page reloads. code: css code: #menu { float:right; height: 100%; /*background-color: green;*/ } #menu-icon { display: none; height: 40px; width:100px; line-height: 40px; border-radius: 0 8px 0 0; margin:0; background: #fabb00; background: url("../images/menu_icon.png") center; text-align: center; color: #003d72; font-weight: 600; font-size: 1em; } #menu ul { margin: 0; padding: 0; } #menu ul li { display: inline-block; height: 60px; width:150px; line-height: 60px; margin: 0 10px 0 0; background: #eee; border-radius: 0 16px 0 16px; text-align: center; } #menu ul li.last { margin:0; } #menu ul li:hover{ background-color:#fabb00; } /*

javascript - A 'documentation coverage' of grunt-ngdocs -

to generate documentation of project use ng-docs: https://github.com/m7r/grunt-ngdocs i have report of elements (controllers, directives,...) not yet documented using grunt-ngdocs. ideally report added directly documentation, or in way locate files missing documentation. such grunt task or plugin exist?

objective c - Multiple UIAlertControllers in iOS -

in app there scenarios multiple alerts come. in ios8 uialertview turned uialertcontroller, not able show multiple alerts can not present 2 or more controllers @ same time. how can achieve using uialertcontroller? here method show multiple alertcontrollers : uialertcontroller *av = [uialertcontroller alertcontrollerwithtitle:title message:msg preferredstyle:uialertcontrollerstylealert]; uialertaction *cancelaction = [uialertaction actionwithtitle:kalertok style:uialertactionstylecancel handler:^(uialertaction *action) { }]; [av addaction:cancelaction]; uiwindow *alertwindow = [[uiwindow alloc]initwithframe:[uiscreen mainscreen].bounds]; alertwindow.rootviewcontroller = [[uiviewcontroller alloc]init]; alertwindow.windowlevel = ui

c# - Reacting mouse click event in viewModel instead of code behind -

i have wpf app list view set via viewmodel. i have code below handle mouse click on list view have read iot better handle in view model instead of code behind? i have code below xaml: <listview ... previewmouseleftbuttonup="listview_click"> ... code behind: private void listview_click(object sender, routedeventargs e) { var item = (sender listview).selecteditem; if (item != null) { ... } } i tried have code below there way move view model avoiding code behind completely? public void listview_click(object sender,routedeventargs e) { var item = (sender listview).selecteditem; if (item != null) { record record = item.datacontext record; if (record != null) { myviewmodel viewmodel = ((myviewmodel)this.datacontext); var result = viewmodel.performwork(record); } } } note: record listviewitem thanks, nick bind listview.selecteditem property propert

angularjs - PhoneGap build - Config.XML - REST CALL fails due to 'ConnectionError' -

i've built application using phonegap build using custom config.xml : <?xml version='1.0' encoding='utf-8'?> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.package" versioncode = "25" version = "1.0.1" > <name>test app</name> <description>test app</description> <icon src="res/img/icon.png" /> <icon src="res/img/icon.png" platform="android" density="ldpi" /> <icon src="res/img/icon.png" platform="android" density="mdpi" /> <icon src="res/img/icon.png" platform="android" density="hdpi" /> <icon src="res/img/icon.png" platform="android" density="xhdpi" /> <feature name="http://api.phonegap.com/1.0/network" />

How to write trigger in oracle to check for one specific condiition -

i have 1 table name user_count_details. there total 3 columns in table. msisdn=which uniquely defines row 1 specific user user_count= stores count of user. last_txn_id= stores last transfer id of txn user has performed. the user_count column of table user_count_details gets updated every transaction performed user. but here logic of system select sum(user_count ) user_count_details will gives 0 , considered system in stable state , fine. now want write trigger check first when new request update user_count come ,will hamper sum(user_count )=0 or not , if hampers msisdn details captured in separate update table. based on last comments, check if works. replace other_table_name per scenario. create trigger trgcheck_user_sum before insert on user_count_details each row begin if (select sum(user_count) user_count_details) > 0 insert other_table_name(msisdn) values(new.msisdn) end if end

javascript - Width of page in iframe -

i have parent page , inside parent page, there iframe around half size of parent page. the javascript in iframed page supposed size of iframed page , set size of text input, both javascript's document.body.clientwidth , jquery's $(document).width() returning parent page's width. how width of iframed page scripts inside iframe (that is, without having send iframe width parent page iframe page querystrings)? cross-domain too. simply use - <iframe src="demo_iframe.htm" width="200" height="200"></iframe>

windows 7 x64 - How to add 64 bit target platform in Delphi XE8? -

the files right click on target platform in project manager , select "add platform", when "add platform" item greyed out. is there way add 64 bit platform? this happen when migrating projects previous versions of delphi. try deleting dproj file , open dpr file. way handles upgrade process. if not, need create new project , add existing source files it. or can try editing dproj file enable win64 platform. <project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <propertygroup> ... <targetedplatforms>3</targetedplatforms> ... </propertygroup> ... <propertygroup condition="('$(platform)'=='win64' , '$(base)'=='true') or '$(base_win64)'!=''"> <base_win64>true</base_win64> <cfgparent>base</cfgparent> <base>true</base> </propert

google chrome - Webstorm 10 won't run my HTML -

this code i'm using test webstorm, , when try run it, goes chrome , gives me 404 not found error. why this? <!doctype html> <html lang="en"> <head> <title>my webpage</title> </head> <body> <h1>heading</h1> <p>sample text</p> </body> </html>

python - Why wont this pickle? -

i trying run process multiprocessing, when starting thread pickler falls on , can't work out stopping pickling. i've tried commenting out socket code , message obj code, still not working - doing wrong? class transmitthread(process): def __init__(self, send_queue, reply_queue, control_pipe, recv_timeout=2, buffer_size=4096): """ init function called when thread created. function calls process class init function, , stores class vars. """ # call process class init process.__init__(self) # store class vars self.send_queue = send_queue self.reply_queue = reply_queue self.control_pipe = control_pipe self._recv_timeout = recv_timeout self._buffer_size = buffer_size def run(self): """ main function called when thread started. function loops forever, waiting send message in queu

sql server 2008 - how to carry over the sequence number from one table to another? -

i want create 2 tables, , want create common sequence id both tables. sequnce id should not duplicated in both tables. trying create using identity, dont know how carry on maximum id table 1 table 2. i using ms sql server 2008. i want 2 tables similar below, table 1: seq_id value1 value2 1 x y 2 b table 2: seq_id value1 value2 3 j 4 k l doesn't sequence object work ? think best solution in case, need try it. regards!

java - Wrong 2nd argument type found 'com.technology.computer.mit.ctechmit.Menu_pageFragment' required 'Android.app.Fragment' -

i have written code fragment replacement on click of send button. code shows error saying wrong 2nd argument type found 'com.technology.computer.mit.ctechmit.menu_pagefragment' required 'android.app.fragment' in below line under word 'newfragment' transaction.replace(r.id.fragment_container, newfragment); when searched solution online says extend fragmentactivity instead of extending fragment. if home_activity (one has no errors) shows many errors. can please suggest me solution this? below home_pagefragment in sendmessage method replaces menu_pagefragment on click of send method in layout: package com.technology.computer.mit.ctechmit; import android.app.fragmenttransaction; import android.support.v4.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; /** * placeholder fragment containing simple view. */ public class home_pagefragment extends fragment { pu

javascript - MVC 4 display/hide a textbox based on a checkbox check -

Image
new mvc--was never of front-end web developer (mostly backend), i'm not privy design on front-end. now, i'm trying use mvc without original webform knowledge...that being said, please give me pointers/links/good ideas on how handle following: i have textbox field want show/hide based on checkbox. have these fields in view @using (html.beginform()... should change attribute on text box in javascript or controller action? if use javascript, i'm having hard time getting values in beginform, if use controller action, i'm not sure how/what pass to/from in controller action. i using jquery if want manipulate dom. here example - view @using (html.beginform()) { @html.checkboxfor(model => model.mybooleanvalue) <br /> @html.textboxfor(model => model.mytextvalue) <br /> <input type="submit" value="submit" /> } <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.j

Opening iOS deep links from within the Facebook web view stopped working -

all of sudden deep links app stopped working within facebook web view work fine when open deep link within safari (or click share in web view , choose safari). i added necessary open graph tags resource , app links stated here: https://developers.facebook.com/docs/applinks/add-to-content has experienced same behaviour since new facebook app update? version: (34.0.0.36.265) i'm getting usual prompt if want leave facebook upon clicking nothing happens , device stays in facebook web view. checked scraper information on https://developers.facebook.com/tools/debug/og/object/ there no errors reported. here url/resource gets shared , routes deep link (server might need wake): https://www.qonnect-it.com/mexx any ideas? i'm having exact same issue latest facebook app update, seems on end rather on app (or mine). i suggest going https://www.facebook.com/help/186570224871049 , report problem can escalate issue quickly.

python - How can I check if a string only contains uppercase or lowercase letters? -

return true if , if there @ least 1 alphabetic character in s , alphabetic characters in s either uppercase or lowercase. def upper_lower(s): """ (str) -> bool >>> upper_lower('abc') true >>> upper_lower('abcxyz') false >>> upper_lower('xyz') true """ use re.match if re.match(r'(?:[a-z]+|[a-z]+)$', s): print("true") else: print("nah") we don't need add start of line anchor since re.match tries match beginning of string. so enters in if block if input string contains lowercase letters or uppercase letters.

node.js - How to access flag passed to npm script -

in package json created seed script uses mocha initialize environment , run bunch of database calls: "seed": "./node_modules/.bin/mocha seed/seed-bootstrap.js seed/seed.js" i want able pass flag specifies seed number determine how many of each object created run npm run script --seednum=10 and have 10 of each object created. i can't figure out how access value of seednum inside script. thought in process.argv not. process.argv seems contain contents of mocha.opts file. like so: npm run seed -- --seednum=4 as per https://docs.npmjs.com/cli/run-script apparently first -- used npm delimiter arguments intended npm , arguments thereafter intended script.

ios - Foundation crash report, no clue -

i have crash report crashlytics crash happening several times, don't know start one. thing able see form app appdelegate, , looks going wrong array should look? thread : crashed: com.apple.main-thread 0 libobjc.a.dylib 0x39720f46 objc_msgsend + 5 1 foundation 0x2bcec8e7 -[nsmutablerlearray replaceobjectsinrange:withobject:length:] + 370 2 foundation 0x2bd06b6b -[nsconcretemutableattributedstring addattribute:value:range:] + 266 3 uifoundation 0x36792d07 -[nsstringdrawingtextstorage addattribute:value:range:] + 50 4 uifoundation 0x3677ced7 -[nsmutableattributedstring(nsmutableattributedstringkitadditions) fixfontattributeinrange:] + 1738 5 uifoundation 0x3677c71b -[nsmutableattributedstring(nsmutableattributedstringkitadditions) fixattributesinrange:] + 186 6 uifoundation 0x36797c59 -[nstextstorage invalidateattributesinrange:] + 108 7 uifo

linux - how do you translate this ssh command into a ssh_config file? -

i trying translate ssh command ssh_config. equivalant of -l in ssh_config? thought localforward restuls getting not way. ssh command sudo ssh -i ~/.ssh/mysshkey -l 81:<ip1>:81 -l 9200:<ip1>:9200 user@myhost.domain.com ssh_config entry host logstash hostname <ip1> port 81 # forwardx11 yes localforward 81 <ip1>:81 localforward 9200 <ip1>:9200 user username identityfile ~/.ssh/mysshkey serveraliveinterval 30 serveralivecountmax 120 # loglevel debug3 host tunnel hostname database.example.com identityfile ~/.ssh/john.example.key localforward 9906 127.0.0.1:3306 user john equivalent of: ssh -f -n -l 9906:127.0.0.1:3306 john@database.example.com with new config in place can run: ssh -f -n tunnel source: http://nerderati.com/2011/03/17/si

ruby - Can't get access token for ExactOnline with OAuth -

i'm following oauth tutorial here access code in order authenticate api requests online accounting software exact online. however, i'm stuck @ step 3, use authorization code returned in step 2 obtain access token. here's i'm trying: require 'httparty' exact_client_id = '<redacted>' exact_client_secret = '<redacted>' exact_server_base_url = 'https://start.exactonline.nl' exact_auth_code = '<redacted>' response = httparty.post("#{exact_server_base_url}/api/oauth2/token", headers: {'content-type' => 'application/x-www-form-urlencoded'}, query: {code: exact_auth_code, redirect_uri: 'http://<redacted>.runscope.net/', grant_type: 'authorization_code', client_id: exact_client_id, client_secret: exact_client_secret}) puts response # => 'bad request' puts response.code # => 400 i don't understand why happening. when looking @ list of res

linux - Read multiple arguments per line from file and do arithmetic with shell script -

i have file called input.txt : a 1 2 b 3 4 each line of file means a=1*2=2 , b=3*4=12 ... want output such calculation file output.txt : a=2 b=12 and want use shell script calculate.sh finish task: #!/bin/bash while read name; $var1=$(echo $name | cut -f1) $var2=$(echo $name | cut -f2) $var3=$(echo $name | cut -f3) echo $var1=(expr $var2 * $var3) done and type: cat input.txt | ./calculate.sh > output.txt but approach doesn't work. how task done right? in bash can do: while read -r m n; printf "%s=%d\n" $a $((m*n)); done < input.txt > output.txt cat output.txt a=2 b=12

javascript - synchronizing scrolling between 2 divs with different text size -

i can't find way synchronize 2 divs, same text, different text size , padding. have 2 divs, 1 markdown text, , other 1 html render of markdown , want synchronize scrolltop between divs. for example, stackedit.io you can see example of synchronizing 2 divs at: jsfiddle html given have 2 divs placed next each other horizontally. each of divs contain div , scrollable vertically: <div class="outer" id="div1"> <div> </div> </div> <div class="outer" id="div2"> <div> </div> </div> css this make 2 outer divs lie next each other @ same baseline , make scrollable vertically. div.outer { display:inline-block; width:150px; height:320px; border:1px solid black; overflow-y:auto; } div.outer > div { width:100%; height:3000px; } javascript the simplest approach is, bind scroll event each of outer divs, take scrolltop value , apply

javascript - initial window.orientation always 0 on Windows Phone -

i'm trying detect device orientation on website. orientation value seems ok after orientationchange event. $(window).on("orientationchange",function(event){alert(window.orientation);}) however problem initial window.orientation value @ page startup 0 when device in landscape position. $(document).ready(function(){alert(window.orientation);}); it doesn't change after delay (i've checked that) changes right value after orientationchange event. is there way proper orientation @ page startup? it looks property isn't supported in other chrome android: https://developer.mozilla.org/en-us/docs/web/api/screen/orientation depending on want use css rules? @media screen , (max-width: 999px) { /* rules apply canvases narrower 1000px */ } @media screen , (device-width: 768px) , (orientation: landscape) { /* rules ipad in landscape orientation */ } @media screen , (min-device-width: 320px) , (max-device-width: 480px) { /* iphone,

java - When to use GSON to parse object? -

i trying pass array list of objects 1 activity another. have seen people use gson library serialize objects, , have seen people make object implement parceable interface, or serializable interface. curious technical difference/advantages of using 1 on other is. please note, not meant opinion-based question, more of technical inquiry. thanks in advance. parcelable android-specific recommended way data 1 activity another. see how pass data between activities in android application? specifics of how passing. now if implementing cross-platform application, or if needed send same model web service, might beneficial use json serialization format. serializable used if cross-platform jvm languages. said implement both interfaces , use best method each application. json on network , parcels between activities. in general when choosing serialization method, should consider qualities you're looking for. qualities like: maintainability network size serialization/des

c# - How to access one WCF service from another? -

actually having 2 service, service , service b. trying call service service b (like said got proxy classes , calling). problem when access service "postman rest client packaged app" or "mobile" not working. client("postman rest client packaged app" or "mobile") service calling fine service can't call service b.(the remote server returned unexpected response: (400) bad request). if try access service using dll in console application , calling service a. time service can call service b working fine. service a: [servicecontract] public interface iuserprofilefacedservice { [webinvoke(method = "post", responseformat = webmessageformat.json, requestformat = webmessageformat.json, bodystyle = webmessagebodystyle.wrapped, uritemplate = "getresult")] string getresult(int64 userid,string str1,string str2,string str3); } public class servicea : basefacedservice, iservicea { p

javascript - jquery toggle only one item -

i try add jquery script toggle footer columns, problem how can make stop toggling items. when click on h4 tags h4 tags toggle together. html: <div class="row footer-cols"> <div class="col-sm-7 five-three"> <div class="row"> <div class="col-sm-4"> <h4>information<span class="toggle"></span></h4> <div class="footer-cols-content"> <ul> <li><a href="#">about us</a></li> <li><a href="#">customer service</a></li> <li><a href="#">privacy policy</a></li> </ul> </div> </div> <div class="col-sm-4"> <h4>why buy

javascript - Activate tab based on day of the week -

i have searched forum related threads, solution came across not work. i use bootstrap display tabgroup 2 tabs. need tab 1 automatically active monday friday , tab #2 active saturday sunday. here's html: <ul class="cat_filter nav nav-tabs right" role="tablist"> <li role="presentation" class="active"><a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab">tab #1</a></li> <li role="presentation"><a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab">tab #2</a></li> </ul> <div class="tab-content"> <div id="tab1" role="tabpanel" class="tab-pane fade in active woocommerce">some content</div> <div id="tab2" role="tabpanel" class="tab-pane fade woocommerce">some c

javascript - Can comments come before `use strict;`? -

i've seen few places around internet passively stating 'use strict;' must come on first line of functional scope want behavioral directive apply. however, in experience, doesn't matter if there comments before it. /* comment */ 'use strict'; is there functional deficiency having comments come before directive, or purely matter of style? defined anywhere in ecmascript specification? i'm asking not v8 (node.js) environments, browsers well. yes can add comments before "use strict"; --it must appear before statements . see example mdn // whole-script strict mode syntax "use strict"; var v = "hi! i'm strict mode script!";

How to obtain current user metadata in Clojure Friend? -

i using friend library. need provide request handler return user roles (and possibly other metadata) logged in user. i've added simple request handler: (get "/userinfo.do" request (friend/identity request)) but returns nil . proper way of fetching user session data? this worked: (get "/userinfo.do" request (json/write-str (friend/current-authentication)))

sql server - complex sql query many to many -

Image
i've been created database that: i want select person , movie names same person act "oyuncu" , "senarist" please me. wrote query that; select moviename,personname,rolename movies, moviespersonrole, personrole, person, role movies.id = moviespersonrole.movieid , personrole.id = moviespersonrole.personroleid , personrole.roleid = role.id , personrole.personid = person.id and results are moviename personname rolename pulp fiction mehmet oyuncu pulp fiction mehmet senarist matrix aylin oyuncu lotr gökberk oyuncu lotr gökberk senarist pulp fiction aylin oyuncu you can try somethong this: select x.moviename, x.personname ( select m.moviename, pe.personname, count(*) rolecount movies m inner join moviespersonrole mpr on (mpr.movieid=m.id) inner join personrol

javascript - Toggle background color of list on click react.js -

i trying create list has following features. on hover change background color of listitem. on click change background color of listitem. toggle background color between clicked elements.[i.e. 1 element in list can have clicked property] i have executed onhover 1 , 2 features, not able implement 3rd feature. please me solve problem. thanks in advance. /** @jsx react.dom */ 'use strict' var react = require('react') var listitem = react.createclass({ getinitialstate: function() { return {hover_flag: false, click_flag: false} }, hoverevent: function() { this.setstate({hover_flag: !this.state.hover_flag}) }, clickevent: function(){ this.setstate({click_flag: true}) }, render: function() { var listyle = { /* more class properties */ background: '#cc181e', } if(this.state.hov

c++ - Rotation performed correctly only when Model-View-Projection multiplication is performed on the shader -

i'm using glm opengl 3.3. have code setup draw shape , using glm create projection, view , model matrices so: glm::mat4 view = glm::lookat( glm::vec3(1.2f, 1.2f, 1.2f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f) ); glm::mat4 proj = glm::perspective(glm::radians(45.0f), 800.0f / 600.0f, 1.0f, 10.0f); glm::mat4 model; // during main loop model = glm::rotate(model, time*glm::radians(180.0f), glm::vec3(0.0f, 0.0f, 1.0f)); and sending them shader with: gluniformmatrix4fv(mvp, 1, gl_true, glm::value_ptr(proj * view * model)); and in vertex shader: gl_position = mvp * vec4(position, 0.0, 1.0); but shape not displayed correcly, not rotating around center should, instead translated bit center , it's rotating around middle of screen. though if send 3 matrices shader uniforms , perform calculation position there: gl_position = model * view * projection * vec4(position, 0.0, 1.0); it work expected. tried possible combinations pr

c - OpenSSL AES_cbc_encrypt vs EVP interfaces -

i need encrypt long lived network data streams using aes-cbc. thinking call evp_encryptinit_ex() once , save e vp_cipher_ctx subsequent calls evp_encryptupdate . likewise on decrypt end. first problem discovered evp_decryptupdate 1 block behind. e.g., if encrypt 32 bytes, 1st decrypt update return 16, though know has decrypted 32 bytes. guess means need call evp_decryptfinal after every evp_decryptupdate , , evp_encryptinit_ex() reset iv before next update. a second concern may have many 1000's of these streams, , trying minimize memory footprint. sizeof(evp_cipher_ctx) 168 bytes, if query memory usage before , after 1000 calls evp_encryptinit_ex() , looks allocates additional 412 bytes per context (this on top of 20k after first call). correction, see 412 bytes per ctx not 168 + 412 the aes_cbc_encrypt() interface looks better needs. there fixed 260 byte aes_key structure, plus need maintain 16 byte iv myself. however, understand, not use aes-ni intel hardwa