Posts

Showing posts from June, 2011

objective c - iOS Dismiss and Present view controller custom animation -

i have view controller presenting following objective c code: catransition *animation=[catransition animation]; animation.delegate=self; animation.duration=0.3; animation.type=kcatransitionmovein; animation.subtype=kcatransitionfromright; [self presentviewcontroller:reader animated:no completion:nil]; [reader.view.layer addanimation:animation forkey:@"animation"]; and dismissing similar code inside delegate method catransition *animation=[catransition animation]; animation.delegate=self; animation.duration=0.3; animation.type=kcatransitionmovein; animation.subtype=kcatransitionfromleft; [self dismissviewcontrolleranimated:no completion:nil]; [self.view.layer addanimation:animation forkey:@"animation"]; however there 1 problem: unlike using navigation controller see 1 view slide onto other view; here old view disappears instantly new view moves onto blank view. how fix problem? need code work in ios 6,7 , 8 , horizontal animation see when going , fort...

github - Uploading file to git -

hello im bit new github , trying upload file git repository on github, , having trouble figuring out. i have file named test.txt , have repository on github called fun-with-git trying put file test.txt repositories master in "cloud". im sure there simple task can't seem make work, if can walk me through terminal commands or way great. thank :) p.s using macintosh (if makes difference). clone git repository locally: git clone git clone git@github.com:sirsoltex/fun-with-git.git cd fun-with-git copy , add test.txt file: cp /path/to/test.txt . git add test.txt create new local commit: git commit -m 'look, first git commit!' push commit remote github repository: git push origin master

Remote control from Bluetooth Adapter with Firefox OS -

i'm creating audio player firefox os. have bluetooth adapter play/pause, previous , next buttons. how can detect in app when press 1 of buttons? thanks sadly, bluetooth api certified apps ( source ). there no way @ moment, @ least on bluetooth.

c# - Remove character in all strings in a string array -

i'm developing c# .net framework library. if have array string[] elements . , want remove character \" in of them, how can in 1 instruction? i know can this: foreach(string element in elements) element = element.replace("\"", string.empty); is there way in 1 sentence? (without using foreach). you can create new array new values: var newvalues = elements.select(x => x.replace("\"", string.empty)).toarray(); if creating new array problem should stick loop approach. in addition can't change foreach loop variable that.you should compiler error: cannot assign 'element' because 'foreach iteration variable' you need for loop: for(int = 0; < elements.length; i++) elements[i] = elements[i].replace("\"", string.empty);

How to handle Session timeout if same asp.net sessionId is shared across multiple asp.net web application -

