Posts

Showing posts from August, 2012

c# - LINQ Union between two tables with the same fields and then returned in a collection -

i have given trying create linq query retrieve sql server view union between 2 tables. try create linq union. i have 2 views, memberduespaid , memberduesowed. have same fields in both; (batchno, trandate, debitamount, creditamount, receiptno, checkno, socsecno). i have helper class in application called membertransaction. has same properties. how how do union between 2 tables socsecno = ssn passed in? want union 2 tables , return ienumerable collection of membertransaction. after 2 tables unioned want have collection returned ordered trandate in descending order. you can in linq union query: var infoquery = (from paid in db.memberduespaid select new membertransaction() { batchno = paid.batchno, trandate = paid.trandate, debitamount = paid.debitamount, creditamount = paid.creditamount, receiptno = paid.receiptno, checkno = paid.checkno, socsecno = paid.socsecno}) .union (from owed in db.mem

javascript - Angular run function on broadcast and page load -

i have controller below, .$on attribute called via .$broadcast when form submitted. i'd event run when controller loads. there syntactically easy way go doing this, or have add on page load listener? myapp.controller('downloadscloudctrl', ['$scope', '$rootscope', 'requestservice', function($scope, $rootscope, requestservice){ $scope.title = 'most popular keywords'; $scope.tooltip = 'test tooltip'; $rootscope.$on('updatedashboard', function(event, month, year) { requestservice.getp2pkeyworddata(month, year).then(function(data) { $scope.d3data = data; }); }); }]); if want run when controller loads, extremely simple. remove $on logic own function , call inside controller init: myapp.controller('downloadscloudctrl', ['$scope', '$rootscope', 'requestservice', function($scop

javascript - What does running slice() on an array do? -

from underscore: // create (shallow-cloned) duplicate of object. _.clone = function(obj) { if (!_.isobject(obj)) return obj; return _.isarray(obj) ? obj.slice() : _.extend({}, obj); }; if array detected, dev a obj.slice() i ran in console: [0,1,2,3].slice() and appeared nothing. what missing? from mdn : the slice() method returns shallow copy of portion of array new array object. when provide no parameters, slice start @ index 0 , go end, giving impression it's doing nothing. what missing? parameters.

javascript - MissingSchema Error: Schema hasn't been registered for model "User" -

i keep getting error whenever launch application: --missingschema error: schema hasn't been registered model "user" -- i'm working tutorial "mongoose application development" book simon holmes. i'm @ chapter 5 "interacting data - creation" here's code: app.js: var express = require('express') , routes = require('./routes') , user = require('./routes/user') , project = require('./routes/project') , http = require('http') , path = require('path'); db.js: //creating application schemas: //==================================== //user schema: //=============== var userschema = new mongoose.schema({ name: string, email: {type: string, unique:true}, createdon: { type: date, default: date.now }, modifiedon: date, lastlogin: date }); //build user model: //=========================== mongoose.model( 'user', userschema ); user.js: var mongoose = require("mongoose&q

regex - Search And Replace With Regular Expression webuilder -

i want find , replace statements in project files. search: md.qryloadsupplycode.value md.qryloadclientname.value result : md.qryloadsupplycode.asstring md.qryloadclientname.asstring please help!!!! i have tried search: md\.[a-z,a-z,0-9]+\.value (yes found) replace: md\.[a-z,a-z,0-9]+\.asstring (not work) the main problem you're trying use pattern in replacement instead of matching , capturing pattern when execute search. by placing capturing group () around search pattern, can reference matched in replacement call. search: (md\.[a-za-z0-9]+\.)value replace: \1asstring note : having commas inside character class, you're matching literals ( not separating syntax )

vb.net - How to use instance of New Object in With... Block -

dim objects new list(of object) new object .prop1 = "property 1" .prop2 = "property 2" objects.add(.instance) 'i mean instance of new object end is possible. i ask new question because last question has mislead information , don't give right answer. here code. no not possible. with statement creates implicit variable. can variable access members , there no member returns reference object itself. if want succinct code create, populate , add object list this: mylist.add(new sometype {.someproperty = somevalue, .someotherproperty = someothervalue}) interestingly, can make work way wanted if create own extension method. under impression not extend object class either wrong or has changed because tried in vb 2013 , worked. can write method this: imports system.runtime.compilerservices public module objectextensions <extension> public function self(of t)(source t) t retu

Insert Array field into mysql in php -

when insert type of array values directly mysql database, got error this #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near ':23:09z, 36840bd430637, success, 85.0, 11457922, 10.02, usd, x, m, 59106737wv831' @ line 1 and myquery is insert `transaction`(timestamp, correlationid, ack, version, build, amt, currencycode, avscode, cvv2match, transactionid) values (2014-06-26t02:23:09z, 36840bd430637, success, 85.0, 11457922, 10.02, usd, x, m, 59106737wv831451u) mycode is $columns = implode(", ",array_keys($result_array)); $escaped_values = array_map('mysql_real_escape_string', array_values($result_array)); $values = implode(", ", $escaped_values); echo $sql = "insert `transaction`($columns) values ($values)"; $res =mysql_query($sql); what changes can do? first of all, should escape column names (not required): $cols = join(',', array_map(function($name) {

How do you use the benchmark flags for the go (golang) gocheck testing framework? -

how 1 use flag options benchmarks gocheck testing framework? in link provided seems example provide running go test -check.b , however, not provide additional comments on how works hard use it. not find -check in go documentation when did go test nor when did go testflag . in particular want know how use benchmark testing framework better , control how long runs or how many iterations runs etc etc. example in example provide: func (s *mysuite) benchmarklogic(c *c) { := 0; < c.n; i++ { // logic benchmark } } there variable c.n. how 1 specify variable? through actual program or through go test , flags or command line? on side note, documentation go testflag did talk -bench regex , benchmem , benchtime t options, however, not talk -check.b option. did try run these options described there didn't notice. gocheck work original options go test ? the main problem see there no clear documentation how use gocheck tool or commands. accidentally gave

android - Scringo: openChat function doesn't work -

i using library scringo on android. "openchat" function doesn't seem working. absolutely nothing. here code. i read through api: http://www.scringo.com/docs/api/android/ openchat function should open 1-on-1 chat other user. doesnt happen. nothing happens. other functions working fine. doesn't log errors or warning. public class mainactivity extends activity implements onclicklistener { private scringo scringo; private activity mainactivity; private button button; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mainactivity = this; setcontentview(r.layout.activity_main); button = (button) findviewbyid(r.id.button); button.setonclicklistener(this); scringo.setappid("my-app-id"); scringo.setdebugmode(true); scringo = new scringo(this); scringo.init(); scringo.addsidebar(); scringo.loginwithemail("a@testapp.com", "hi", new scringosign

Windows Phone 8 Error - Installation of the application failed -

i working on windows phone 8 project deploying company app through hockeyapp. have .pfx file generated our symantec cert , correct .aetx file installed on device. if take .xap file intend deploy , copy somewhere separate , test deploying using xapdeploy.exe tool, install silently , work properly. use xapsigntool sign .xap against .pfx ("xapsigntool success: signed = c:\xxx"). when attempt test signed xap xapdeploy tool error "error - installation of application failed. run time error has occurred. fix capabilities in wmappmanifest.xml file." if deploy file hockeyapp install silently fail on device , appear sit there after download. does know causing after code signing? i able resolve issue. first, codesigned xap not run in emulator unless have installed aet file on current running version of emulator. so, incorrect me to expect not see failure after xap signed. i encountered other issues when deploying device. resolved making sure publisher id g

soapui - How to install SOAUI open source tool? -

can please tell me how install soapui. download soapui 5.0.0 soapui.org, asking license key open. soapui installation covered on website, here: http://www.soapui.org/getting-started/installing-on-windows.html soapui comes in 2 "flavours": -pro , open-source. see this: http://www.soapui.org/go-pro/compare-soapui-and-soapui-pro.html -pro version licensed. able cancel license prompt, @ point begin trial period.

linux - Copy stdout contents to a file in command line mode -

i have program this. in terminal mode. want copy outptu contents file. first tried redirecting, didnt work due buffering. tried unbuffer command. didnt work correctly cases below file main() { int i; printf("starting\n"); scanf("%d",&i); printf("the value %d\n",i); } output # ./a.out starting 4 value 4 output unbuffer command # unbuffer ./a.out | tee tt starting 4 ^c output simple redirection [works order of output not correct] # ./a.out | tee tt 5 starting value 5 i want contents shown in screen directly copied file. working in terminal mode [no gui]. unbuffer doesn't read standard input @ default, program waits without ever getting input. can make read , pass on standard input -p option : unbuffer -p ./a.out | tee tt will work. downside doesn't display type write. alternatively, if control c program, can disable default buffering of standard output when it's not t

log4net - How to check whether the log is enabled or disabled? -

i trying check whether log enabled or disabled based on ini file. have check condition every time whether enabled or disabled. have check log file enabled or disabled once , use everywhere. how can this? if ("true".equals(m_objglobalconfig.soaplog)) { log.errorformat(se.message + environment.newline + environment.newline, se.stacktrace); } is there can customization appender ? you disable log4net initialization based on parameter, prevent log4net being configured , logging: during initialization of program : if ("true".equals(m_objglobalconfig.soaplog)) { log4net.config.xmlconfigurator.configureandwatch(new system.io.fileinfo("path/to/file")); } and can log normally

Running Django projects from virtualenv with Gunicorn >=19 -

i saw news on docs.gunicorn.org gunicorn v.19: deprecations run_gunicorn, gunicorn_django , gunicorn_paster deprecated , removed in next release. use gunicorn command instead. i run applications virtual environments, created virtualenv command in supervisor: [program:my_app] command=/var/www/.virtualenvs/my_app/bin/gunicorn_django -c /var/www/my_app/conf/gunicorn.conf.py user=www-data group=www-data daemon=false debug=false autostart=true autorestart=true redirect_stderr=true stdout_logfile=/var/www/my_app/log/supervisor.log how should change settings run projects new version gunicorn? the command line should changed following command=/var/www/.virtualenvs/my_app/bin/gunicorn my_app.wsgi:application -c /var/www/my_app/conf/gunicorn.conf.py this assuming have file my_app/wsgi.py. since django 1.4, startproject has generated wsgi.py file part of project. i'd assume have this, if not can use following snippet create file. import os os.envi

C++ 11 move semantics vs C++ 98 -

i've studied c++ 11 move semantics , have such question. for example: if have vector<t> vt; // assume t have pointers on data in separate memory vt.push_back(...); assume vt lacks unused capacity. in c++98 allocated more memory , copy (calls constructor copy) every t object data points on. for example: t1 -> t1 data => copied t_cop1 -> (t1_cop1 data) t2 -> t2 data => t_cop2 -> (t2_cop2 data) c++ 11 move semantics allow move t objects (just copy pointers, not copy data in separate memory calling move constructors). so question why cannot same in c++98, why cannot implement push_back copy memory(which contains pointers t1, t2 t_cop1 , t2_cop2 created same pointers) , after free (t1 , t2 using free(void*) example)? upd: ok, try explain question on more simple example: for instance if have class contains pointer datastructure data. implement copy constructor copies pointer "data" class { public: a() {}; a(const a&

mysql - Read JSON data from multiple file input -

table help id name 1 name1 2 name2 json1 = {name:name1,data:"data1"} json2 = {name:name2,data:"data2"} final output table data reference json1 1 json2 2 i want final output table in mysql refers table , stores data json1 , json2 select "json1" data, id reference table json1 concat('{name:', name, ',data:%}') union select "json2" data, id reference table json2 concat('{name:', name, ',data:%}')

css position - Issues when HTML body element is positioned 'relative' -

on 1 of websites, found body element set position: relative , content inside body seem shifted downwards scale of margin-top css value set on topmost element in body. why body has css 'position: relative' set? intended fix bug? heard there ie bug not able set absolute positioning of elements. why 'margin-top' of 'only' first element inside body affects position of every element? javascript function 'getboundingclientrect()' returns wrong value element not consider margin-top value set on topmost element. 1. why body have css 'position:relative' set? intended fix bug? heard there ie bug not able set absolute positioning of elements. fc: that's not intended fix bug, because 1 (direct) children of body element has position:absolute . without body having position:relative , child positioned relative canvas (the browser inner window), rather relative body element. see this tutorial ('nested position:absolute') full

php - BigCommerce Webhook Not Triggering -

i created webhook in bigcommerce using following code: use bigcommerce\api\connection; $connection = new connection(); $connection->setcipher('rc4-sha'); $connection->verifypeer(false); $connection->addheader('x-auth-client', $clientid); $connection->addheader('x-auth-token', $token); $response = $connection->post('https://api.bigcommerce.com/stores/' . $hash . '/v2/hooks', json_encode(array( 'scope'=>'store/order/created', 'destination'=>'https://bigcommerce.example.com/order' ))); i got response following: stdclass object ( [id] => 568 [client_id] => lms4gxejy2xw2bia7w30v3bal1sz5yz [store_hash] => xxxxxx [scope] => store/order/created [destination] => https://bigcommerce.example.com/order [headers] => [is_active] => 1 [created_at] => 1403762563 [updated_at] => 1403762563 ) however, never got callbacks https

c# - Read/Write Info in File Details tab - Windows/File Explorer -

when right-click file in windows/file explorer > properties > details, whole lot of useful information file. how can programmatically access information in c#? the somewhat (no offense) answer i've come across after months of searching solution how details file properties? - answer written 4 years ago. there has better way achieve goal now, right? use fileinfo class. fileinfo ofileinfo = new fileinfo(strfilename); now, ofileinfo object, can access file properties.

android - "An access token is required to request this resource" - Facebook graph API -

i'm trying use facebook graph api in android application retrieve last posts facebook page. have set up, can login account , make "/me" request user's basic info. when try make request: new request(session.getactivesession(), "pokernewsbrazil?fields=posts&fref=ts/posts", null, httpmethod.get, new request.callback() { public void oncompleted(response response) { /* handle result */ } } ).executeasync(); i receive following error: "an access token required request resource". access token exists , valid, because if use access token same session in graph api explorer receive succesfull response containing posts page. getting wrong? change httpmethod.get httpmethod.post . this error arises because sdk posts access token behind scenes, while api looking in parameter. for reason using httpmethod.get , appending access token url string causes various malformed ac

android - Sqlite query to get unspecified month -

is there sqlite query unspecified month. if have database entry 1 january 2014 and next entry 1 december 2014 can months during period. i.e. feb 2014 nov 2014 thanks in advance!! this function returns me month , year of entries public string[] getmonthsmood() { string result[]=null; try { int = 0; appdatabase = sqlitedatabase.opendatabase(strmypath, null, sqlitedatabase.open_readwrite); string selectquerry = "select distinct strftime('%y-%m',dateadded) mood_diary order dateadded"; cursor cursor = appdatabase.rawquery(selectquerry, null); // int result=cursor.getcount(); result = new string[cursor.getcount()]; if (cursor.movetofirst()) { { // result.add(cursor.getstring(0));

map - Openlayers Handle Custom Server Tiles -

if i'm going have own server generate image tiles based on zoom resolution (which not mapserver or osgeo). checking wms , tms layers specifications, question there protocol can use in server side let me respond "openlyers" without client manual tiles handling? , openlayers layer used custom connection?

sockets - socketio4net-problems with proxy -

i have been asked take on project previous developer had used socketio4net, hence learnt of socketio4 project now. the problem employer facing clients having proxy servers. we have installed our product(client side) on clinics uses socketio4net , websocket. connect our main azure server sending data. in clinics without proxy,we not facing issues. proxy server, our service not starting. if have implement ssl process, big overhead how achieve ssl , proxy settings sockets in general? socketio4net provide other options? do have change http classes webclient? in experience proxies , school's in particular, vast majority turned out firewall based issue. port using, 80, 443 or else? if issue, clinics need either whitelist server ip, or allow ip:port combo you've set. for quick test @ clinics have issues - try these 2 sites (probably others sites can find too): http://websocketstest.com/ - tests ports 80, 8080, 443 , without ssl - or work? (this site g

c# - Is there any event triggered when a new window is added to the desktop -

i want know whether there event triggered when new window appears/comes on desktop. open using com,wmi,winapis, uiautomation or other method language of choice c#. the actual requirement: process has 1 main window , many other windows. class name of 1 of windows is, say, x, (i got info using pinvoke). window pops times whenever there notification in process. not want show window. not have code access process can disable window. there way can event or other mechanism keeps track of desktop , anytime window classname x comes/about come hides it. do tell if not clear question. edit : simon's answer good. tried , able notification windows except notifications/toast windows such of lync's im toast notification or outlook new mail notification. tried different elements of automation element , windows pattern still not those...any ideas how can those...you may read comments in simon's answer more context/detail. once again simon introducing great power of uiautomation ..

Pound symbol comes in camel message as? -

i facing issue pound symbol coming in messages camel route , pound symbol when comes in json request on camel rest endpoint , gets converted "?" same gets shown on log too. i have tried below ways fix setting convertbodyto tag charset utf-8 didn't worked. camel version used 2.10. locale : en_us. here route : <from uri="jetty:http://localhost:8080/testservice"/> <camel:convertbodyto type="string" charset="utf-8" /> <camel:log message="message body: ${body}" /> <to uri="jetty:http://localhost:8080/testendpoints"/> you need know encoding client uses when posting json. browser should send encoding information in content-type header field. if pound sign shows single question mark, indicates stream has single-byte encoding. if multi-byte , read single byte encoding show 2 garbage characters, not one. if content-type header not specify encoding, try setting western single

Youtube channel section videos -

i successful in fetching channels home page sections "youtube.channelsections.list" api how fetch videos inside these sections ? have been successful in fetching playlist , videos inside playlist { "kind": "youtube#channelsectionlistresponse", "etag": "\"qvys2yjpsz-tkkk4jvgyeo_ykzy/w_jkja-xyssniidlsdsp4nytwyw\"", "items": [ { "kind": "youtube#channelsection", "etag": "\"qvys2yjpsz-tkkk4jvgyeo_ykzy/uqkgurncwaquzjghxpaipzetefk\"", "id": "mychannelid.ebklgrwnpfy", "snippet": { "type": "channelsectiontypeundefined", "style": "horizontalrow", "channelid": "mychannelid", "title": "mgr movies", "position": 0 } } ] } the above json gives me section "mgr movies" how fetch videos inside ?

Modifying C string constants? -

possible duplicate: why segmentation fault when writing string? i want write function reverses given string passed it. but, can not. if supply doreverse function (see code below) character array, code works well. i can't figure out why not work. able access str[0] in doreverse , can't change value of array using char pointer. ideas? void doreverse(char *str) { str[0] = 'b'; } void main(void) { char *str = "abc"; doreverse(str); puts(str); } update: i know how write reverse function passing character array it: void reverse1(char p[]) { int i, temp, y; (i = 0, y = strlen(p); < y; ++i, --y) { temp = p[y-1]; p[y-1] = p[i]; p[i] = temp; } } but, want write version gets char pointer parameter. the simplest solution change declaration of str to char str[] = "abc"; this makes str array of char initialized string "abc". have str pointer-to-char in

plupload - How $maxFileAge from upload.php works -

i'm using plupload api , there upload.php sample. there $maxfileage variable in upload.php , used in if statement , said remove old temp files. want know how can check if works , on. here variable: $maxfileage = 5 * 3600; // temp file age in seconds and somewhere down there if statement: // remove old temp files if ($cleanuptargetdir) { if (!is_dir($targetdir) || !$dir = opendir($targetdir)) { die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "failed open temp directory."}, "id" : "id"}'); } while (($file = readdir($dir)) !== false) { $tmpfilepath = $targetdir . directory_separator . $file; // if temp file current file proceed next if ($tmpfilepath == "{$filepath}.part") { continue; } // remove temp file if older max age , not current file if (preg_match('/\.part$/', $fi

html - CSS help for blogger comments widget -

i've changed css font on blogger comments widget, it's still stuck on arial pages. i've made sure install respective google api font in template, seems apply comments on regular posts. how regular post comments like: http://thereadinggrotto.blogspot.sg/2014/06/first-post.html?showcomment=1403768355383#c2121347278617355835 this how comments on pages: http://thereadinggrotto.blogspot.sg/p/about-mermaid.html?showcomment=1403769230075 here's css comments in blog template: /* ============================= comment ============================= */ .comments .comments-content { font:normal 13px cabin, sans-serif; text-align:left; line-height:1.4em; margin-bottom:16px; color:#305e58; } .comments .comments-content .user { font:cabin, sans-serif; font-style:normal; font-weight:normal; text-transform:uppercase; color:#305e58; } .comments .comments-content .datetime { margin-left:10px; font:normal 11px cabin, sans-serif; color:#305e58; } .comment-

http - Scraping an aspx website that uses cookies and login using python -

i'm trying scrape pdfs snl.com. have paid subscription , valid login credentials. the url 1 of pdf files : http://www.snl.com/interactivex/file.aspx?id=10735427&keyfileformat=pdf after loggin in manually , accessing above url, actual url in address bar when pdf rendered in browser : http://ofccolo.snl.com/cache/44d87724ce10735427.pdf?cachepath=%5c%5cdmzdoc2%5cwebcache%24%5c&t=&o=pdf&y=&d= when access url i'm redirected https://www.snl.com/interactivex/default.aspx - login page. i have read several threads in python requests , tried below code past login page , handle cookies, still keep getting login page response says : "if registered snl user, log in using email address , password." import requests, sys requests.packages.urllib3 import add_stderr_logger add_stderr_logger() s = requests.session() s.headers['user-agent'] = 'mozilla/5.0' name_form = 'username' password_form = 'password' login = {nam

wpf - Some picture cannot display on image -

i have unclear, got 1 image display image based url. there image goes exception. below code: if file.exists(myequip) image1 = new bitmapimage() image1.begininit() image1.urisource = new uri(myequip, urikind.relative) image1.cacheoption = bitmapcacheoption.onload image1.endinit() imgequip.source = image1 imgequip.stretch = stretch.fill end if all pictures in jpg. exception jumps @ endinit. when open image using windows photo viewer, have pictures. not corrupted. idea why happen? try change urikind absolute , please check uristring (myequip) image1 = new bitmapimage() image1.begininit() image1.urisource = new uri(myequip, urikind.absolute) image1.cacheoption = bitmapcacheoption.onload image1.endinit() imgequip.source = image1 imgequip.stretch = stretch.fill

Are mathematical functions in MySQL faster than PHP? -

i've been working mysql while, i've never used supported mathematical functions , such floor() , sqrt() , crc32() , etc. is faster / better use these functions in queries rather doing same on result set php? edit : don't think question duplicate of this , question mathematical functions, listed on page linked, not concat() or now() or other function in question. please consider before flagging. there's no general answer that. shouldn't go out of way math in sql instead of php; doesn't make of difference, if there any. however, if you're doing sql query anyway, , have choice of doing operation in php before send mysql or in query itself... still won't make of difference. oftentimes there logical difference, in terms of when , how operation performed , needs performed , code best kept maintainability , reuse. should first consideration, not performance. overall, have really complex math of make difference whatsoever. simple math o

Android time management -

i working 1 database record on android. has 1 column storing number , column storing time in millisecond. there should 1 record. however, record should refreshed @ 6:00am next day. means when want update number, supposed check if time beyond refreshing time. there simple way achieve checking? not sure if have explained problem clearly. explain in way, want check if there 1 "6 am" between 2 time stored in millisecond. lot! public static boolean needrefreshbean(long milli){ calendar cal = calendar.getinstance(); cal.settimeinmillis(milli); if(cal.get(calendar.hour_of_day)>resettime) cal.add(calendar.day_of_year,1); cal.set(calendar.hour_of_day,resettime); //cal represents supposed refresh time if(cal.gettimeinmillis()<system.currenttimemillis()){ return true; } else return false; } i write function this. input updated time stored in database. not sure if works

python - Can't pickle PyCapsule in multiprocessing.Pool -

i wrote c library python .so object import. inside, use pycapsules manipulate c structures or use c functions , works well. want parrallelize usage of function in .so lib using multiprocessing.pool. it's seems multiprocessing.pool can't pickle pycapsules: cpickle.picklingerror: can't pickle <type 'pycapsule'>: attribute lookup __builtin__.pycapsule failed does have idea if there workaround? thanks.

Html Table with javascript -

i have 2 tables different table-id in html, follows - table-header - consists of dynamic week wise days + resources table-data in same nnumbers of columns... for img - http://i.stack.imgur.com/gwvoq.png the assign task button in every cell of table-data , need , whent click button, pop-up window(kendowindow m using right in javascript preferably) should display respective cell row's 1st cell i.e resource's name , id , cell column's 1st cell i.e. date string. please suggest solutions.... kindly appreciated. p.s. -- please don't suggest kendo grid or scheduler, because can't able produce kind of format, if can pls share code , procedure. you jquery: jsfiddle demo <script> $(document).ready(function() { $('.assign').on("click", function(e){ e.preventdefault(); var $idx = $(this).parent().index(); // index var $th = $('table th'); // table heading var $date = $th.eq($idx)

nservicebus - Raven could not be contacted. We tried to access Raven using the following url -

raven not contacted. tried access raven using following url: http://localhost:8080. please ensure can open raven studio navigating http://localhost:8080. configure nservicebus use different raven connection string add connection string named "nservicebus.persistence" in config file, example: <connectionstrings> <add name="nservicebus.persistence" connectionstring="http://localhost:9090" /> </connectionstrings> original exception: system.net.webexception: unable connect remote server ---> system.net.sockets.socketexception: no connection made because target machine actively refused 127.0.0.1:8080 we using nsb 4.2.0 , raven 2.0.2375 five days ago started error in production 6 of our production nsbs (no publishers, mixture of sagas, , non-saga endpoints). didn't coincide change (although confusingly, did release following day) even more bizarrely, 1 of our nsbs (a non-saga) not appear have issue though it's using sam

mysql - PHP ERROR : Notice: Undefined index: January in -

i have code count news posted in month: $months = array("january","february","march","april", "may","june","july","august","september","october", "november","december"); $mews = db->fetch("select id, year(from_unixtime(date)) year, monthname(from_unixtime(date)) month, count(id) total article year(from_unixtime(date)) = 2014 group year, month order year, month"); // index article counts month , year easy lookup $indexednewsdata = array(); foreach ($mews $news) { $indexednewsdata[$news['month']] = $news['total']; } // print output foreach($mews $news){ foreach ($months $month) { $total = intval($indexednewsdata[$month]); echo '<li>'.$month.' '.$t

How to upgrade _setCustomVar to Universal Analytics -

i have @ universal analytics without finding correct answer problem. how update line old analytics new universal analytics? _gaq.push(["_setcustomvar", 1, "splittest", "control", 1]); custom variables have been replaced custom dimensions in analytics.js , universal analytics: ga('set', 'dimension1', 'control'); you can read more replacing custom variables custom dimension here

ios - Keyboard And TextView's InputAccessoryView -

first: textview.inputaccessoryview = bar; [textview becomefirstresponder]; later: textview.inputaccessoryview = nil; [textview reloadinputviews]; [textview resignfirstresponder]; [self.view addsubview:bar]; bar inputaccessoryview. it's not added self.view. how achieve it?

asp.net - Invoke a website hosted on IIS at a particular interval automatically -

i trying invoke website hosted on iis @ particular interval automatically. steps followed . 1. tried invoke website on app pool recycle period. none of events on global file invoked on app pool recycle. 2. application_end on global file invoked on app pool recycle if web-site active. 3. there way invoke global file events on app pool recycle ? 4. there other way, that,i can invoke website @ particular interval automatically. please advice..

sql - Inserting dummy values at the end of select -

i have got query returns address , completed orders against each address last week. need insert 3 dummy values within result set. select address ,sum(case when orderdate >= dateadd(dd,(datediff(dd,-53690,getdate()-1)/7)*7,-53690) 1 else 0 end) completed orders group address order address result address--------------completed address1----------------3 address2----------------3 address3----------------3 address4----------------3 all values coming database, want insert 3 rows hard coded values expected result address--------------completed address1----------------3 address2----------------3 address3----------------3 address4----------------3 dummy1------------------0 dummy2------------------0 dummy3------------------0 unsuccessful attempt select address ,sum(case when orderdate >= dateadd(dd,(datediff(dd,-53690,getdate()-1)/7)*7,-53690) 1 else 0 end) c

Break-Down Data in Excel without VBA (Formula Only) -

Image
many times, required provide type of break-down customers - example shown in attached figure. i have table of data ("table data" - type of pivot) + customer provides official form, structure must preserved (highlighted in yellow ). basically, need separate cost details of code "a" , code "b" 2 separated sections. customer requires me provided details each individual part (example shows part - "break-down part a) is there anyway put a"item" "table data" code , code b ? rests can solved vlookup (price, quantity) - note: "item" non-duplicated values . thank much number rows in breakout using =1 , =a1+1 , use formula ="b-item"&text(a1,"000") . if want skip making counter column use ="b-item"&text(row()-1,"000") use current row number (minus 1 or many need). if items aren't sequentially that, still unique, recommend adding counters on original tab s

performance - Slow down when executing multiple Racket programs -

i have racket program long running. executing many instances of same programs finding answer faster. (it depends on randomness.) execute 10 instances of same program command line on 24-core machine. average throughput when executing 1 instance (on 1 core) 500 iterations/s. average throughput when executing 10 instances (on 10 cores) goes down 100 iterations/s per core. expect see similar throughput per core because each execution not interface others @ all. else experience behavior? happening? how can fix this? --------------------------- additional information ----------------------------- os: ubuntu 13.10 cores: 24 each instance write own output file. approximately once per minute, each instance replace same output file updated result 10 lines of text. so, don't think hit i/o bound. according top, each core uses 1.5-2.5% of memory. when running 10 core, 16 gb used and, 9 gb free. nothing running, 11 gb used, , 14 gb free. there no network request. the follows (cur

ios - Removing the last Cell in UICollectionView makes a Crash -

hi i'm working custom uicollectionview ( https://github.com/surecase/waterfallcollectionview ) works fine. i'm setting delete items uicollectionview, , can delete them fine. problem comes when i'm trying delete last item of section. it gives following error. *** assertion failure in -[uicollectionviewdata layoutattributesforsupplementaryelementofkind:atindexpath:], /sourcecache/uikit/uikit-2935.137/uicollectionviewdata.m:787 *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'no uicollectionviewlayoutattributes instance -layoutattributesforsupplementaryelementofkind: uicollectionelementkindsectionheader @ path <nsindexpath: 0xc000000000000016> {length = 2, path = 0 - 0}' the code i'm using delete items following: - (void) alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 0){ nslog(@"erasing objects!"); //first remove ite

javascript - How to disable anchor element on load using jquery? -

in project , there 1 anchor element follows. <a href="javascript:void(0);" onclick="<?php if ($logged_uid == 0) { ?>login('mystudyplus','free','topicid8:41');$('#login_msg').show();<?php } else { ?>addtodashboard('mystudyplus','free','topicid8:41');<?php } ?>" class="btndownld" style="margin-left:120px;margin-top:200px;background:#f60098;">try now</a> i want disable above anchor element when page loads. actully have used removeattr property of jquery. want disable anchor element without removing onclick() event. please me in question. you you'd keep existing attribute handler. suppose you're talking handler definition, not processing, because that's you're trying prevent. solution 1: remove attribute completely $(function(){ $(window).load(function(){ $("a").removeattr("onclick"); }); });

svn - Import environment variables from text file on network using Jenkins -

i have unix master , windows slave. have 10 subversion repositories, tags automatically created process outside of jenkins. these tags multiple repositories make 1 complete dataset application. when these tags created, single text file on cifs share created contains urls of these tags 10 repositories. name of text file , cifs path static. i need suck in contents of file can tell job tags use compile dataset. have ability adjust syntax of text file, able tell job example: repository1=https://svn/repo1/tags/newtag repository2=https://svn/repo2/tags/newtag i know possible; new jenkins, , have windows background. you need envinject plugin . take property-style file (your file fits that), , inject environment variables jenkins. there many places can configured: globally node globally job before scm checkout as build step i assume need them before scm checkout, use set clean environment example plugin page. suggest keep both checked: "keep jenkins

How to find HTML rendered by <?php wp_head(); ?> in WordPress? -

i have done lot of search on it, of people saying wp_head() located in wp-includes/general-template.php wp_head in default-filter.php in wp-includes but want know html/php file placed in file directory rendered wp_head(), can edit file. thanks the wp_head() function calls functions hooked wp_head action. various functions hooked action, may reside in wordpress core, or perhaps in plugins may using, or in theme's functions.php file. to knowledge, there isn't specific wp_head template 'file' can edit. ref: http://codex.wordpress.org/plugin_api/action_reference/wp_head http://codex.wordpress.org/function_reference/wp_head

What will be the complexity of the algorithm below -

i have piece of code. think complexity of code o(n). not sure, can please confirm me? int low=0; int high=array.length-1; while(low<high) { while(array[low]!=0) low++; while(array[high]==0) high--; int temp=array[low]; array[low++]=array[high]; array[high--]=temp; } your program keeps increasing low , decreasing high until meets, it's o(n)

php - Why my ipaddress is 127.0.0.1 on localhost -

$_server['remote_addr']; this code used user's ip. if i'm on localhost gives 127.0.0.1 ip not , if go live web page ip address another. i'm user why ip 127.0.0.1 ? you said: if on localhost gives 12.0.0.1 that's correct because address localhost. see here if you'd know why has address. from wikipedia entry on localhost: in computer networking, localhost means computer. hostname computer's software , users may employ access computer's own network services via loopback network interface. using loopback interface bypasses local network interface hardware. i hope helps.

How to use multiple database names as variables in mysql query in php -

i need write 2 mysql queries in php script, in both cases want data fetched 2 different databases on same server. database names stored in 2 different variables. $link1 = mysql_connect($hostname_database,$username_database,$password_database); $database1 = "android1"; $database2= "android2"; $result1 = mysql_query("select * database1.tablename"); $result2 = mysql_query("select * database2.tablename"); what's correct way of achieving ? this how you'll connect 2 databases. need send true fourth parameter in second connection, otherwise first connection used. $db1 = mysql_connect($hostname, $username, $password); $db2 = mysql_connect($hostname, $username, $password, true); mysql_select_db('database1', $db1); mysql_select_db('database2', $db2); then query first database : mysql_query('select * tablename', $db1); query second database : mysql_query('select * tablename', $db

Default Preferences in a Firefox Bootstrapped Addon -

firefox bootstrapped addons not read default preferences overlay addons. understand need of manually setting default preferences when bootstrapped addon installed. after initial installation, guess benefit of setting default preferences enable reset preferences (unless ff keeps track of elsewhere). question is, default preference have read , set on each startup() ? if so, going saved (ie getdefaultbranch() data from)? reference: how convert overlay extension restartless a brief guide mozilla preferences restartless add-ons default preferences preferences i have been given answer via email posting here verbatim benefit of users. from dave garrett, developer of flagfox , author of how convert overlay extension restartless default prefs set during runtime saved nowhere. there no on disk cache of default prefs. on firefox start, default prefs read various locations preferences system. (firefox has own in omni.ja & addons have theirs in

hash - Implementation of MD5 in C -

i want implement md5 hashing function in c project, , want make own, because 1 thing afraid of using else's code (mainly because have trouble understanding such codes). so, headed straight wiki page pseudocode: http://en.wikipedia.org/wiki/md5 decided leave padding , breaking 512 bit chunks stuff later , start md5 hash of empty string. padded, should (i think) this: unsigned int message[16] = {0x80000000, 0x00000000, 0x00000000, 0x00000000,//binary: 100000000000000000000000... 0x00000000, 0x00000000, 0x00000000, 0x00000000,// ...0000000000000000000000000000... 0x00000000, 0x00000000, 0x00000000, 0x00000000,// ...0000000000000000000000000000... 0x00000000, 0x00000000, 0x00000000, 0x00000000};//...0000000000000000000000000000000 and here how reproduced wiki's main loop (the 1 deals 1 512-bit chunk) in c: unsigned int a0, b0, c0, d0, a, b, c, d, i, f, g, bufd;

django - DefaultAccountAdapter and DefaultSocialAccountAdapter? -

i tried following specific different signup flows users sign via social accounts (facebook) , sign via traditional login. from django.conf import settings allauth.account.adapter import defaultaccountadapter allauth.socialaccount.adapter import defaultsocialaccountadapter class normaladapter(defaultsocialaccountadapter): def get_login_redirect_url(self, request): if request.user.last_login == request.user.date_joined: return 'survey/' else: return '/results/' class corporateadapter(defaultaccountadapter): def get_login_redirect_url(self, request): if request.user.last_login == request.user.date_joined: return 'corporate/survey/' else: return 'corporate/results/' but if log in facebook, calls defaultaccountadapter's get_login_redirect_url instead of defaultsocialaccountadapter's. point auth plugin correct adapter classes! add following setti

Unable to connect to sql database server -

Image
yesterday, installed sql server 2008 on pc. working perfectly, when trying connect database engine, generates error: try using this. this work if trying connect database on same machine. if writing software connect remote database, need work out connection string needs be. website may you. connectionstrings

mysql - SQL "Not Like '%%'" Conditional Insert/Update -

i have conditional sql statement executed via powershell inserts or updates database based on existence of rows. i'm using script inventory software. however, numerous security updates , hotfixes appear when script runs, , i'd exclude these records being placed in sql database don't qualify applications. i've tried using not clause few different ways , can't working. i've tried using except well. advice appreciated! code below last syntax attempt: invoke-sqlcmd -serverinstance "$sqlserver" -database "$sqldb" -query "update $softwaretable set name = n'$($csvappname -replace "'", "''")', version = n'$($csvversion -replace "'", "''")', product_id = n'$($csvappid -replace "'", "''")', arch = n'$($csvarch -replace "'", "''")' product_id = '$csvappidgo' name not &#