Posts

Showing posts from March, 2014

pip - editable npm package in my project -

in python, can pip install -e github-address install source , modify see change , commit repo. i 'd similar thing npm installed javascript github fork. how can setup javascript library (which installed via npm install ) can edit , commit? i'm trying fork repo , modify/commit https://github.com/intljusticemission/react-big-calendar find github page of npm project wish modify, fork it, clone , changes want to.

java - Sending Data to Kafka Producer -

i trying read 100k file , send kafka topic. here kafka code sends data kafka-console-consumer. when sending data receiving data java.util.stream.referencepipeline$head@e9e54c2 here sample single record data sending: 173|172686|548247079|837113012|0x548247079f|7|173|172686a|0|173|2059 22143|0|173|1|173|172686|||0|||7|0||7|||7|172686|allowallservices|?20161231:22143|548247079||0|173||172686|5:2266490827:dccinter;20160905152146;2784 any suggestion data had showned in above...thanks code: import java.io.bufferedreader; import java.io.filenotfoundexception; import java.io.filereader; import java.io.ioexception; import java.nio.file.files; import java.nio.file.paths; import java.util.properties; import java.util.properties; import java.util.concurrent.executionexception; import java.util.stream.stream; import kafka.javaapi.producer.producer; import kafka.producer.keyedmessage; import kafka.producer.producerconfig; @suppresswarnings("unused") public class hundredkr

java - SWT Create Two StyledText That Scroll In Tandem -

i have create 2 styledtext scroll in tandem , getting code creating same using scrolledcomposites . have limitation of using styledtext because, using other purpose well. want create same thing link here using styledtext . i tried same code replacing scrolledcomposites styledtext din't allowed me setorigin(x , y) . you can use methods styledtext#sethorizontalpixel() , styledtext#settoppixel() (and respecrive get methods) , set positions: public static void main(string[] args) { final display display = new display(); final shell shell = new shell(display); shell.setlayout(new filllayout()); styledtext 1 = new styledtext(shell, swt.border | swt.v_scroll | swt.h_scroll); styledtext 2 = new styledtext(shell, swt.border | swt.v_scroll | swt.h_scroll); one.setalwaysshowscrollbars(true); two.setalwaysshowscrollbars(true); one.settext("scroll scroll scroll\ndown down down\nto to\nsee see see\nthe the\nstyled styled style

php - Passing variable with route parameter when form is submitted Laravel 5.2 -

i have in form in viewpage.php: <form action="{{ route('test.route'), ['id' => $params_id] }}" method="post" > and in route.php: route::post('/testing/{{id}}',[ 'uses' => 'testcontroller@testmethod', 'as' => 'test.route' ]); and testcontroller: public function avaliarsubordinor(request $request, $uid){ return $uid; } i error says 'missing required parameters for[route: test.route] [uri: testing/{{id}}]. want pass variable controller using route parameter when form submitted.. i dont know if doing properlly..if can me or point me example can understand doing wrong.. laravel 5.2 missing required parameters [route: user.profile] [uri: user/{nickname}/profile] using above link found solution.. changed: <form action="{{ route('test.route'), ['id' => $params_id] }}" method="post" > to <form action="

clear or reset checkbox when clicking tab menu in javascript and php -

i have tab menu this. want checkbox reset when clicking tab menu. updated full php code find mistaken in code written. search stackoverflow find tab menu checkbox reset solution got solution , implemented code. failed solve problem. please me. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>event list</title> <link rel="stylesheet" href="<?php echo base_url('asset/css/tabcontent.css'); ?>" type="text/css"/> <script type="text/javascript" src="<?php echo base_url('asset/js/tabcontent.js'); ?>"

IOS swift Login with Google Plus -