how handle session timeout if same asp.net session id shared across multiple asp.net web application. we have multiple web applications. these web applications running on dnn , sharing session id. session each application created @ time application accessed. want find way though can handle session time out because traditional way (using session_start on globle.aspx check existing session id , new session) not working. please me know how handle session timeout , don't implement @ page level. rather using asp.net session state, instead use caching achieve similar result. can use multiple tenant application if each tenant has own sessions. can respond cache timeouts using callback methods, more reliable using session state events. the downside won't scale multiple servers unless come distributed cache solution. use azure distributed caching resolve this, or there other options . here session caching solution typically like: public class threadsafecache { ...

.net - List of elements doesnt follow my recursion method c# -

i've got method calls (recursion). collects data need analyse. collects data in dto. dto setup: public class sequencedto { public string sequence { get; set; } public list<element> statelist { get; set; } public sequencedto() { } public sequencedto(string sequence, list<element> statelist) { this.sequence = sequence; this.statelist = statelist; } } this how initialize recursion method: string seq = ""; list<element> elmlist = new list<element>(); initialseqdto.sequence = seq; initialseqdto.statelist = elmlist; analyze(element, initialseqdto); //the recursion method the recursion method: public void handleeventanalysis3(element elm, sequencedto dto) { sequencedto newseqdto = new sequencedto(); list<element> elmlist = new list<element>(); elmlist = dto.statelist; newseqdto.sequence = dto.sequence; newseqdto.state...

c++ - CPU Usage during glFinish() -

context : measuring cpu usage during graphical rendering of qt test application. rendering done via qt quick module, makes use of dedicated scene graph based on opengl. environment : run tests on mobile panel running windows ce , track cpu activity celog event tracker. problem : when qquickwindow emits signals afterrendering() , frameswapped(), call glfinish() function. since glfinish() job wait previous opengl commands complete, understand cpu should waiting gpu complete tasks. , therefore expected have low cpu usage during call. however, not observe celog tracker. can observe that, during glfinish() time frame, threads belonging test app still using cpu. , in end cpu usage in same range rest of rendering loop. so wondering, there explanation cpu being used while glfinish() running ? opengl employs asynchronous execution model. opengl commands queued in render command pipeline , pipeline may not executed @ , queued commands lay dormant until pipeline execution fo...

angularjs - Angular looping through items in controller -

i have unique scenario able angular ng-repeat type logic in controller. using slidebar on mobile sized screens, requires div makes navigation sit outside containing div of website. this logic inside of index.ejs express file: <body> <div ng-view></div> <div class="sb-slidebar sb-left"></div> </body> my standard desktop size sidebar typical ng-repeat logic: <li ng-repeat="items in service"><a href="/service/{{item.shortname}}">{{item.title}}</li></a> since slidebar logic in core index.ejs express file on server side, don't have access angular view logic. solution @ moment logic in controller based on url: $scope.$on('$viewcontentloaded', function () { var index = window.location.pathname.split('/')[1]; if(index == 'services'){ $(".sb-left ul").html("<li>service categories<li>"); } } this...

c# - Cannot load page via HTTPS using MVC -

Image
as title says. need load page on https on browser. i'm using c# code [httpget] [requirehttps] [allowanonymous] public actionresult wordpressiframe() { return view("~/views/account/wordpressiframe.cshtml"); } when page deployed on iis, gives me error: err_too_many_redirects sorry image on spanish. please help

html - CSS style for NOT nested item -

i'm using css/sass style validity message. message not nested within i'm accessing. for example javascript adds error class input box if it's not valid. want block visible attributes change further down page. // when no error input#user_tags_attributes_0_tagname // div.tagname-available { display: block; } // not nested // , div.tagname-unavailable { display: none; } // not nested // when error input#user_tags_attributes_0_tagname.error // div.tagname-available { display: none; } // not nested // , div.tagname-unavailable { display: block; } // not nested in theory should able access elements without having write javascript perform this. possibly if css has root document variable javascript's $(document) do. input#user_tags_attributes_0_tagname { $(document) > div.tagname-available { display: block; } // not nested $(document) > div.tagname-unavailable { display: none; } // not nested } and html <table> <tr> <td width=...

osx - New cocoa class in Xcode giving @interface and @implementation in implementation file? -

new osx programming. understanding .m file should have @implementation/@end block , .h file should have @interface/@end block. not sure why when create new cocoa class in xcode (version 6.1) both blocks in .m file? upload image don't have enough points. you can have "private interface" not contained in header files (and not intended public consumption internal use). the common case so-called " class extension ".

Grails security filter doesn't work with 2 controllers -

i'm using grails 2.4.3, created security filter. had 3 controller in project name: admin, login , report. added following filter: def filters = { all(controller: 'admin', action: '*') { before = { if (!session.company) { redirect(controller: 'login', action: 'auth') return false } } after = { map model -> } afterview = { exception e -> } } } i mean actions admin controller, if !session.company , page redirected auth action in login controller. now i'd add controller report filter, how do that? tried all(controller: ['admin', 'report'], action: '*') doesn't work. any appreciated. thanks use pipe symbol add multiple controllers, like def filters = { all(controller: 'admin|report', action: '*') { ... ...

c++ - The case when the copy-constructor implicitly defined as deleted -

the section n3797::12.8/11 [class.copy] says: an implicitly-declared copy/move constructor inline public member of class. defaulted copy/ move constructor class x defined deleted (8.4.3) if x has: [...] — non-static data member of class type m (or array thereof) cannot copied/moved because overload resolution (13.3), applied m’s corresponding constructor, results in ambiguity or function deleted or inaccessible defaulted constructor the first case ambiguity of corresponding copy/move constructor quite clear. can write following: #include <iostream> using namespace std; struct { a(){ } a(volatile a&){ } a(const a&, int = 6){ } }; struct u { u(){ }; a; }; u u; u t = u; int main(){ } to reflect that. or function deleted or inaccessible defaulted constructor ? what's got function inaccessible default constructor? provide example reflecting that? simply put: struct m { m(m const&) =delete; };...

MySQL Server Refusing Local Connections Over SSH Tunnel -

i have remote windows server mysql , cygwin (enabling remote ssh connections). when connect local instance of workbench (i.e. workbench handling tunnel), via ssh root, have no problem connecting remote database. i have need set own tunnel because have app needs mysql access. chose use putty, , had partial success. i can connect (using workbench test client) through tunnel, localhost:3307, have forwarded myremoteserver.no-ip.com:3306, if have remote root user there set accept connections hosts (%), and/or actual ip of server. if restrict root 127.0.0.1 (as should be) error host x.x.x.x not allowed connect mysql server x.x.x.x actual address of remote server! somehow, using putty make tunnel isn't presenting me local connection. instead remote connection, though remote ip ip of remote server my question: how can set putty mimic way workbench makes tunnel connections? note: connections remote ip via no-ip address. works when workbench opens tunnel. server run within a...

assembly - Segfault with pop/push in x86/OSX -

i struggling understand why x86 assembly code, compiles fine gcc 4.2.1 (llvm) on osx, gives segmentation fault when executable run: .globl _main _main: push %rbp mov %rsp, %rbp mov $1, %rbx push %rbx lea l_.str0(%rip), %rdi mov %rbx, %rsi call _printf pop %rbx pop %rbp ret .section __text,__cstring,cstring_literals l_.str0: .asciz "%d \000" i observed if pop %rbx line moved before call _printf , program works correctly. why should fail @ in original form? this question answered in detail by: how print argv[0] in nasm? , x86 assembly on mac . it's gotcha when programming assembly on macosx. to summarize: this seg fault due stack misalignment. this occurs on oses use system v calling convention (including macosx, excluding linux), insists stack pointer multiple of 16 prior making function call (e.g. printf )....

java - HashMap n-dimensional using a recursive function -

i don't know how make matrix n dimensional using hashmap. idea enter number indicates dimension of matrix , make recursive function creates n-dimensional hashmap. for example, if want 5 dimensional matrix, have inside of 1 4 dimensions, inside 3 dimensions , etc.. map<list<integer>, valuetype> you can fill lists used key of map n amount of numbers. each number in list specifies offset of dimension specified index of number in list. there not more say, can of course wrap around , defend "out of bounds" , such indefinite operations, determine.

html - Page title not updating? Drupal/PHP hook title -

i'm trying change page title. visit page - click here . this written custom module within drupal 7. file called wb_spc.module module code in jsfiddle, please click here . i've tried changing lines 51 , 59 won't change h1 page title? please see code snippet below: /** * implements hook_menu(). */ function wb_spc_menu() { $items = array(); // admin configuration group. $items['admin/config/wb_spc'] = array( 'title' => 'workbooks self-assessment crm roi calculator', 'description' => 'administer wb crm requirements', 'access arguments' => array('administer wb crm requirements'), ); // admin configuration - settings. $items['admin/config/wb_spc/manage'] = array( 'title' => 'workbooks self-assessment crm roi calculator settings', 'description' => 'manage wb crm requirements settings , configurations.', 'access argum...

php - Separating admin login & member login in CakePHP ACL -

i beginner cakephp acl. have implemented acl component in cakephp project. facing 2 major problem acl. first of table structure. groups ------ id title created modified users ----- id group_id title status (0 => inactive, 1 => active, 2 => suspended) created modified my first problem have 2 user groups "admin", "members". how can restrict members login admin panel. since acl using "users" table admin user , member user login. the second problem how can restrict inactive , suspended user login customize error message account suspended. admin routing can used separate members login. can done during cake bake process. http://bakery.cakephp.org/articles/nate/2009/07/14/secrets-of-admin-routing use session flash message show error message based on condition controller. http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html

Python: xmlrpc out of memory when sending binary -

i got simple xmlrpc server script written in python. limited memory 512mb simulate environment script running. import simplexmlrpcserver import resource memory_limit = 512 resource.setrlimit(resource.rlimit_as, (memory_limit * 1048576l, -1l)) class functions: def foo(self, file): print "received file" server = simplexmlrpcserver.simplexmlrpcserver(("localhost", 8000)) server.allow_none = true server.register_instance(functions()) server.serve_forever() then got client script: import xmlrpclib import sys client = xmlrpclib.server('http://localhost:8000') file = open(sys.argv[1], 'r') binary = xmlrpclib.binary(file.read()) client.foo(binary) when send file of 20mb, following exception: xmlrpclib.fault: <fault 1: "<type 'exceptions.memoryerror'>:"> why can't send 10mb file server has 512mb of memory?

css - Foundation Grid doesn't fit -

i've got problem grid when using zurb's foundation. plan: on small devices show 2 ul-elements next each other (6 columns each) , on medium want 4 elements in 1 row. html: <footer> <div class="row"> <ul> <li>headline</li> <li>link</li> </ul> <ul> <li>headline</li> <li>link</li> </ul> <ul> <li>headline</li> <li><a href="#">link</a></li> </ul> <ul> <li>headline</li> <li><a href="#">link</a></li> </ul> </div> </footer> i'm using sass stylesheets , file looks this: footer { // bg-images , stuff .row { position: relative; z-index: 2; } ul { @include grid-column(6); li { list-style: none; } @media #{$medium-up} { @inc...

javascript - Issue on Loading Dynamic Data to "DataTables" Using jQuery -

demo i using this solution load dynamic data in data table . have use array of array since getting dynamic data user on font end selection (no database selection). using following code upload data table <table cellpadding="0" cellspacing="0" border="0" class="datatable" id="example"></table> and js: $(document).ready(function () { var counter = 0; var comparetable = []; var comparerow = []; var check = "test"; var compmodelname = "test"; var selectedtype = "test"; var selectedtarget = "test"; var selectedror = "test"; var selectedspecies = "test"; var historicdis = "test"; var projectsnumber = "test"; var projectscost = "test"; var projectsroads = "test"; var projectspowerline = "test"; var projectspenstock = "test"; var mapshow =...

azure - Same cloud service, same role type, different configurations -

is possible add same roles (worker roles) more once same cloud service different configurations? they handle different things service bus, have neither public nor private endpoints. all instances of same role within cloud service must share same .cscfg configuration. hack around externalising configuration blob or table storage, read when role starts up, keying specific instance's settings using instance number, e.g. instance1 consumes service bus topic "invoice", instance2 consumes "order", etc. however, best bet deploy worker roles different configurations multiple cloud services, allow scale out each service independently.

c# - Xamarin Studio Android App "aapt.exe" exited with code -1073741819 error MSB6006: -

i create project , wanna build , run in android phone. here normal detail of project output. did not put space , dash in of file. while error error msb6006: "aapt.exe" exited code -1073741819. display c:\users\devicebee saqe\appdata\local\android\android-sdk\build-tools\21.0.1\aapt.exe package -f -m -m "c:\users\devicebee saqe\appdata\local\temp\mwyidlg1.uvy \androidmanifest.xml" -j "c:\users\devicebee saqe\appdata\local\temp\mwyidlg1.uvy" --custom-package app1.app1 -f "c:\users\devicebee saqe\appdata\local\temp\mwyidlg1.uvy \resources.apk.bk" -s obj\debug\res -i "c:\users\devicebee saqe\appdata\local\android \android-sdk\platforms\android-12\android.jar" --auto-add-overlay --max-res-version 12 c:\program files (x86)\msbuild\xamarin\android\xamarin.android.common.targets(783,2): error msb6006: "aapt.exe" exited code -1073741819. adding technote link - remove sdk 24 using android sdk manager so...

Mysql replication error: option '--rpl-user' is required -

i trying set replication local database remote one. i'm new mysql followed video on there website. created users, granted permissions entered in on master: mysqlreplicate --master=repl@localhost:3306 --slave=repl@mydomain.com:3306 it gives me error: error: option '--rpl-user' required per documentation , looks that's required command line options. --rpl-user= the user , password replication user, in format: <user>[:<password>] or <login-path>. default rpl:rpl. your command should below rpl:rpl default --rpl-user command line option. mysqlreplicate --master=repl@localhost:3306 --slave=repl@mydomain.com:3306 --rpl-user=rpl:rpl

c# - Navigation between Pages -

this method effective windows 8.0 : navigationservice.navigate(new uri("/samepage.xaml", urikind.relative)); is there method same functionality effective 8.1 try this: frame.navigate(typeof(secondpage), param);

ajax - Dojo Lazy Tree Grid - Change Data on the Grid on Demand -

i have dojo lazy tree grid. trying change data on grid ajax, rather submitting page. dojo.require("dojox.grid.lazytreegrid"); dojo.require("dojox.grid.lazytreegridstoremodel"); dojo.require("dojo.data.itemfilewritestore"); dojo.require("dojox.data.queryreadstore"); dojo.require("dojo.parser"); dojo.require("dijit.form.datetextbox"); dojo.require("dojox.grid.cells.dijit"); var store = ""; var qty1 = ""; var grid ; dojo.ready(function(){ qty1 = document.getelementbyid("qty1").value; if(qty1!="") store = new dojox.data.queryreadstore({url: "serverdata.jsp?firsttimeload=false" }); else store = new dojox.data.queryreadstore({url: "serverdata.jsp?firsttimeload=true" }); var model = new dojox.grid.lazytreegridstoremodel({ store: store, ...

osx - Xcode shows swift errors while editing despite compiling -

i'm getting lots of undeclared type errors in xcode editor in swift files (not objective-c), despite code running fine when compile it. example, app delegate (not changed template): import cocoa @nsapplicationmain // 'nsapplicationmain' class must conform 'nsapplicationdelegate' protocol class appdelegate: nsobject, nsapplicationdelegate { // use of undeclared type 'nsapplicationdelegate' // methods } it's same throughout project, eg. view controller says nsviewcontroller , nstextview undeclared identifiers. i've tried cleaning, clearing derived data, , usual stuff. ideas? from apple documentation : nsapplicationdelegate needs import statement import appkit may solve problem.

android - Get string length in pixels -

i have layout looks follows: |user name | | |email@mail.com | info | and need set user's first name , second name if fits textview , first name if first name , second name long current screen. for example "tom smith": |tom smith | | |email@mail.com | info | and "tom veryveryverylongsurname": |tom | | |email@mail.com | info | how can name size specified text size , compare textview width? <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <textview android:id="@+id/name" android:layout_width="wrap_content" ...

ios - Store NSArray in persistent (user) data -

i need make inventory array persistent (does not reset each time app closed , reopened). use gamestate singleton class store high score, player level, etc. these have been integers far , pretty straight forward use. i followed attached tutorial regards gamestate singleton class: http://www.raywenderlich.com/63578/make-game-like-mega-jump-spritekit-part-22 i need store array of inventory custom skspritenode subclass. can store array in singleton class , syntax need approach that? in order save array need set encoding/decoding? saw different approach seems way more complicated singleton class. i versed in sql prefer not use sqllite if can instead retrieve array directly if stored locally. nsuserdefaults knows nsdata , nsstring , nsnumber , nsdate , nsarray , , nsdictionary , easiest thing store data need save in combination of data types. if can't that, you'll need implement nscoding in custom class can archive instances nsdata objects, isn't hard...

html - less: how to match only those <li> with <ul> children -

this question has answer here: add rule element if has child 2 answers i have nested list , want less match <li> lines have <ul> sub-lists. for example in following list want match cats , devious , dogs , not playful , destructive , deadly , fast , smart . <ul> <li>cats <ul> <li>playful</li> <li>devious <ul> <li>destructive</li> <li>deadly</li> </ul> </li> </ul> </li> <li>dogs <ul> <li>fast</li> <li>smart</li> </ul> </li> </ul> how do that? that's not possible in css or less, if can use jquery, this: $("li"):has("ul,li").addclass('childclass'); hope helps!

java - Continuing a loop until good input? -

i'm trying make program user needs account access other parts of it. want set if user's 2 confirm password dont match, have reenter info. also, if user leaves blank, must reenter info. how can continues loop until user enters info? if (e.getsource() == okbutton) { if(!passstring.equals(passstringconfirm) || username.equals(null) || passstring.equals(null) || passstringconfirm.equals(null)){ enterusername.settext(""); enterpassword.settext(""); enterconfirmpassword.settext(""); } } this have far, , if works 1 iteration. tried while , continually print out warning message trying print out in joptionpane. import java.awt.color; import java.awt.flowlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.borderfactory; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swin...

less - Why does this CSS work on Codepen but not directly in browser? -

i'm trying implement css-only modal box animation onto website. works on codepen found: http://codepen.io/petebot/pen/dbvkj but can't test or customize code on website because doesn't work on html page. what missing here? here's html page: <html> <head> <title></title> <style> @import url(http://fonts.googleapis.com/css?family=yanone+kaffeesatz); .transition (@time: .5s, @range: all, @ease: ease-out) { -moz-transition: @range @time @ease; -webkit-transition: @range @time @ease; -o-transition: @range @time @ease; transition: @range @time @ease; } .transition-delay (@time: .4s) { -webkit-transition-delay: @time; -moz-transition-delay: @time; -o-transition-delay: @time; -transition-delay: @time; } .border-radius(@radius) { -moz-border-radius:@radius; -webkit-border-radius:@radius; border-radius: @radius; } .gradient (@coler1: #fff, @coler2: #ccc) { background: @coler1; backgroun...

indexOf and lastIndexOf in PHP? -

in java, can use indexof , lastindexof . since functions don't exist in php, php equivalent of java code? if(req_type.equals("rmt")) pt_password = message.substring(message.indexof("-")+1); else pt_password = message.substring(message.indexof("-")+1,message.lastindexof("-")); you need following functions in php: strpos find position of first occurrence of substring in string strrpos find position of last occurrence of substring in string substr return part of string here's signature of substr function: string substr ( string $string , int $start [, int $length ] ) the signature of substring function (java) looks bit different: string substring( int beginindex, int endindex ) substring (java) expects end-index last parameter, substr (php) expects length. it's not hard, get end-index in php : $sub = substr($str, $start, $end - $start); here working code $start = strpos(...

python - django: concatinating strings to create a url to static image in template -

i'm trying load image url composed of vairable numerical value. there template solution or have create filter in extras.py? rather write 1 liner. along following lines: {% urltemp="media/"|add:info.personid|stringformat:"s"|add:".jpg" %} <img src="{% static urltemp %}" onerror="this.style.display='none'"/> {% endwith %} i know can use {% static your_url %} allways prefer this: i have images in myproject/static/img/ my {{static_url}} (settings.py variable) points myproject/static so in template do: <img src="{{static_url}}img/image_name.png" /> or using imagefield {% item in item_list%} <img src="{{ item.image.url }}" /> {% endfor %} in case do: <img src="{{ media_url }}{{ info.personid }}.jpg" /> {{ media_url }} ends / you need media_url defined in settings.py

objective c - UIView in cell -- Can't round right-hand corners -

Image
i have rectangular uiview object in static table view cell. have outlet object , i'm trying selectively round corners not round corners on right. here's looks in storyboard: the view want configure pale yellow one. red view serves no real purpose other confirming other view not being clipped. there no constraint issues or errors. here's how looks on 4s: i'm doing configuration in tableview:willdisplaycell:forrowatindexpath: with code ( myview outlet pale yellow view above): self.myview.layer.cornerradius = 5.0f; self.myview.clipstobounds = yes; i result: all 4 corners rounded. need selectively round corners, both top or both bottom corners. here code rounding 2 bottom corners: cashapelayer *shape = [[cashapelayer alloc] init]; shape.path = [uibezierpath bezierpathwithroundedrect:cgrectmake(0, 0, self.myview.bounds.size.width, self.myview.bounds.size.height) byroundingcorners:uirectcornerbottomleft | uirectco...

Convert string to timestamp in MonetDB -

how 1 convert string/varchar timestamp in monetdb ? like this, millisecond precision (to 6 decimal places, ideally): sql>select str_to_date('2008-09-19-18.40.09.812000', '%y-%m-%d-%h.%m.%6s'); +--------------------------+ | str_to_date_single_value | +==========================+ | 2008-09-19 | +--------------------------+ 1 tuple (0.312ms) i'm not sure whether str_to_date built in or whether created ages ago , forgot. create function str_to_date(s string, format string) returns date external name mtime."str_to_date"; edit: expected output like +---------------------------------+ | str_to_timestamp_single_value | +=================================+ | 2008-09-19 18:40:09.812000 | +---------------------------------+ monetdb time conversion functions listed in : [monetdb installation folder]\monetdb5\lib\monetdb5\createdb\13_date.sql. besides str_to_date function, there str_to_timestamp function. the sy...

wso2 - Can't add any API/WSDLs -

i trying run through quick start guide in api manager documentation , can't seem add wsdl/asmx endpoints. open fine in browser fail when adding through api pulisher tool. when enter in http://ws.cdyne.com/phoneverify/phoneverify.asmx endpoint , click test button, "invalid". same thing entering wsdl: http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl . i hope there way error details because "invalid" isn't helpful. i behind company proxy internet options (windows 8.1) setup , both of urls work in ie , chome.

cabal - Failing to install Haskell uniplate library -

i trying install elm , instructions install haskell , then sh> cabal update sh> cabal install cabal-install sh> cabal install -j elm elm-repl elm-reactor elm-get when do, cabal-install installation installs text-1.2.0.0 conflicts text-1.1.0.0 uniplate requires uniplate , dependents fail install. text-1.1.0.0 installed , present rejected in favour of text-1.2.0.0, though target needs text-1.1.0.0. is there way insist cabal use text-1.1.0.0? there way text-1.1.0.0 , text-1.2.0.0 co-exist? there way convince uniplate can accept text-1.2.0.0? or way make uniplate (or cabal) believe version text-1.1.0.0 installed? work? when explicitly try install version 1.1.0.0 of text, told reinstall break other packages. apparently downgrade , not co-installation. cabal not seem have option allow me install 2 versions of same library @ same time. if uninstall haskell , libraries , re-install elm (without installing cabal-install don't text-1.2.0.0 installed there no clash), ...

My Qt Creator IDE starts to type in Chinese instead of English -

Image
i working on qt quick application in qt creator. not working (f1) key , pressed keys ctrl + f1 etc. of sudden qt creator types chinese when edit code annoying. of course can't write code now. have attached picture. writing "red" writes chinese , brings menu in chinese don't what about.p lease help!

c# - How to actually logout from a website rather than simply redirecting to login page? -

i using response.redirect facility send user login page when clicks logout image button not perform logout operation , when user clicks backspace button in keyboard or button in browser user screen gets displayed back. how control situation in c# asp.net , have read posts saying session should cleared before redirecting dont know how apply in form. have enclosed coding below , request me out of situation in clear manner. in loginpage.aspx protected void btnlogin_click1(object sender, eventargs e) { var query = (from row in db.logins row.userid == txtuname.text && row.password == txtpassword.text select new { row.userid, row.password, row.admin_roll, row.manager_roll}).distinct(); if (query.count() > 0) { if (query.single().admin_roll == 1) { response.redirect("~/homepage.aspx"); } else if (query.single().manager_roll == 1) { response.redirect("~/detailspage.aspx"); } and in masperpage.master protected void imagebutton1_click(object sender, im...

swift - cannot create variadic tuple -

i have following functions func func1(str1: (string...),str: string){ //wrong 1 error "cannot create variadic tuple" } func func1((str1:string...),str: string){ //wrong 1 error "cannot create variadic tuple" } it shows error "cannot create variadic tuple" when try write above code..but works when try change parameter place below func func1(str: string,str1: (string...)){ //right 1 } func func1(str: string,str1: string...){ //right 1 } i changed parameter place , can me understand doing wrong ? variadic paramter must last parameter of function. swift documentation: a function may have @ 1 variadic parameter, , must appear last in parameter list, avoid ambiguity when calling function multiple parameters.

concurrency - How to do stress test with Jmeter step by step -

Image
i want stress test website. main aim find performance degrading point, in terms of number concurrent users , number of hits/sec (rps). i have used ultimate thread group , set number users 200 ramp of 200 seconds. have added throughput shaping timer ultimate thread group , set number of request per second 8. (if have 1 sampler hits per second controlled , 8 hits/sec. if have more 1 sampler hits not controlled , reached 20, 25,40 etc.. ended using constant throughput timer) let's go stress testing. find performance degrading point, in terms of number of concurrent users , hits per second, how should simulate load. eg: website's expected degradation point 300 users @ 12 requests per second, @ avg response time of site 800ms. support more users may 500 users , may 15 rps. if want add delay between each sample, should adding timers? thread group or samplers? thanks. timers have scope. timers documentation : note timers processed before each sampler in scope ...

scala - type mismatch compiler error when concatenating two maps using getOrElse -

i'm trying concatenate mutable immutable map in scala. case class result(val key: string, val number: int) object test extends app { val map1 = scala.collection.mutable.map[string, list[result]]() val map2: map[string, list[result]] = map("test" -> list(new result("0", 0))) map1 ++= map2.map(c => (c -> (c._2 + map1.getorelse(c._1, list[result]())))) } but compiler says: type mismatch; found : list[result] required: string when change listresult "test" compiler says: type mismatch; found : java.io.serializable required: string i'm quite confused. use getorelse wrong way? regards cyrill map1 ++= map2.map(c => (c -> (c._2 + map1.getorelse(c._1, list[result]())))) map on map gets passed each element of map. c (string, list[result]) . this (c -> (c._2 + map1.getorelse(c._1, list[result]())) is ((string, list[result), (list[result]). wrong. imagine meant (c._1 -> (c._2 + map1.geto...

multithreading - C++ trying to improve performance of pthread program -

i need improving speed of multithread program in c++ using pthreads. std::vector<double> solve_progon(std::vector<std::vector<double> > a, std::vector <double> b) { // solving } std::vector<double> solve(std::vector<double> left, std::vector<double> mid, std::vector<double> right, int j) { //solving } void * calc(void *thread) { long t = (long) thread; int start_index = t * (x_size / threads); int end_index = (t != threads - 1)?(t + 1) * (x_size / threads) - 1: x_size - 1; std::vector<std::vector<double> > local, next; std::vector<double> zeros; (int = 0; < y_size; i++) { zeros.push_back(0); } double cur_time = 0; while (cur_time < t) { (int = start_index; <= end_index; ++) { next.push_back(solve(phi[i - 1], phi[i], phi[i + 1], - start_index)); } cur_time += dt; pthread_barrier_wait(&bar); (int ...

visual studio 2015 - How to create an index for a string property in Entity Framework 7 -

i'm trying create code first model entity framework 7. i'm using released visual studio 2015 beta , following versions of entityframework packages (snippet project.json file): "entityframework.sqlserver": "7.0.0-beta1", "entityframework.commands": "7.0.0-beta1", it looks no data annotations available , i'm using onmodelcreating override , implemented (partly?) migrations create model. for now, primary keys , one-to-one relations work creating indices integer types. example: builder.entity<article>(e => { e.key(c => c.id); e.onetoone<category>(c => c.category); e.index(c => c.time).isunique(false); }); this snippet results in following migrations code generated: migrationbuilder.createtable("article", c => new { id = c.string(), // ... categoryidkey = c.int(nullable: false), time = c.d...

Get values from selected item in listview using asp.net c# -

i've tried many many different ways of displaying values listview either textbox or store in session , use later, none of works. i able make work gridview, can't make work listview. the idea id of selected user (in gridview) , id of selected club (in listview) after getting , storing both id's selected rows, can add club user. let's have table clubs has item: (4 columns, 1 row) id: 1 clubname: los angeles lakers city: los angeles state: california when press on first row, should highlight in different color, , store id either session or textbox. doesn't matter i'll decide later. can guys please me id ? this source code <asp:listview id="listview1" runat="server" datakeynames="klubid" datasourceid="sqldatasource1" onselectedindexchanged="listview1_selectedindexchanged" style="margin-right: 324px" onrowcreated="gridview1_rowcreated"> <alternatingitemtemplate...

java - Can't run Spark -

a few days ago extracted spark on machine (ubuntu) , made test run, seemed fine. today, think changed java paths, spark won't start. instead following error message: user@user:~/software/spark-1.1.0-bin-hadoop2.4$ ./bin/pyspark python 2.7.8 (default, oct 20 2014, 15:05:19) [gcc 4.9.1] on linux2 type "help", "copyright", "credits" or "license" more information. /home/user/software/spark-1.1.0-bin-hadoop2.4/bin/spark-class: line 180: /usr/lib/jvm/java-7-sun/bin/bin/java: no such file or directory traceback (most recent call last): file "/home/user/software/spark-1.1.0-bin-hadoop2.4/python/pyspark/shell.py", line 44, in <module> sc = sparkcontext(appname="pysparkshell", pyfiles=add_files) file "/home/user/software/spark-1.1.0-bin-hadoop2.4/python/pyspark/context.py", line 104, in __init__ sparkcontext._ensure_initialized(self, gateway=gateway) file "/home/user/software/spark-1.1.0-b...

sql server - SSIS - Integration Services Catalog Deployment & Logging -

we using ssis 2012. pretty new it. target custom logging execution start/end times of tasks/package record counts (both extraction & loading) in dft errors events please note in package there several dfts may contain multiple source(s) , destination(s). very while sifting info on internet, came across concept of ssis package catalog deployment functionality supposedly provides several log tables (e.g.[executions], [execution_parameter_values], [executable_statistics], [execution_data_statistics] etc) in ssisdb capture metadata pertaining package execution, performance, parameters, configurations etc extensively. i wish cognizant if understanding correct , if feature can leveraged capture log data auditing, performance analysis etc. also, keen know if feature log automatically ssisdb (when deployed thru catalog ) or if, required package(s) somehow need configured/setup avail functionality during execution.can enable such atalog**s these logging work automatically v...