Posts

Showing posts from April, 2014

Writing to linux tty (/dev/) files in c# -

i need program execute command in bash this: "echo p1-12=175 > /dev/servoblaster". how do in mono/c# on linux? wrote following class: public static class servoblasterpwm { private static filestream devfile; public static bool isrunning { get; private set; } public static bool initialize() { try { devfile = file.open("/dev/servoblaster", filemode.open); } catch (exception e) { log.error("error while setting port servo blaster: " + e.message); return false; } log.success("servoblaster set up."); isrunning = true; return true; } public static void setpwmoutput(int pin, int valuesteps) { //byte[] bytes = encoding.ascii.getbytes("p1-" + pin.tostring() + "=" + valuesteps.tostring()); byte[] bytes = encoding.ascii.getbytes("p1-12=175")...

include - How to make CLion use "#pragma once" instead of "ifndef ... def ..." by default for new header files? -

by default, clion add following lines newly created header file: #ifndef some_name_h #define some_name_h .... code here #endif //some_name_h but #pragma once more. how can configure clion uses #pragma once default new header files? go file-> settings -> editor -> file , code templates . find there 3 tabs, namely, templates , includes , , code . under templates choose example c header file . insert #pragma once replace content. every time add new header project menu have template.

php - Nexmo voice call not working -

i have tried execute text speech api in nexmo error: $phoneno = "checkthisout"; $params = "api_key=xxxx&api_secret=xxxxx&to=xxxxx&from=xxxxxx&text=".$phoneno; $url = 'https://api.nexmo.com/tts/json?'; . http_build_query($params); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true); $response = curl_exec($ch); print_r($response); but got new error {"status":"2","error_text":"missing username"} done per url : https://nexmo.github.io/quickstarts/tts/ . i have checked document. don't see such error text. me please? as marc mentioned, expects array parameters, rather string $params = [ 'api_key' => xxxxx, 'api_secret' => xxxxx, 'to' => your_number, 'from' => nexmo_number, 'text' => 'checkthisout', ]; $url = 'https://api.nexmo.com/tts/json?' . http_build_query($...

multithreading - Periodically dump the content of a map to a file in java -