while testing google-plus-ios-sdk-1.7.1 on ios 9 sdk, invoking gppsignin.sharedinstance() ends crashing on internal google sign-in sdk call canopenurl 2016-09-22 14:12:56.135 mcn[305:49025] -canopenurl: failed url: "com.google.gppconsent.2.4.1://" - error: "this app not allowed query scheme com.google.gppconsent.2.4.1" 2016-09-22 14:12:56.137 mcn[305:49025] -canopenurl: failed url: "com.google.gppconsent.2.4.0://" - error: "this app not allowed query scheme com.google.gppconsent.2.4.0" 2016-09-22 14:12:56.139 mcn[305:49025] -canopenurl: failed url: "com.google.gppconsent.2.3.0://" - error: "this app not allowed query scheme com.google.gppconsent.2.3.0" 2016-09-22 14:12:56.140 mcn[305:49025] -canopenurl: failed url: "com.google.gppconsent.2.2.0://" - error: "this app not allowed query scheme com.google.gppconsent.2.2.0" 2016-09-22 14:12:56.141 mcn[305:49025] -canopenurl: failed url: "com.google

angularjs - getting value of inputs created by ng-repeat -

i created radiobutton input struggling values of selected inputs. this radiobuttons input created <ul ng-repeat="item in riskmodel"> <li> <input type="radio" name="rdbrisk" ng-value="{{item.value}}" /> {{item.text}} </li> </ul> and ng-model definiton in controller $scope.riskmodel = [ { id: 0, text: "a", value: "" }, { id: 1, text: "b risk", value: "yr" }, { id: 2, text: "c risk", value: "or" }, {id:3,text:"d risk",value:"dr"} ] i want take selected value , send function parameter far failed results. declare ng-model variable object $scope.radiomodel = {}; var myapp = angular.module('myapp',[]); myapp.controller('greetingcontroller', ['$scope', function($scope) { //$scope.radiomodel = {}; $scope.riskmodel = [ { i

css - Apply a tag selector to the immediate parent of a rule within a deeply-nested structure -

there couple of similar questions i've found (like how specify html tag on less css nested class? ), none of them seem work rules nested more 1 level deep. here's structure have: article { .foo { ... } } here, .foo can 1 of many different types of element. sake of question, lets 1 of these elements a element. i'm wanting extend above structure select .foo element tag a within .foo rule. the problem answer on question i've linked above, , various other similar questions, following not work: article { .foo { a& { ... } } } instead of prefixing .foo a tag, this: article a.foo { ... } ...the entire chain gets prefixed: aarticle .foo { ... } ( here's live example ). how can target .foo elements tag a within .foo rule? looks you're getting tangled in wanting über-optimized less. if understand correctly, either way compiled css be article .foo { general `article .foo` styles } article a.foo { ad

java ee 7 - How to use async servlet + non blocking IO for file download? -

Image
my image files stored in database (i know shouldn't be, can't help). able render them on clients, i've implemented async servlet helps read binary stream off database column , write on output stream of servlet response. traditional io works fine here. when thought of trying non blocking io async servlet (to test performance), binary data returned in response keeps getting corrupted. starting oracle blog , i've seen various examples of file upload async nio servlet, no issue. here's servlet code: @webservlet(asyncsupported = true, urlpatterns = "/mydownloadservlet") public class fileretrievalservletasyncnio extends httpservlet { private static final long serialversionuid = -6914766655133758332l; @override protected void service(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { queue<byte[]> containerqueue = new linkedlist<byte[]>(); asynccontext asynccon

java - Find all direct dependencies of an artifact on Maven Central -

for artifact on maven central (or other given nexus repository), want make list of direct dependencies. at first, thought reading pom.xml , gather entries dependency section. noticed these entries might have no version (supplied dependency management) or entries might come parent poms. my second idea build kind of artificial maven project , gather dependencies mvn dependency:tree . might become complicated. what direct (but reliable) way? outside of maven plugin, can programmatically using aether. there method readartifactdescriptor this: gets information artifact direct dependencies , potential relocations. first, add aether dependencies pom: <dependencies> <dependency> <groupid>org.eclipse.aether</groupid> <artifactid>aether-impl</artifactid> <version>${aetherversion}</version> </dependency> <dependency> <groupid>org.eclipse.aether</groupid>

jquery - Add some px to a "scroll to position" function -

i have fixed header bar works anchor links scroll through page. links header bar gets active if on position. basicially active class comes 75px late, because fixed header 75 px height. how can add px function compensate that? $(document).ready(function () { $(document).on("scroll", onscroll); //smoothscroll $('a[href^="#"]').on('click', function (e) { e.preventdefault(); $(document).off("scroll"); $('a').each(function () { $(this).removeclass('active'); }) $(this).addclass('active'); var target = this.hash, menu = target; $target = $(target); $('html, body').stop().animate({ 'scrolltop': $target.offset().top+2 }, 500, 'swing', function () { window.location.hash = target; $(document).on("scroll&

f# - Unable to reference 'FSharpOption<>' within C# project -

i unable reference fsharpoption<> within c# pcl project targeting xamarin.android within visual studio 2015. here's video shows steps of me attempting resolve it. the error receive following: the type fsharpoption<> defined in assembly not referenced. must add reference assembly fsharp.core, version=3.7.4.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a note: my c# project reference fsharp.core. referencing same fsharp.core version f# projects using: some_path\packages\fsharp.core.4.0.0.1\lib\portable-net45+monoandroid10+monotouch10+xamarinios10\fsharp.core.dll adding app config the app.config file placed in android client project same app.config file using in test project that's written in f#. the app.config following: <?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembl

r - Extrafont and ggsave: Characters end up on top of another -

Image
i'm trying use arial.ttf in plots. have found several manuals fonts online, i'm running issues when try save pot via ggsave , default device. minimal working example i'm running following minimal working example reproduce bug: sys.setenv(r_gscmd="d:/gs/bin/gswin64c.exe") library(ggplot2) require(extrafont) font_import(prompt = f, pattern = "arial.ttf") font_import(prompt = f, pattern = "jokerman.ttf") loadfonts(device="win", quiet = t) loadfonts(device="pdf", quiet = t) plot <- ggplot(mtcars, aes(wt, mpg, colour = hp)) + geom_point() jokerman_plot <- plot + theme_bw(base_family = "jokerman") arial_plot <- plot + theme_bw(base_family = "arial") ggsave("arial_plot.png", arial_plot) ggsave("arial_plot.pdf", arial_plot) embed_fonts("arial_plot.pdf") ggsave("jokerman_plot.png", jokerman_plot) ggsave("jokerman_plot.pdf", jokerman_plot) em

css - Continuous file corruptions multiple GIT repositories containing Django Projects -

Image
i have frustrating , weird problem regarding 2 django projects, in 2 separate git repositories. let me define project 1 a , project 2 b . a has homepage, connecting home.css file. have checked git repository contents of file, overwriting local copy, , copy pasted raw contents of file home.css -> homepage displays fine. now, whenever quit django processes , virtual environment associated it, , commit on git, , run project again, home.css file corrupted. page looks this: if delete home.css file directory , run following commands: git fetch origin master git reset --hard fetch_head the project runs fine again (again screenshot of correct markup now): the fun thing is, happens projects b , a @ same time. whenever a screwed up, b screwed up. , add confusion: on computer, same repositories, files being changed leading corruption of stylesheet. what culprit? what's going on? files in online git repository correct, because if paste raw contents home.html works a

jquery - How to get mouseposition (pageX , pageY) during mousemove with pressed mousebutton -

i need actual mouseposition of every move when mousebutton pressed. i used following: var time, click= $( '#foo li' ); click.mousedown(function(e){ time= setinterval(function(){ $( '#foo li' ).mousemove(function( event ) { var msg = "handler .mousemove() called @ "; msg += event.pagex + ", " + event.pagey; $( ".output" ).empty(); $( ".output' ).append( msg ); }); }, 500); return false; }); $(document).mouseup(function(e){ clearinterval(time); $(window).unbind( 'mousemove'); return false; }); it works fine: every position printed in 'output'. mouseup event not stop mousemove function. problem? update: sorry,im beginner... i tried way , works fine. there better way

How to sort a string array from maximum to minimum amount of that type of elements in c#? -

i sorry confusing title, how make array of these elements : string [] anarray = new string[50]; anarray[0] = "new york"; anarray[1] = "london"; anarray[2] = "new york"; anarray[3] = "london"; anarray[4] = "new york"; anarray[5] = "chicago"; fall array : anarray[0] = "new york"; anarray[1] = "new york"; anarray[2] = "new york"; anarray[3] = "london"; anarray[4] = "london"; anarray[5] = "chicago"; where elements sorted amount of equal elements there in array. , if example anarray has equal amount of elements : anarray[0] = "new york"; anarray[1] = "new york"; anarray[2] = "london"; anarray[3] = "london"; how make program finds both of these elements , outputs like: new york, amount of elements 2 london, amount of elements 2 i'll hope understand, sorry if may confusing, here. just use linq groupby

java - Get only NON reply tweets from Spring Tweet API -

i want tweets of home timeline not tweets made reply (not retweet) on other tweet. crawled whole spring twitter api not find way check if tweet object reply tweet or @ least retrieve tweets not reply. tweet class has boolean getter: boolean isfavorited() boolean isretweet() boolean isretweeted() now miss boolean isreply() has idea how check or retrieve non-reply tweets? edit : using spring-social can use tweet.getinreplytouserid() check if value null, in case, tweet it's not reply. here have operations of class tweet. old : can check property in_reply_to_screen_name or in_reply_to_status_id example. if null, tweet it's not reply. here can see properties.

python - How to create django view inside tests -

i have utility, consist of middleware, , need test it. need view emulate user request , i'm trying create view inside test , use in testcase. don't know how create , assign test application. i have settings test django application in run_tests.py file: from django.conf import settings, global_settings app_name = 'my_app' conf_kwargs = dict( databases={ 'default': { 'engine': 'django.db.backends.sqlite3', 'name': 'test.db', 'test_name': 'test.db' } }, site_id=1, middleware_classes=global_settings.middleware_classes + ('my_app.middleware.mymiddleware',), installed_apps=( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', ) ) settings.configure(**conf_kwargs) django.test.utils import get_runner runner = get_

excel vba - Combining 2 columns into 1. (one after the other) -

Image
i combine 2 columns 1. 1 after other. i have this: b row 1: 1 10 row 2: 2 11 row 3: 3 12 row 4: 4 13 and obtain this: row 1: 1 row 2: 2 row 3: 3 row 4: 4 row 5: 10 row 6: 11 row 7: 12 row 8: 13 the number of rows in 2 columns different every time (number of rows in , b same). i tried many functions , i'm close still not there. appreciate help. prefer formulas. i'm still newbie in vba fine. thanks! here formula it. put in c1 , copy down. =if(a1<>"",a1,index(b:b,row()-counta(a:a)))

html - Typing effect with CSS3 cuts some text at the end -

i want ask. have problem when i'm using typing effect css3. effect in end cuts text, want text displayed in new line instead of cutting text in end. .left-side { float: left; margin-top: 160px; color: #4a4a4a; font-size: 60px; font-family: avenir; } .left-side strong { font-family: "arial rounded mt bold"; color: #ff7916; } @media screen , (max-width: 1025px) { .left-side { width: 100%; } } @media screen , (max-width: 1200px) { .left-side { text-align: center; } } @media screen , (max-width: 670px) { .left-side { margin-top: 50px; font-size: 48px; } } @media screen , (max-width: 600px) { .left-side { margin-top: 50px; font-size: 38px; } } @media screen , (max-width: 500px) { .left-side { margin-top: 50px; font-size: 38px; } } .left-side p:nth-child(1) { white-space: nowrap;

openlayers 3 - OL3 - ol.layer.Group - zIndex - why? -

does z-index of layer group serve functionality? as far can see, property doesn't have effect @ all. when rendering frame, layer states flattened list, sorted z-index. for me fine behavior. z-index ordering should independent the grouping hierarchy. rather see property move ol.layer.base class ol.layer.layer class. make sense? just want make sure, when build onto functionality, behavior expect, , expected remain way in future versions :).

symfony - Doctrine entity caching? -

i have 1 project wasn't developed me. , has strange behaviour. added new field entity, generated setters/getters field usual. after updated database schema through doctrine:schema:update , see strange behaviour - symfony throws error call undefined method %my method name% . checked again, method exists. after cleared cache through rm -rf app/cache/* . first page loading works fine. @ second loading got error again. so, when tried clear cache again, situation repeated. when tried use get_class_methods( $myentity ), shows new methods after first page loading, after second - not. i tried use commands doctrine:cache:clear-* , useless. anyone can me problem? finally problem solved when restarted php-fpm. such mistery.

node.js - npm start gives weird error 8 with Unexpected token ILLEGAL -

i getting weird error 8 below output while doing $ npm start syntaxerror: unexpected token illegal @ module._compile (module.js:439:25) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:902:3 npm err! weird error 8 npm warn failure might due use of legacy binary "node" npm warn further explanations, please read /usr/share/doc/nodejs/readme.debian npm err! not ok code 0 npm -v 1.3.10 node -v v0.10.25 i have installed nodejs-legacy $ node /usr/bin/node $ nodejs /usr/bin/nodejs can please it. i trying run react-jsonschema-form or word-finder ( https://github.com/amirrajan/word-finder ) on ubuntu 14.04 you using node 0.10 - lts version 4.5.0 , current version 6.6.0. consider upgrading node because using outdated version. node 0.10 released on march 2013, maintainence period ends in week (on octo

Permissions for non-licensed Office365 users -

can tell me permissions non-licensed office365 users, specially in education tennant? i've tested , although no apps appear in office365 menu(like word, email, etc), user still has access sharepoint sites. shouldn't, right? thanks, nuno

c# - Unable to upload large video file -

i trying upload large video file using file loader in asp.net project unable upload. made changes in web.config file not working. video small size upload problem occur in large video file uploading. <system.web> <httpruntime maxrequestlength="1048576"/> <pages validaterequest="false"/> <compilation targetframework="4.5" defaultlanguage="c#" debug="true"/> <machinekey validationkey="1234567890123456789012345678901234567890aaaaaaaaaa" decryptionkey="123456789012345678901234567890123456789012345678" validation="sha1" decryption="auto"/> <customerrors mode="off"/> <authentication mode="forms"/> </system.web> <system.webserver> <security> <requestfiltering> <requestlimits maxallowedcontentlength="1073741824"/> </requestfiltering> <

sails.js - Lift Sails inside Docker container -

Image
i know there multiple examples (actually few) out there, , i've looked , tried apply them case when try lift container ( docker-compose up ) end more or less same error every time. my folder structure is: sails-project --app ----api ----config ----node_modules ----.sailsrc ----app.js ----package.json --docker-compose.yml --dockerfile the docker-compose.yml file: sails: build: . ports: - "8001:80" links: - postgres volumes: - ./app:/app environment: - node_env=development command: node app postgres: image: postgres:latest ports: - "8002:5432" and dockerfile : from node:0.12.3 run mkdir /app workdir /app # dependencies installed in local copy of project, # copied container add app /app cmd ["/app/app.js", "--no-daemon"] run cd /app; npm i tried having run npm -g sails instead (in dockerfile ) , command:sails lift , i'm getting: naturally, tried different configuration

SQL Server outer apply causing major CPU burden -

i have user view i've created in sql outer apply brings amount of years experience user has according employment records. when monitored cost of sql statements in activity monitor (sql enterprise manager) says part in view causing 25% of rather large cpu cost in execution plan. i'm trying work out more effecient way of bringing metric view without additional overhead. here apply... select * users u <blah blah blah> outer apply (select coalesce (year(getdate()) - min(startyear), 0) yearsworkexp dbo.job_history (userid = u.userid)) workexp untested have go @ this: ;with base ( select userid, min(startyear) startyear dbo.job_history group userid ) select u.* , year(getdate()) - isnull(b.startyear, year(getdate())) yearsworkexp users u left outer join base b on b.userid = u.userid;

Initialize beans after application startup/on application event [spring] -

i have following situation. in microservice [ ma ] i'd initialise/destroy beans after application startup, or based on event. imagination there microservice [ mb ] holds informations contentstores . after ma startup i'd ask mb contentstore entries , based on i'd create many beans needed. there can event trigger storecreated/storedeleted , in case need destroy bean. i don't know interfaces need implement/classes extend please give me suggestions. so let's start applicationlistener , event applicationreadyevent . 2 know ma initialized , can ask mb list of stores. in place can take advantage of event's applicationcontext , create beans (each bean have it's own qualifier - e.g. id) , if needed autowire dependencies. but place don't know how add created beans applicationcontext. the same mechanism should exists application events, in case can @ first check if beans created , if so, return them. note: i'm using spring-boot 1.4. than

sql server - Should identity column be added table that uses date and a foreign key? -

Image
i'm making small asp.net mvc application allows me set dish schedules me , people in house. have table called dishdates keeps track of has dish day on date. contains 3 columns (dishdateid, personid, , date). dishdateid pk, personid fk person table , date date of day dishes on. we have 1 person on dishes on given day. personid tied date. app can auto generate dish calendar month. now, can go in , regenerate new dish list month has had 1 created, application goes , deletes existing records month , creates them. every time this, dishdateid field's values increase because identity column. i know won't problem because can have on 2 billion rows still suffice way longer lifetime of app. but, case smarter not use identity column , have personid , date field , make date pk? feel identity column kind of in way or something, or unnecessary. when recreating personid , dates values, create them in temp table , use merge function based on matching dates (as constant v

Bash: Dialog-command doesn't execute inside while loop -

if run dialog --title "titletext" --dselect /path/ 20 60 works fine. when put in while-loop echo executed not dialog --title "titletext" --dselect /path/ 20 60 (see listing below). repeat=true while $repeat echo "test do" dialog --title "titletext" --dselect /path/ 20 60 done

javascript - special closing method for tooltipster -

i want tooltipster-toolstip closed after 12 seconds in normal case (and have defined options that,) if user clicks tooltip should able stop closing process. tolltip should stay there twice time or can closed clicking cross in roght corner (like can also). set interactive: true, did not stop closing-process after 12000 ms. $('.tooltip').tooltipster({ plugins: ['sidetip', 'scrollabletip'], position: 'bottom', contentashtml: true, animation: 'grow', interactive: true, delay: 400, interactive: true, trigger: (prev == 1) ? 'hover' : 'click', timer: 12000 }); i've got no experience implementing custom behavior. help? kind regards peter

vba - Trust Settings MS Excel -

this question has answer here: how rid of vba security warning 5 answers is possible programmatically disable enable content security message bar. have spreadsheet macros , forms, however, though save spreadsheet trust settings set never show information blocking security, still pops if send spreadsheet else open. i'm try permanently disable it, or add code thisworkbook_open whenever opens, never prompts user click enable content button edit problem have have form tha supposed appear before users able use spreadshet in case when open firsy havento click enable content before log in form appears .....is there waynaround it? no. not. never. ever.

Adding security (SSL) to a Spring web service -

i've followed guide: https://spring.io/guides/gs/rest-service/ create web service using spring rest. need add ssl communication, i've tried following other guide: http://www.radcortez.com/ssl-tls-rest-server-client-with-spring-and-tomee/ lot of code in web.xml file, wich first guide said isn't used. imagine it's supposed in kind of annotation. appreciate this!

c# - Correctly set Scope when using WebApi, SimpleInjector and MediatR -

controller public class locationscontroller : apicontroller { private readonly imediator _mediator; public locationscontroller(imediator mediator) { _mediator = mediator; } public ienumerable<place> get() { return _mediator.send(new getlatestmapdata<place>()); } } on first request of get() action, handler instantiated simpleinjector , executed correctly. on second request (f5 in browser e.g.), fails : handler not found request of type .... container or service locator not configured or handlers not registered container. and inner exception of: cannot access disposed object. object name: 'the threadlocal object has been disposed.' owin startup public class startup { public void configuration(iappbuilder app) { // simpleinjector var container = compositionroot.createcontainer(); var config = globalconfiguration.configuration; config.dependenc

How to separate label and the text field in alpacajs -

i using alpacajs render form automatically. want separate label , input set them under separate column. like col1 | col2 lastname | lname textbox firstname | fname textbox this can't achieved don't have options while specifying schema/options. thanks help. if want have kind of presentation, alpaca have buil-in view template that, use "bootstrap-edit-horizontal". "view": "bootstrap-edit-horizontal" here's fiddle . tell me if want else :)

c++ - Is there a way to MQ put multiline string data? -

we have c++ application reads ibm mq queues , expects data in following format "texta textb textc" we have our own testing tool reads input data in "texta\r\ntextb\r\ntextc\r\n" , replaces "\\r\\n" actual "\r\n" characters , puts onto mq. what looking third party tool ibm websphere mq or amqsput put multiline data actual crlf characters on mq. if create data in file there lots of tools put file message ibm mq queue. here list: http://www.capitalware.com/mq_tools.html

Import data into SQL Server 2012 using wizard lost data (have date and empty cells in the same column) -

i know not new issue , have browsed lot not figure out. the table contains column few dates (like 25-apr-16) while majority of rows empty. after importing sql, there null left; dates gone. i have tried 3 methods: save file .xls, change column date format; save file .xls, fill empty null, change column date format; save .csv; so far, none of them worked. at last, tried , worked, wondering if there better ways: save file .xls, fill empty 12/31/9999, after importing, update 12/31/9999 null. any appreciated. thank you! the issue when import data sql server sql server try wonder kind of data in each cell of sheet, , research on first 100 records. if there on top 100 records of cell, sql server considers cell empty. avoid that, can fill first record of excel sheet dummy values , after import sql server.

sql server - Compilation when Column doesn't exist -

i've stored procedure looks this: create procedure test begin if exists( select 1 sys.columns name = n'column2' , object_id = object_id(table2') ) select column2 table2 end i want run procedure on db column2 doesn't exist . don't want take existence check out of sp. error : msg 207, level 16, state 1, procedure test, line 39 [batch start line 0] invalid column name 'column2'. is there way so? why yes , why not? and why instance if check existence table , select non-existent table works? use dynamic sql: create procedure test begin if exists (select 1 sys.columns name = n'column2' , object_id = object_id('table2') ) begin exec sp_executesql n'select column2 table2'; end; end;

c - Loop to ask if user wants to play again (y/n) -

here code bmi calculator. add question on end asks if user wants calculate bmi or user wants stop. have question y or n answer. y = calculate bmi n = goodbye my code far: #include<stdio.h>; void main() { float w,h,bmi; printf("vul uw gewicht in in kilogram."); scanf("%f",&w); printf("vul uw hoogte in in meters. (bijvoorbeeld: 1.75)"); scanf("%f",&h); bmi=w/(h*h); printf("bmi: %f",bmi); bmi<18.5?printf(" je bent best wel dun eet een burger :p"):(bmi<25)?printf(" lekker gewicht, blijf zo doorgaan"):(bmi<30)?printf(" ik zou wat minder gaan eten als ik jou was"):printf("oh oh, u bent in gevaar"); } try this #include<stdio.h>; void main() { char opt='y'; while(1) { float w,h,bmi; printf("vul uw gewicht in in kilogram.\n"); scanf("%f",&w); printf("vul uw hoogte in in meters. (bij

pointers - Storing a character at address location in C -

in assembly language, if have 2 variables, address a0 , byte t0, it's easy store t0 @ beginning of address a0 typing sb $t0,0($a0) now, want same thing in c, , in case i've got char* a0 = "abc"; char t0 = 'w'; i know can't access , modify a0[0] directly because results in bad access error. efficient way of replacing beginning "a" in a0 value in t0? you cannot replace 'a' because in string literal, read-only. you can, however, store string in array, makes letters , accessible , replace 'a' easily: char a0[] = "abc"; char t0 = 'w'; a0[0] = t0;

How to guarantee order in Kafka partition -

ok understand order guarantee per partition. just random thought/question. assuming partition strategy correct , messages grouped correctly proper partition (or using 1 partition) i suppose producing application must send each message 1 1 kafka , make sure each message has been acked before sending next 1 right? yes, correct order producing application sends message dictates order stored in partition. messages sent producer particular topic partition appended in order sent. is, if message m1 sent same producer message m2, , m1 sent first, m1 have lower offset m2 , appear earlier in log. http://kafka.apache.org/documentation.html#intro_guarantees however, if have multiple messages in flight simultaneously not sure how order determined. you might want think acks config producer well. there failure conditions message may missing if leader goes down after m1 published , new leader receives m2. in case won't have out of order condition, missing message it