i have 2 json files contain on 1 million objects . i have compare each object both files , write file if there diff object. (each object identified key , key written file). currently using executorservice , doing comparisons using multiple threads , writing mismatches common concurrenthashmap. the map dumped file in end . i update file periodically rather waiting entire execution complete. in case if wish write file once in every 2 minutes, how can achieve this. i familiar done using thread not understand how implement along executorservice. scheduledexecutorservice executor = executors.newsinglethreadscheduledexecutor(); executor.scheduleatfixedrate(() -> { // code execute every 2 minutes }, 0, 2, timeunit.minutes);

javascript - React.js variable -

this question has answer here: reactjs component names must begin capital letters? 4 answers when use variable starting small letter, page showing nothing. if change variable name start uppercase (helloworld) page showing content. <script type="text/jsx"> var helloworld = react.createclass({ render : function () { return ( <div> <h1>hello world</h1> </div> ); } }); react.render(<helloworld/> , document.body); </script> can tell me why happening? as of react v0.12., upper-case components react convention distinguishing between components , html tags. from react documentation under html tags vs. react components header: to render react component, create local variable starts upper-case l...

php - JS/jQuery security -

as beginner, i'm wondering if i'm doing secure. example, finished working on code checks how many times (cross-domain) iframe has been clicked. , when clicked, inserting row mysql (log) table based on ajax request(with jquery) wraps id of iframe $_post: $.ajax({ url: 'execute.php', data: {action: 'some-id'}, type: 'post' }); however i'm wondering: because javascript executed client-side, possible user send fake data through ajax request 'execute.php' page? is possible user send fake data through ajax request 'execute.php' page? yes.

symfony - How to embed radio form field in another radio field -

i'm trying following form: field #1 radio 1 radio 2 radio 3 radio 3.1 radio 3.2 ... radio 4 radio 4.1 radio 4.2 ... when choose radio 3, list of radios show , i'll have choose 1 of children. possible manage kind of form field (i'm talking symfony part, not view , javascript event showing div etc.)? if yes, how? i think problem similar depenend form. idea create listener or subscriber , attach in pre_set_data , submit form event create other list depend of first radio button checked. maybe can follow this post idea.

c++ - Maximum heap (program?) size -

i need take in , process large image buffers program i'm writing, ran few quick tests see approximately maximum amount of heap storage can use program. running below code produces no errors. uint64_t sz = 1; sz <<= 30; uint8_t *test = new uint8_t[sz]; std::cout << "size " << sz << " bytes.\n"; delete[] test; however, if left shift sz 31 instead of 30, or if create 2 test arrays above size, receive std::bad_alloc exception. this seems indicate can use maximum of ~1gb of heap space, despite having 64 bit system 8gb of ram. there reason this? alterable value? tags indicate, i'm runnings windows , using visual studio. ideally, i'd load of buffer ram possible without incurring swapping. (as aside, on mac running yosemite, can not allocate amount of heap storage, can write in short increments force actually allocated (not set aside malloc) , subsequently read it. activity monitor reports 1, 2, 4, 8, 16... gb of ram in use...

email - Cron PHP Code Fails to Run on Magento and Produces Error -

so inherited product reviews module. cron runs every 6 hours. checks when send email out, has not been working of late. here's config.xml file part containing crontab. crontab node placed within . <crontab> <jobs> <company_reviews_delay> <schedule> <cron_expr>* * * * *</cron_expr><!-- every 6 hours --> </schedule> <run> <model>reviews/adminhtml_observer::delaysend</model> </run> </company_reviews_delay> </jobs> </crontab> the php file delaysend method in reviews/model/adminhtml/observer.php here's code it public function delaysend() { $error_counter = 0; $unsent_notifications = $this->getnotificationcollection()->addfieldtofilter('notified', array('lt' => 1)); foreach($unsent_notifications $notification){ try{ $order =...

wpf - Set focus to another element with default button event? -

i have tried following: <button isdefault="true" content="process test file" focusmanager.focusedelement="{binding elementname=txtclientid}" command="{binding processfilecommand, updatesourcetrigger=propertychanged}"> </button> i have button set default. so, when user hits enter key processes command, doesn't set focus asked. however, when clicked mouse set focus. i'm sure there's got easy way setting focus work default action too. do focusing in button's click event. it'll called when press enter, too. <button isdefault="true" content="process test file" command="{binding processfilecommand, updatesourcetrigger=propertychanged}" click="button_click"> </button> then, in code-behind: private void button_click(object sender, routedeventargs e) { keyboard.focus(txtclientid); }

.net - How to remove XML declaration from web request -

we're trying talk web server (possibly jboss) choking on request generated .net. if manually create soap, works, not want -- have every method in wsdl. real difference presence of xml declaration. trouble is, cannot figure out how rid of that. i'm not able modify request stream. can offer advice? public partial class customclient : generatedclient { protected override webrequest getwebrequest(uri uri) { var webrequest = base.getwebrequest(uri); webrequest.method = "post"; var requeststream = webrequest.getrequeststream(); // next line cannot execute -- stream not readable. var soapenvelope = new streamreader(requeststream).readtoend(); good request (manually created): post https://remotewebserver.org/productname/service http/1.1 authorization: basic biglongbase64 soapaction: "" content-type: text/xml; charset=utf-8 host: remotewebserver.org content-length: 378 expect: 100-continue connection: keep-alive <soapenv:envelope> ...

c# - Extracting parts of string with specific limits -

i have small problem. string has following format; {"version":"5.14.1","id":"abcd","key":"266",...... etc i want abcd after "id" , have tried i tried string[] output; output = regex.matches(site,"(?<=(?:\"id\")\:\")([^\"]+)").cast<match>().select(m => m.value).toarray(); but when try compile says "unrecognized escape sequence" colon after id. the regex expression used worked is: (?<=(?:"id")\:")([^"]+) but i'm not sure how put inside regex.matches (i tried put \ before " says unrecognized escape sequence) the regex error right -- : not special character within regular expression (except contextually in e.g. (?:) groups), can't escaped. (note there's 2 levels of escaping going on here: when \: seen within c# string, c# compiler decides : isn't special , silently leaves literal backslash prec...

javascript - Linking from page A to a specific iframe on page B -

i'm in process of setting website showcase our photographs. for using third party supplier providing gallery: http://gallery.wisejam.com/index.html . however, in order keep visitors on our own website, have set gallery on page iframe: http://wisejam.com/gallery-2/ up here, works fine. now, cannot go further when wish deep link post/page photograph open in iframe. it works long visitor on page (gallery-2) following code... <a href="http://gallery.wisejam.com/featured/distortion-clear-waters-robert-schaelike.html" target="iframe_a">distortion</a> however, i'm trying achieve internal links display in iframe of 'gallery-2', not have send them artists' page. wish keep visitors us! i'm sorry if simple question ask i'm not professional programmer. many input , help! you write : target="iframe_a" photos go frame named : name="iframe_a" . please check . if upload full code able gi...

ruby on rails 4 - In active admin is it possible to create a dynamic confirm message to a batch action? -

activeadmin's page says can have dynamic form passing proc http://activeadmin.info/docs/9-batch-actions.html ... want use dynamic confirm message. ideas? for example... if i'd list selected ids in confirm message-- or more i'd list column of selected active record object.

Python hangman game. Python 3 -

i trying create simple hangman game using python. have faced problem can't solve , grateful receive tips guys. okay provide sample of code , below explain issue is: # here list of words words = ['eight', 'nine', 'seven'...] # choosing random word list word = random.choice(words) # creating empty list store result secret_word = [] # creating count variable use later determinate if player wins count = 1 letter in word: secret_word.append('_') secret_word[0] = word[0] user_guess = input("enter letter: ") # here if user guesses letter # place letter on spot in our secret_word while user_guess: if user_guess in word: print("correct letter.") # adding 1 count every guessed letter count += 1 # replacing '_' letter letter in range(len(word)): if user_guess == word[letter]: secret_word[letter] = word[letter] # here checking if user has...

swift - How to access a method in SKScene From UIViewController -

i show uialertcontroller() using nsnotificationcenter skscene . then when 1 of options clicked execute method in skscene() . method add node, if use let s = gamescene() s.methodname() this doesnt use current reference, creat new scene , node not added if pass scene when sending notification so nsnotificationcenter.defaultcenter().postnotificationname("detectnot", object: self); after given option chosen , method execute gives error, there no info error send notification this nsnotificationcenter.defaultcenter().postnotificationname("detectnot", object: self); in uiviewcontroller method let _scene = notification.object as! gamescene then can access method

ios - Mantle - Transform String to Enum Value -

in user class, have defined type property , usertype enum. type property received string value in json: { "type" : "admin" } i use mantle transform string value usertype enum object , string during serialization , de-serialization, respectively. have searched through other posts , mantle documentation not working properly. here's attempt: enum usertype:string { case normal case admin } class user: mtlmodel, mtljsonserializing { var type:usertype? static func jsonkeypathsbypropertykey() -> [nsobject : anyobject]! { return ["type" : "type"] } static func jsontransformerforkey(key: string!) -> nsvaluetransformer! { if (key == "type") { return nsvaluetransformer(forname: "usertypevaluetransformer") } return nil } } // custom transformer class usertypevaluetransformer : nsvaluetransformer { override func...

cross browser - Is it safe to use calc in CSS? -

this data caniuse http://caniuse.com/#feat=calc suggests practically browsers support calc in css. there reasons still avoid using calc consumer websites? have major websites started using calc ? the official level candidate recommendation w3c , descripted in draft document css values , units module level 3 candidate recomendation not approved near, (i think) 'a choice comforted state of documentation of w3c

Facebook Graph API explorer and missing read_stream permission -

i'm trying test me/home api complains missing permission: (#200) requires extended permission: read_stream the problem access token / extended permissions window not have such entry. have: ads_management ads_read email manage_pages publish_actions publish_pages read_custom_friendlists read_insights read_page_mailboxes rsvp_event how can play api in explorer ? read_stream deprecated, try user_posts instead. changelog: https://developers.facebook.com/docs/apps/changelog#v2_4_deprecations

How can I parse a Java proberty file with PHP? -

oi have java proberties file looks more or less this: fd6aea14b3581255c5d40451cdff8168.hash=90ad759ff0b41abd7260ef1044e75330 fd6aea14b3581255c5d40451cdff8168.path=volumes/ua08154711/08154711/lorem ipsum dolor sit amet, consetetur sadipscing/lorem ipsum dolor sit amet, consetetur sadipscing/07 - lorem ipsum dolor sit amet, consetetur sadipscing - lorem ipsum dolor sit amet, consetetur sadipscing (album version).mp3 ea3f9134319e314bc85d59d16122800.filename=04 - lorem ipsum dolor sit amet, consetetur sadipscing (album version).mp3 ea3f9134319e314bc85d59d16122800.hash=88302129514633aaed4553f1b0ccb6b8 ea3f9134319e314bc85d59d16122800.path=volumes/ua08154711/08154711/lorem ipsum dolor sit amet, consetetur sadipscing/lorem ipsum dolor sit amet, consetetur sadipscing/04 - lorem ipsum dolor sit amet, consetetur sadipscing (album version).mp3 eafb12ee4094d48a2b1bd367e5737c80.filename=._02 - lorem ipsum dolor sit amet, consetetur sadipscing (explicit version).mp3 eafb12ee4094d48a2b1bd367e573...

android - What do I need to update, to get the latest recyclerview methods? -

according docs, latest recyclerview has addonscrolllistener , yet in android studio method doesn't show up, instead shows deprechiated setonscrolllistener method, no sign of being depreciated. any on need update appreciated. make sure you're using support.v7 recyclerview import android.support.v7.widget.recyclerview; and in build.grade compile 'com.android.support:recyclerview-v7:22.2.0'

postgresql - How to convert a word in regex uppercase and lowercase? -

i working postgres db , need convert text regex accepts uppercase , lowercase in letter, example: transform palaver "word" in [ww] [oo] [rr] [dd] i trying unsuccessfully command: select regexp_replace ('word', '[a-za-z]', '[ww]', 'gi'); i not bother adding character classes per each letter, , use inline modifier (?i) : select regexp_replace ('word', '^', '(?i)'); see sqlfiddle

powershell - Why does the script output itself to the console? -

Image
my script outputs console before executing script. code: for ($i=1; $i -le 1000; $i++) { write-host "sending request #$i" $request = invoke-webrequest "http://localhost/test" $random = get-random -minimum 1 -maximum 5 start-sleep -seconds $random } which in powershell ise: what doing wrong , how fix it? this happens when use powershell ise , run script without saving it. essentially copies whole script console , executes there. once save file, switch calling file , won't display whole script. you can see first hand if execution policy set not execute scripts, because you'll able run script before saving not after (until change execution policy).

javascript - Button action is not posting the form data to Controller in play framework -

i have written jquery function opening form in modal dialog. i have added button , when user performs action on button calling controller. but form data not getting posted in controller. please let me know if had missed anything. below code. html: <div id='rejectjobdialog' title='alert: reject job'> <form method="post" enctype="multipart/form-data"> <label>jobid</label> <input lang="en" id='jobid' type="text"></input> <br> <b>why want reject this?</b> <textarea lang="en" id='comments' name='comments' cols="40" rows="5"></textarea> <br> </form> </div> js: $(function() { $("#rejectjobdialog").dialog({ autoopen: false, modal: true, title: 'you reject job', width: 400, he...

how can I give client limited permissions to azure file storage? -

using windows azure blob storage , providing access via url shared access signature going great upload files local drive client side. how can same azure file storage give client access it? azure file storage service not designed provide external users access files. it's primary purpose act file share cloud services , virtual machines running in azure. you should use azure blob storage , shared access signatures share files external users.

node.js - 'cmd' - not able to get the `grunt` version -

i have installed grunt using command : npm install -g grunt-cli after installed trying fetch grunt version using command : grunt --version - not getting output. issue here? require set env variable or something? please me. you need install grunt globally admin. grunt docs recommend use sudo when installing. recommended grunt or gulp plugins installing globally. run same command npm install -g grunt-cli in admin command line try grunt --version once more. i'd recommend posting separate question grunt processing involves more functionality. example on sample gruntfile can found @ sample gruntfile , includes processing js , html files various tasks. let me know if helps. thanks!

html - How to add javascript to JBrowse after everything has loaded -

i'm trying add script tag body of index.html in jbrowse 11.5. want executed after has loaded. css, asynchronously loaded tracks , on. i've tried domready! , dom/ready triggered early. know how add script after has loaded? it might depend on mean "everything being loaded", try couple different methods. for example, in index.html might write this jbrowse.aftermilestone('initview', function() { // add code inject script here }) you can add arbitrary javascript there, include new amd modules, or use other code injection type method e.g. inject script tag remote src , wait execute alternatively, check out plugin architecture jbrowse, way include new code modules

bash - Script that monitors log file quits unexpectedly -

i've written simple script monitors elasticsearch.log looking specific pattern , sending curl post request. #!/bin/bash tail -f -n 0 elasticsearch.log | \ while read -r line echo "$line" | grep '<pattern>' if [[ "$?" -eq 0 ]] curl -x post <url> fi done the problem script quits unexpectedly 0 exit status. have idea might reason?

php - Laravel 5: sorting child records -

it not sort child records. have field in db called order here code: $offer = offer::find($id); $offer->service->sortby('order', true); return $offer; although array of services if use sortby, without there json data. any ideas why not sort? thank in advance. if need code, please let me know. the second parameter of sortby not true / false , it's int $options = sort_regular . laravel doesn't know make of true value.

wordpress - Have pre defined menus when developing a theme -

Image
i trying develop theme customizable menus, header menu options , footer menu options. in theme menu page right now, in "select menu edit" there 2 menus editable , because manually added 2nd menu. in theme trying make similar to, there tons of pre made menus in "select menu edit" , did not add of those. how can add pre defined selectable menu options theme? like footer have 4 different parts, header have part etc.. i want more menus here i know how add more here! to create new menu location , menu, add code functions.php file: add_action( 'after_setup_theme', 'register_my_menu' ); function register_my_menu() { register_nav_menu( 'header_menu', 'menu header' ); // change desired menu name $menu_header = wp_create_nav_menu('main menu'); if($menu_header > 0) { // set new menu location set_theme_mod( 'nav_menu_locations' , array( 'header_menu' => $menu_header )...

c# - Securely Sending Sensitive Information to RESTful Service -

so i've searched , tried piece various information i've found, , apologize if information does exist somewhere else. not being security professional want make sure correctly not introduce crazy security flaw. i'm developing restful service in c# hosted on azure allow users login username , password , subsequent calls service associated user. first client of service going web app communicates via javascript service (not sure if makes different). so here's i've sort of come workflow: user lands on site user enters username , password information sent service this have least amount of detail service authenticates user credentials service returns token used subsequent service calls i've read ssl , know azure supports ssl certificates, i'm not 100% sure it's i'm looking for. having ssl cert , using https, make okay send plain-text user information service? doesn't sound right. if not, else need able securely send (and potentially...

Python Namespace package as extension to existing package -

is possible add namespace/path of existing package not namespace package? lets have extisting external package named package . i use in project.py this: from package.module import class is possible create package called extension namespace of package importable package.extension ? from package.module import class package.extension.module import extensionclass is possible install both packages using pip / setuptools without adding monkey patches project.py in want import both package , package.extension ? partial solution i've been able achieve need in 2 ways: modifying original package , monkey patching in project.py structure: ./test.py ./demo/test.py ./demo/__init__.py ./extension/demo/__init__.py ./extension/demo/extension/test.py ./extension/demo/extension/__init__.py ./extension/__init__.py contents of ./test.py : import demo.test demo.test.hello() import demo.extension.test demo.extension.test.hello() partial solution 1 - modify origina...

Cocoa NSBundle loadNibNamed deprecated -

i'm developing cocoa app , noticed nsbundle loadnibnamed deprecated. i'm trying use sheet show config options. i'm using appcontroller , config sheet nib created separately. this code. - (ibaction)showconfig:(id)sender{ if (!_config) { [nsbundle loadnibnamed:@"config" owner:self]; } [nsapp beginsheet:self.config modalforwindow:[[nsapp delegate] window] modaldelegate:self didendselector:null contextinfo:null]; } using code, config sheet opens , closes perfectly. when switch [nsbundle loadnibnamed:@"config" owner:self]; [[nsbundle mainbundle] loadnibnamed:@"config" owner:self toplevelobjects:nil]; config sheet still works fine. my real problem when want close it. app crashes throwing error: thread 1:exc_bad_access (code=exc_i386_gpflt) this ibaction close config sheet. - (ibaction)closeconfig:(id)sender{ [nsapp endsheet:self.config]; [self.config close]; self.config = nil; } once skip deprecated ...

c# - Controller's action with dictionary as parameter stripping to dot -

Image
i have action receives class dictionary in properties: public actionresult testaction(testclass testclass) { return view(); } public class testclass { public dictionary<string, string> keyvalues { get; set; } } if post action following json: { "keyvalues": { "test.withdot": "testwithdot" } } the key in dictionary stripped dot , has nothing in value. trying without dot works. how can post dot in dictionary<string, string> mvc? we gave blind try supposing there regex parser somewhere in deep (well minimal chance) , escape 'dot'. after thinking while concluded: dot not legal char in identifiers. yes know key in c# dictionary, in json part (and javascript) in identifier syntax role. so suggest replace client side . (dot) escape sequence _dot_ , replace in server side. performance suffer of course.

database - Autopopulate a field in a form based on what user is logged in -

i've created access database using access 2007 1 of teams work , i'm new access help. database being used log jobs engineers have login system user selects name drop down , enters password, , depending on access levels directed own user menus etc. once user has logged in click on job sheet button direct them list of jobs raised here click on new , pop of job sheet can enter details call pops want in job sheet name auto-populate in field labelled user, how user has logged in name auto populate in field once have accessed it. you might want check out "onload" property of form. go properties section of job sheet , click on "on load" event. select vba code. type following:- me. fieldname = [forms]![ firstformwherelogindropdownpresent ]. dropdownname .value hope helps

java - Bubble Sort Parallel Array -

i need read , load data file 2 arrays (1 parallel). data consists of list of 100 integers (id#) correspond double(price) this: [id] - [price] 837 - 14.88 253 - 65.12 931 - 11.96 196 - 20.47 i need use bubblesort() method arrange id's(and corresponding price) in descending order. lastly, need use binary and sequential search methods locate specific target display. my issue - when run program sequential search successful, binary search not. have pasted code below in hopes come rescue. public class storeinventory { public int[] storeitem = new int[200]; public double[] itemprice = new double[200]; public int itemcount = 0; storeinventory() {} public void loaditems() { try { string filename = "masterstoreinv.dat"; scanner infile = new scanner(new fileinputstream(filename)); while (infile.hasnext()) { storeitem[itemcount] = infile.nextint(); ...

asp.net mvc - #if DEBUG returns true on production server -

we have following code on global.asax of mvc web application protected void application_beginrequest() { #if debug if (!string.isnullorempty(httpcontext.current.request["debug"])) { routedebug.routedebugger.rewriteroutesfortesting(routetable.routes); } #endif } the "compilation debug" atribute set "false" in web.config of production server. expected behavior above code never executed . works of time, of sudden app starting execute code. continue until iis reset. can't seem figure out why of sudden our website goes debug mode automatically. idea? the #if debug line compiler directive , can called if debug constant has been defined manually in code or specified in build (which set in project properties. the web.config compilation value of debug="true" different thing. determine if has been set, can use instead: var compilation = (compilat...

javascript - Continuous AJAX requests increasing resource count and size -

Image
i need perform semi-continuous ajax requests display data based on latest entry db. works fine setinterval() notice continuously increasing number of resources , size in web inspector (see image). imagine may become issue if app open long periods of time? or size displayed (1) merely network activity? how prevent this? have set jquery ajax cache false. update: did not post code because there's nothing special there. basic jquery ajax function, php script queries db based on data ajax function , echoes in response. so number of kb in web inspector (1) network traffic or cached? $(document).ready(function(){ setinterval(refresh, 2000); }) function refresh(){ $.ajax({ type: "post", cache: false, url: "../update.php", data: datastring, success: function(msg){ if(msg2 == 'same'){ // nothing }else{ $('#result').html(msg); } } }) }

ruby on rails - Upload only few KB's of large file -

on rails app have file fields , text fields url of remote server files, these file can large in size ( 1-2 gb ) want upload few kb's check initials of files. i have installed paperclip not sure if can done this. i tried custom code uploading complete files. also looked blueimp jquery upload not sure how for. following requirement in detail app has form file fields , text fields remote file urls ( upload server ), when user clicks on check button files ( few kbs ) should downloaded, run function check files , remove invalid files , run function upload complete files. it there tutorial or method or gem type of requirement ?

jQuery vertical Navigation -

i try adapt solution i've found on net. works in example. adaption doesn't work. hope can me. in example i've found - there possible click li element , opens next ul (submenu). if click li element in same level (and if has subnavigation points) shows ul there , close ul open before. , on. in variation try adapt example - click on plus (a href="#") in js script , can't see same effect in example. the example i've found: http://jsfiddle.net/jtbowden/wgvum/ and adaption-try is: $(function() { $('#resmenu').on('click', 'a[href="#"]', function() { $('#resmenu ul').hide(); var submenu = $(this).next('ul'); submenu.parentsuntil('#resmenu').andself().show(); }); }); .topresponsive { height: 50px; line-height: 50px; } /* mainmenu */ nav { font-size: 14px; border: 1px solid #ffffff; } nav ul { list-style-type: none; ...

PHPMailer - sending image in html -

i want send html email image using phpmailer (not attachement, image in email content, using link image). when sending html message, in mailboxes text visible, image not (user has click button "show images" etc., , image appears). can help? my code: require_once('class.phpmailer.php'); require_once('class.smtp.php'); $mail = new phpmailer(); $mail->from = "mymail@domain.com"; $mail->fromname = "mymail"; $mail->addreplyto("mymail@domain.com", "mymail"); $mail->charset = 'utf-8'; $mail->issmtp(); $mail->host = "mail.domain.com"; $mail->mailer = "smtp"; $mail->smtpauth = true; $mail->username = "xxx"; $mail->password = "yyy"; $mail->port = 25; $mail->subject = "subject"; $mail->ishtml(true); $mail->body = $message; $mail->addaddress ($enduser, $enduser_name); ...

templates - C++ templated function overloading rules -

when overloading templated function, how should compiler chose version of function call if has option either: call templated version of function (such func<t>(foo) ). call overloaded version of function not templated type of parameter being passed function inherits type specified in overloaded function template. consider following c++ code: #include <stdio.h> struct parent {}; struct child : public parent {}; template <typename t> void func(t) { printf("func(t)\n"); } void func(parent) { printf("func(parent)\n"); } int main() { func(1); func(parent()); func(child()); } compiled gcc or clang, outputs: func(t) func(parent) func(t) the first 2 lines expected , make sense. however, in call func(child()) , call func(parent) (which seems like, if anything, should do). as such, have 2 main questions: what exact rules laid out standard how resolve such conflicts? there information in question/answer , if conflicts ...

Stop Jenkins build for specific job via REST -

how can stop jenkins build specific job? looking rest api i did not find such in documentation edit the tricky part need fetch running build id somehow can send http://hudson_url/job/jobname/buildnumber/stop

sql server - How to manage global temporary tables in SP run inside transaction? -

running sql server 2014 . have stored procedure need write data global temporary table. however, seems method object_id hangs when procedure called inside transaction. how remove deadlock without removing transaction? stored procedure: create procedure [dbo].[foo] @data [varbinary](max) encryption begin set nocount on if object_id('tempdb..##tempdata') null create table ##tempdata ( [id] [int] identity(1,1) not null, [data] [int] not null unique ) insert ##tempdata ([data]) select @data end go first connection: begin tran exec [foo] @data = 1 waitfor delay '00:00:20' commit tran drop table ##tempdata then in second connection: begin tran exec [foo] @data = 2 -- hang on call object_id()... commit tran update here c# code illustrates why need have transaction. var options = new transactionoptions(); // options.isolationlevel = isolationlevel.readcommitted; options.timeout = transa...

Android Butterknife strange behaviour -

i'm using butterknife library views injections in android app. successfuly binded button: @bind(r.id.btn_enter) button enterbutton; i can see on screen , interact with. onclick injection doesn't work: @onclick(r.id.btn_enter) public void lol() { log.d(tag, "clicked!"); toast.maketext(this, "lol!", toast.length_long).show(); } i checked possible solutions , no result. app running under debug configuration, proguard not reason. problem solved; forgot delete old call setonclicklistener() . sorry useless question.

Upgrading Lync to Skype for Business -

i attempting update lync 2013 (15.0.4420.1017) skype business. i have downloaded , installed following updates described here : lpksp2013-kb2817427-fullfile-x86-en-us.exe lynchelploc2013-kb2889853-fullfile-x86-glb.exe lync2013-kb3054946-fullfile-x86-glb.exe mso2013-kb3054853-fullfile-x86-glb.exe lyncmso2013-kb2889923-fullfile-x86-glb.exe the updates run successfully, lync isn't updating. what can next? the following update required: proplussp2013-kb2817430-fullfile-x86-en-us.exe found here .

HTML email, table rowspan wrong in Safari -

Image
im trying create email template, tables. td elements in safari has incorrect height when give rowspan. gave td's red border , div inside green border. see td's height big plunker: http://plnkr.co/j1yph9 <!doctype html> <html> <head> </head> <body> <div class="wrapper" style="width: 100%; height: 100%; color: rgb(51, 51, 51); font-family: arial,&amp; quot; helvetica neue&amp;quot; , helvetica ,sans-serif; font-size: 14px; font-weight: normal; letter-spacing: normal; text-align: left; background-color: rgb(255, 255, 255);"> <table style="padding: 0px; border: medium none; border-collapse: separate; background-color: rgb(232, 232, 232); height: 510px; width: 610px; margin: 0px auto; color: rgb(51, 51, 51); font-family: arial,&amp; quot; helvetica neue&amp;quot; , helvetica ,sans-serif; font-size: 14px; font-weight: normal; letter-spacing: normal; text-align:...