Posts

Showing posts from June, 2012

Windows Phone 8 template in Visual Studio 2013 Preview -

Image
i running windows 8 x64 , have visual studio 2012 latest update , visual studio 2013 preview (latest update) installed. have windows phone sdk windows phone 8 development on visual studio 2012. i have read somewhere online there no sdk required windows phone 8 on visual studio 2013. new phone project option? found it, had modify vs2013 installation... (stupid me) idea leave online community? (if forget again, , cannot find source online lol!)

javascript - is it possible to implement moveable Toolbar with Ext.js, if yes, how to do that with my code? -

it toolbar want move free in position of desktop. need change it? maybe xtype'toolbar' or different extend'ext.panel.panel'?? ext.define('test.view.desktop.toolbar', { bodystyle: "background: #cae1ff; border: 4px solid red;", width: 500, height: 200, extend: 'ext.panel.panel', title: 'test', alias: "widget.testtoolbarx", requires: [ "ext.form.fieldset" ], dockeditems: [ { xtype: 'toolbar', dock: 'top', items: [ { xtype: 'tbtext', text: '<b style="font-size: 20px; margin-left: 300px; color: red;">i toolbar</b>', }, { xtype: 'tbfill', }, { text: 'report', menu: { items: [ { te...

css - How can I reorder/simplify HTML code to display on smaller screens? -

i have web page two-column layout desktop screens , html written in particular order achieve desired layout, basic set below: <div> <div class="left-column"> <h1>heading 1</h1> <p>text here...</p> </div> <div class="right-column"> <img> </div> </div> <!-- columns sit side side --> however, smaller screens, layout has simplified (one column, top > down) i'm finding difficult re-position these elements media queries because of original ordering of html. smaller screens, i'd layout follows: <div> <h1>heading 1</h1> <img> <p>text here...</p> </div> as can see, want 1 div , <img> move inbetween <h1> , <p> elements. how can achieve alternate html layout display on smaller screens? crude solution one's no-script one. keep duplicate img element in le...

html - create a link that when click opens some text on the same webpage -

hi new html , not know php or javascript. have simple html webpage picture in middle. want when click picture text appears describing picture without going new webpage. possible on html without using javascript or php , if how done? thanks it's possible similar details , summary html5 elements. see fiddle (works in chrome/safari/opera) <details> <summary><img src="image-source"> click here more information</summary> <p>more information</p> </details> due lack of browser support, not recommend using them. see caniuse.com - summary

ipad - Focus of cursor is not shifting to next UITextView in ios -

Image
this first question on ios i using 2 uitextview objects (textview1 , textview2) in view , each of them has character limit following scenario: initially user can enter textview1. when entered character limit of textview1 over, cursor automatically shift textview2. after building project, if user tap textview2 , try write it, cursor must shifted textview1 (because empty). i wrote code , works fine except third scenario, user can enter textview1 focus still on textview2 steps reproduce: build project user tap textview2 first , try write something. according written code, focus remain in textview2 user writing textview1 (see attachment) here snapshot: here written code: - (void)viewdidload { [super viewdidload]; [self.textview1 becomefirstresponder]; } - (void)textviewdidchange:(uitextview *)textview{ nsinteger restrictedlengthfortextview1 = 110; nsinteger restrictedlengthfortextview2 = 130; nsstring *temp=textview.text; if(textview == self.tex...

wso2esb - How can we receive the url into wso2 esb and give sucess response back to them -

i going receive url(ex:- www.google.com) ws02 esb , send response them. how can receive url's(ex:- www.google.com) wso2 esb , give sucess response them. if want response calling party success http response. please set below property on receiving path. <property action="set" name="out_only" value="true"/> <property action="set" name="force_sc_accepted" scope="axis2" value="true"/>

json - How to send cross-domain request to google places api (seems it does'nt support jsonp)? -

i trying make ajax call google places api reviews business no success. using crossdomain : true,datatype: 'jsonp', is giving error uncaught syntaxerror: unexpected token : i think doesn't support jsonp ..is there way it? thanks please try following code response google place api $.ajax({ type: 'get', url: 'https://maps.googleapis.com/maps/api/place/autocomplete/json?&input=houston&sensor=true&types=(cities)&key=<your key>', async: false, jsonpcallback: 'jsoncallback', contenttype: "application/json", datatype: 'jsonp', success: function (json) { console.dir(json.sites); }, error: function (e) { console.log(e.message); } }); google responds in form of jsonp callback in place api.kindly replace key in url

angularjs - Binding model from controller -

how can binding model controller ? here code angular.module('elnapp') .controller('gridctrl', function ($scope, $http, $routeparams, $location, programservice) { $scope.gridoptions = { data: 'mydata', enablepaging: true, showfooter: true, totalserveritems:'totalserveritems', pagingoptions: $scope.pagingoptions, filteroptions: $scope.filteroptions, selecteditems: $scope.myselections, multiselect: false, afterselectionchange: function (data) { $scope.program = $scope.myselections[0]; $scope.program = $scope.myselections[0].programid; programservice.get({ id: $scope.program }, function (result) { data = { 'program': result }; }); $location.path('/program/edit/'+$scope.program); } };}); edit html <form ng-submit="save()"> <input type="hidden" ng-model="progr...

http - "Save As" popup in response to a POST request? -

is possible browser popup save as... dialog when doing post (rather get) request? using spring framework, i'm trying build service receive data (a two-dimensional json array), , produce excel file user prompted download. by doing request, eg browsing directly url, can browser display popup setting headers similar this: response.setheader("content-disposition", "attachment; filename=" + filename) response.setcontenttype("application/vnd.ms-excel") i need allow client post data used build excel file though, implies post request. same headers returned, no popup. is there way achieve this, or popup appear requests? i'm thinking two-step process; 1) allow client post data, , return sort of reference key, 2) allow client request , include key, , return relevant headers cause browser popup dialog. any other thoughts on how this? thanks it's possible. i'm not sure did wrong first time tried out.

Android Async Task State -

i using asynctask in fragment doing background operations. able handle state of async task in fragments using setretaininstance(true) i.e., during orientation changes. the problem is, want save status of async task(whether pending or finished) when call activity fragment. because when come activity fragment async task not being retained. note: setretaininstance(true) works during orientation changes, onsaveinstancestate(bundle bundle) wont work if setretaininstance(true) written. onsaveintancestate(bundle bundle) works when fragment or activity called. this example straight api demos retains progress on orientation changes. please use , modify per need. code simple , once understand it, piece of cake handle progress on orientation changes. can ignore mthread , implement asynctask there, have look: import com.example.android.apis.r; import android.app.activity; import android.app.fragment; import android.app.fragmentmanager; import android.os.bundle; impo...

asp.net - Switch css files dynamically -

i trying switch css files dynamically in asp.net using c#. when click on button1/ button2 code working fine , css file switching on/off, when open page css deactivated. when refresh page css file deactivated. example> home (deafault) ! ! contact when click on about us , page opens, css file becomes deactivated , default 1 activated. i want css file not deactivated if click on about us after switching css file. please advise me. below code have written in master page <head> <link id="lnkcss" runat="server" href = "~/css/main-style.css.css" rel="stylesheet" type="text/css" /> </head> <form> <asp:button id="button1" runat="server" text="css 1" onclick="changecss" commandargument="theme1.css" /> <asp:button id="button2" runat="server" text="css 2" onclick="changecss" commandar...

windows - Add a progress bar to PST copy batch file -

i have basis of copy script (using xcopy) copy on files migrating on 1 pc (xp win7 in case). here code: ... xcopy /i /y /e /f "c:\documents , settings\%username%\favorites\*.*" h:\restore\ie favorites xcopy /i /y /s /f "c:\documents , settings\%username%\desktop" h:\restore\desktop xcopy /i /y /f "c:\documents , settings\%username%\application data\microsoft\outlook\*.nk2" h:\restore\outlook-nk2 xcopy /i /y /f "c:\documents , settings\%username%\application data\microsoft\signatures" h:\restore\signatures xcopy /i /y /f "c:\documents , settings\%username%\application data\microsoft\office\*.acl" h:\restore\office-autocorrectlists xcopy /i /y /f "c:\documents , settings\%username%\local settings\application data\microsoft\outlook\*.pst" h:\restore\pst1 xcopy /i /y /f "c:\documents , settings\%username%\application data\microsoft\outlook\*.pst" h:\restore\pst2 xcopy /i /y /f "c:\users\%username%\appdata\r...

php - Replace linendings in csv before open it -

i have csv read fopen , fgetcsv: ini_set('auto_detect_line_endings', true); $handle = fopen($uploaddir.$filename,"r"); while (($acell = fgetcsv($handle, 1000, ";")) !== false) { //go through rows } my problem csv windows have crlf (\r\n) or lf (\n) linefeed characters. have csv mac uses crlf , cr (mostly in text columns st. html text) the cr breaks fgetcsv not correct structure of columns , rows in header columns "defined", have windoof ones. how can replace crs (\r) lf (\n) in csv before going through lines? edit tried passerbys idea works. thx tips $file_contents = file_get_contents($uploaddir.$filename); $file_cont_tmp = str_replace("\r","\r\n",$file_contents); $file_cont_new = str_replace("\r\n\n","\r\n",$file_cont_tmp); file_put_contents($uploaddir.$filename,$file_cont_new);

html - Error in uploading image and text file to server using php -

php file : form action file in php. successful in uploading images text files producing 'invalid file error'. may error , how resolve it? <?php $allowedexts = array("gif", "jpeg", "jpg", "png", "txt"); $temp = explode(".", $_files["file"]["name"]); $extension = end($temp); if ((($_files["file"]["type"] == "image/gif") || ($_files["file"]["type"] == "image/jpeg") || ($_files["file"]["type"] == "image/jpg") || ($_files["file"]["type"] == "image/pjpeg") || ($_files["file"]["type"] == "image/x-png") || ($_files["file"]["type"] == "image/png") || ($_files["file"]["type"] == "text/txt")) && ($_files["file"]["size"] < 20000000) && in_array...

imaplib - How to check whether IMAP-IDLE works? -

i noticed imap server seems support idle notifications arrive late. asking myself: how can check whether idle works (or mail client)? inspired http://pymotw.com/2/imaplib/ , can use following python scripts check if , how fast push notification via idle work: imaplib_connect.py import imaplib import configparser import os def open_connection(verbose=false): # read config file config = configparser.configparser() config.read([os.path.abspath('settings.ini')]) # connect server hostname = config.get('server', 'hostname') if verbose: print 'connecting to', hostname connection = imaplib.imap4_ssl(hostname) # login our account username = config.get('account', 'username') password = config.get('account', 'password') if verbose: print 'logging in as', username connection.login(username, password) return connection if __name__ == '__main__': ...

ZK: enable button in listcell only for the selected item of a listbox -

in next listbox load elements template: <listbox model="@load(vm.resaccepted)" selecteditem="@bind(vm.selresaccepted)"> <template name="model"> <listitem> <listcell label="@load(each.eventname)" /> <listcell label="@load(each.username)" /> <listcell> <button image="/img/button_mail.png"/> </listcell> </listitem> </template> </listbox> my goal enable button of listitem only row user selects. to this, try <button disabled="@load(vm.selresaccepted.id=each.id?'false':'true')" /> checking if unique field id same of selected element, fails. any appreciated. you can use eq equals comparison: <button disabled="@load(vm.selresaccepted.id eq each.id?'false':'true')" /> or maybe better: disabled when selected item not current item ...

r - ggplot2 wind time series with arrows/vectors -

Image
from meteorological data (hourly values of temperature, wind , humidity) managed plot time series of wind speed , direction. add wind vectors on time series plot. here can see output (arrows drawn on actual plot). i using ggplot2, been looking through stackoverflow, ggplot2 package docs (will continue) no solution found. idea or indication starting point. thanks in advance edit question suggested in comment @slowlearner add here code , data make reproducible example. looks geom_segment trick. managed calculate yend in geom_segment can't figure out how find xend x axis time axis. i've got wind speed , direction data can calculate x,y wind components geom_segment x needs converted time format. here code used plot (temperature) , data for (i in 1:2 ) { rams=subset(data,data$stat_id %in% i) tore=subset(torre,torre$stat_id %in% i) # gràfica en ggplot # gráfica de evolución temporal de las estaciones de la zona gtitol=places$nom[places$stat_id == i] myplot=ggpl...

active directory - Access Management Architecture -

i have come recommendation on how design , create access rights. (just mention - beginner in qlikview, company work, decided buy tool). tale of tape is: we have production , development servers. what has cleared how colleagues develop dashboards/applications. will develop on local machines or using remote access on development server, have created "indevelopment" folder , gave access rights 2 groups "intern" , "extern" (they can see developing applications) it should not alowed every developer can see every other developer doing the security concept should defined windows active directory groups the users following: qv developers (in "operations" , in "it" department, therefore - 2 groups) - these users doing loading, transformation, creating data models.. qv designers (in "operations" , in "it" department, therefore - 2 groups) - these users create dashboard layouts qv users/testers (in "o...

compiler construction - PCL - Glib Compiling from source, FFI linking -

i need install pcl (point cloud library) on linux server without root access. downloaded source , checked dependences. , here go... these dependencies i've found: pcl --boost ----zlib ----bzip --eigen --flann ----hdf5 ----libusb ------udev --------glib ----------libffi ----------zlib --vtk i need compile glib source. glib requires ffi libraries downloaded them, compiled , installed them in /home/franz/downloads/libffi-3.0.13/installed then set these variables: ld_library_path=/home/franz/downloads/libffi-3.0.13/installed/lib libffi_cflags="-i/home/franz/downloads/libffi-3.0.13/installed/lib/libffi-3.0.13/include" libffi_libs="-lffi -l/home/franz/downloads/libffi-3.0.13/installed/lib" then ./configure , make. got these errors: make[4]: entering directory `/home/franz/downloads/glib-2.37.5/gobject' /bin/bash ../libtool --tag=cc --mode=link gcc -wall -wstrict-prototypes -werror=declaration-after-statement -werror=missing-prototy...

google apps script - SELECT or Filter from JSON(?) Array -

i have call large json data set. has multiple items , each item has multiple pieces of information. want output 1 item's single piece of information. need filter down information 1 item or use select statement such might in sql. tried following, receive error: error: typeerror: cannot find function filter in object [object object]. (line 28, file "gwspidy api") . can't life of me figure out how boil data down 1 item. hard test code in google apps scripting. function test3(itemid) { var myurl = "http://www.gw2spidy.com/api/v0.9/json/all-items/all"; var jsondata = urlfetchapp.fetch(myurl); var jsonstring = jsondata.getcontenttext(); var jsonarray = json.parse(jsonstring).result; var jsonfilter = jsonarray.filter(function(itemid,jsonarray){if(jsonarray.data_id.match(itemid)) {return itemid;}}); var adjustedvalue = (jsonfilter.min_sale_unit_price / 100); return adjustedvalue; } also, secondary question regards cache service. asked previou...

java - find out the log value of a number from input -

i have edittext field users input. user can enter values ten digit number.when clicking on button, need show log [ mathematics log ] value of number in double precision. that showned below. if input xxxxxxxxxx [ consider number ] the output must yy.yy. package com.example.logvalue; import android.os.bundle; import android.app.activity; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.toast; public class main extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); edittext edit = (edittext) findviewbyid(r.id.edittext1); final int noo = integer.parseint(edit.gettext().tostring()); button b1 = (button) findviewbyid(r.id.button1); b1.setonclicklistener(new onclicklistener() { public void onclick(view arg0) { toast.mak...

optimization - Slightly different loops in python / Minimize code -

i want minify rows of code. have 2 loops difference 2 lines. possible (functions or classes) change lines in each occasion? 2 loops are: cursor = '' while true: data = api_like_query(id,cursor) #more code in data['data']: ids_likes += i['id']+' , ' #more code and cursor = '' while true: data = api_com_query(id,cursor) #more code in data['data']: ids_likes += i['from']['id']+' , ' #more code more code same chunk of code used. difference in function call (line 3) , different dictionary object in line 6. you can create function quite easily: def do_stuff(api_func, get_data_func): cursor = '' while true: data = api_func(id, cursor) #more code in data['data']: ids_likes += get_data_func(i) + ', ' #more code then first loop can reproduced with: do_stuff(api_like_query, l...

java - Robot class - If a Button Is Pressed? -

i have read , understood how robot class in java works. thing ask, how press , release mouse button inside if statement. example make click if (and right after) space button pressed/released. use code: try { robot robot = new robot(); if (/*insert statement here*/) { try { robot.mousepress(inputevent.button1_mask); robot.mouserelease(inputevent.button1_mask); } catch (interruptedexception ex) {} } } catch (awtexception e) {} unfortunately, there isn't way directly control hardware (well, in fact there is , have use jni/jna), means can't check if key pressed. you can use keybindings bind space key action, when spacebar pressed set flag true , when it's released set flag false . in order use solution, application has gui application, won't work console applications. action pressedaction = new abstractaction() { public void actionperformed(actionevent e) { spacebarpressed = true; } }; action releasedaction = ne...

cmd - Removing N rows of multiple CSV and then Merging them -

i have folder multiple (dozens) csv files, , need merge them in bigger csv, removing first n rows of each individual file, , wanted in bulk operation. i've seen here solutions "more" command, use have run once each small csv, , that's want avoid - have process daily. to merge csvs, can use (all csvs in same folder): copy *.csv alldata.csv is there similar approach, wildcards or that, remove first n rows of csvs? btw i'm running windows, can install programs if necessary. this super easy in autohotkey . assuming want skip first 7 rows, script this: (untested...) n = 7 loop, *.csv { tooltip, reading %a_loopfilename% loop, read, %a_loopfilename% { if (a_index<=n) continue fileappend, %a_loopreadline%`n, alldata.csv } } tooltip, msgbox, done

c# - Develop a custom authentication and authorization system in consistence with web form application -

Image
i creating new asp.net mvc 4 application (actually first mvc application) part of previous asp.net web forms application. have never used asp.net inbuilt authentication methods in of project. new mvc 4 app published on sub-domain of previous app. login done previous app. return url should provided mvc app return current page if not logged in. however, new user registration, account recovery options developed in previous web forms application , don't want replicate them in new mvc application. a cookie token token number issued web form application on event of successful login shared domain *.maindomain.com . now want merge own token validation method asp.net inbuilt methods can make use of authorize , other security related options in new mvc application. in previous application have developed custom user validation system in following way. first, have following related sql server tables and following classes public class token { public static uint generatet...

Systrace on Android 4.3 -

i'm trying measure performance attributes of app through systrace using new trace api introduced in jb 4.3. idea similar use of traceview method profiling, i.e. can measure specific code section using trace.beginsection , trace.endsection . however, when run systrace through python script provided in android tools, don't see relating sections specified above calls. am missing something? correct way of accessing systrace output? see in documentation trace calls "writes trace events system trace buffer", have no idea how access trace buffer. any appreciated. you have provide additional argument systrace command: -app=pkgname (or -a pkgname ) where, pkgname package name app manifest. it's name see in ps output (which possibly more relevant, since that's it's matching against). there example here .

Google script : cannot access e.user on edit change -

the following algorithm: make form in script editor, create script function: function displayuser(e){ logger.log(e.user); logger.log(e.user.getemail()); } create trigger runs displayuser after event from spreadsheet on edit . edit spreadsheet of form the logging output displays: undefined the execution transcript says: execution failed: typeerror: cannot call method "getemail" of undefined. (line 3, file "code") however, google documentation specifies e.user : always returns user object, representing owner of spreadsheet it's not case here e.user undefined. i used command before new access right management system of google, , worked fine - returned information owner of spreadsheet. did make mistake? you're right, doesn't return owner of ss. when renamed onedit() , working simple trigger return effective user of sheet guess that's not need ;-) - never used before cannot confirm worked before ...

asp.net mvc - LINQ to SQL - Filtering the dataset between two nested collections -

i have mvc 3 project in visual studio c#. have linq sql query works fine , following example listed elsewhere on stackoverflow: comparing 2 lists using linq sql i have been able reduce results 2 nested collections match. bit of code did trick (example link above): var anydesiredskills = canidateskills.any( c => desiredskills.select( ds => ds.skillid ).contains( c.skillid ) ); i've adapted successfully, need able filter records using more 1 condition. wondering if able adapt above show how include more 1 condition? to give background on goal is: a search page can select number of contacts each contact added search criteria may/may not have 'role' assigned. if role present should factored in query. results returned based on dynamic criteria. thanks in advance , :o) it sounds you're looking like: var desiredskillids = desiredskills.select(_=>_.skillid).tolist(); var matchingcontacts = contact in contacts contact.role == null...

c# - 401 Unauthorized error web api mvc windows authentication -

Image
i getting 401 unauthorized error . web service written in mvc . in iis configured use windows authentication. below screen shot of fiddler when hit url browser gives me popup window enter user name , password. how can avoid popup window? i calling web api window service. i suspect 2 web services may hosted on same server. in case, problem may caused loopback check. in order test, try referencing service without using qualified domain name , see if works. if does, use following steps specify host names on local computer. method 1: specify host names (preferred method if ntlm authentication desired) ( http://support.microsoft.com/kb/896861 ) to specify host names mapped loopback address , can connect web sites on computer, follow these steps: set disablestrictnamechecking registry entry 1. more information how this, click following article number view article in microsoft knowledge base: 281308 connecting smb share on windows 2000-based computer or windows serve...

How to structure a booking system in ruby on rails -

my goal create reservation system in ruby(v=1.9.3p231) on rails (v=3.2.13). should reservation system hotel. should able let create rooms , perform reservations rooms. of course need valdidations if room reserved. after many hours of trying out stuff, think structur failing. please give me hints, how set reservation-system? tried 2 different ways: 1. created search-form. showed me available room, don't know how specific requests. how use time period (arrival - depature). 2. tried directly reservation (that means booking , validation in one). problem here have no idea how create correct databases , relations. anybody draft layout of project? or tell me how many controllers needed. thanks in advance.

sql - How to use a total of a computed column as a value in another query? -

background :- have scenario find out value of items have quoted on projects have been named preferred supplier , value of items not named for. the tables have @ disposal dba.lead -> dba.a_quotelne columns decide whether items specified or not : "dba"."a_quotelne"."altlineref" if altlineref = 0 not named, if = 1 have been named. first line of each group of items contains 1 or 0. rest null. example "leadno" "lead_desc" "lineno" "calc_value" "altlineref" "calc_groupingref" 1 canary wharf 1 10 0 1000 1 canary wharf 2 16 null 1000 1 canary wharf 3 12 null 1000 1 canary wharf 4 12 1 1001 1 canary wharf 5 13 ...

c++ - Use throw_with_nested and catch nested exception -

i std::throw_with_nested in c++11 since emulates java's printstacktrace() right curious how catch nested exception, example: void f() { try { throw someexception(); } catch( ... ) { std::throw_with_nested( std::runtime_error( "inside f()" ) ); } } void g() { try { f(); } catch( someexception & e ) { // want catch someexception here, not std::runtime_error, :( // } } previously, thought std::throw_with_nested generates new exception multiply derived 2 exceptions (std::runtime_error , someexception) after reading online tutorial, encapsulates someexception within std::exception_ptr , it's probabaly why canonot catch it. then realized can fix using std::rethrow_if_nested( e ) above case 2 level easy handle thinking more general situation 10 level folded , don't want write std::rethrow_if_nested 10 times handle it. any suggestions appreciated. unwrapping std::nested_exception readily acc...

iphone - Do something when audio stops -

im wondering of how make app aware of when audio stops. have 30 minute audio recorded thats triggered when hit play button. play button changed pause button. pause button switch play button when audio complete. using avaudioplayer. how do this? thanks! the avaudioplayerdelegate contains method called audioplayerdidfinishplaying:successfully: . override method , put play/pause button login in there. something this: in .h #import <uikit/uikit.h> #import "avfoundation/avaudioplayer.h" @interface viewcontroller : uiviewcontroller<avaudioplayerdelegate> @end in .m @implementation viewcontroller{ avaudioplayer *_player; } - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. _player.delegate = self; } -(void)audioplayerdidfinishplaying:(avaudioplayer *)player successfully:(bool)flag{ //show play button } @end more info on avaudioplayerdelegate here

asp.net - Page Load only partially fires in production -

i have .aspx file .aspx.vb code behind page working fine in visual studio 2010 not in production. most disturbing page_load (non postback) working of lines. here code protected sub page_load(byval sender object, byval e system.eventargs) handles me.load dim shortages_filter string = "" if not ispostback ' next 4 lines work in localhost, don't work in production alert_label.text = "not postback" shortages_filter += "(num_short_qty > 0) " ddl_shortages_list.items.insert(0, new listitem("shortages list filter", "1=1")) ddl_shortages_list.items.insert(1, new listitem("show shortages list", shortages_filter)) ' next 6 lines work in both environments pref_datasource.filterparameters.add("user_name_param", replace(system.web.httpcontext.current.request.servervariables("logon_user"), "boumatic\", "")) pref_dat...

html - Flexbox: Justify content: flex-end -

i have problems implementing justify content using flexbox. want language , social media bar floating right in flex container. i'm using chrome, have -webkit prefixes in code snippet. doing wrong? according w3c spec , chrome dev tools, approach should correct, maybe i'm wrong. thanks in advance replies. code snippet: html: <div id="upbar"> <div id="languagepanel"> <ul> <li><a href="#">eng</a></li> <li><a href="#">ger</a></li> <li><a href="#">fr</a></li> </ul> </div> <div id="media"> <ul> <li><a href="#">fb</a></li> <li><a href="#">mail</a></li> </ul> </div> ...

Adding new columns in Django models -

this question has answer here: altering database tables in django 8 answers i have created sample django application multiple models within , populated data. now, need add new column 1 of models? here concerns? what happen if syncdb after adding column model , alter table , add new column? or create new table after deleting columns? is there better way tackle issue? syncdb not work altering database tables. here the documentation (readup on : syncdb not alter existing tables) a clean way achieve use 3rd party tool such django south handle migrations (handle alter table scripts in case) you. here step step tutorial on south, , here official documentation on south

what if I don't want to return anything in jquery ajax call? -

i calling ajax function $.ajax({ url: $.grails.createlink('class', 'action'), data: {id: id1}, async: false }); so calling grails method here def action = { } now @ end of action method if don't return js error 'sorry, error occurred' explicitly specified ' render "" ' @ end of action method. is there way avoid render? if don't return anything, grails try , render view grails-app/views/controller/action.gsp i expect doesn't exist, you'll 404 you can add empty view, render blank template, or doing (the shortest option)

sql - Java DB / Derby - white space in table name - how to escape? -

java db / derby - white space in table (column) name - how escape? in mysql database escaped `` (grave accent), if trying execute query (java db) like: create table `etc etc` (id int primary key, title varchar(12)) i error: java.sql.sqlsyntaxerrorexception: lexical error @ line 1, column 14. encountered: "`" (96), after : "". is there solution? edited: thanks comprehensive answers indeed. found interesting thing (java db): it ok create table this: create table "etc etc" (id int primary key, title varchar(12)) and later results: select * "etc etc" but if create table (without white space , quotes): create table etc_etc (id int primary key, title varchar(12)) and later results (with double quotes, example, don't needed): select * "etc_etc" i error: java.sql.sqlsyntaxerrorexception: table/view 'etc_etc' not exist. so conclusion if quotes used while creating table (it not importan...

amazon web services - How to setup Cloudera Hadoop Cluster on EC2 - S3 or EBS Instances? -

how setup cloudera hadoop cluster on ec2 - s3 or ebs instances? have cloudera manager on 1 of ec2 instance has ebs storage. when start creating hadoop cluster cloudera manager starts creating new ec2 instances per number of node specify. request instance issue generates "instance store" instances. how can provide existing instances has ebs or s3 storage? any idea? this design: why cloudera manager prefer instance store-backed on ebs-backed amis? although ebs volumes offer persistent storage, network-attached , charge per i/o request, not suitable hadoop deployments. if wish experiment ebs-backed instances, can use custom ebs ami. source

vb.net - Cast(Of ?) from UIElement -

in silverlight custom controls in the uielementcollection of stackpanel . want list of them specific value. there divelements in container. returns nothing when know have 1 or more. know can make simple loop , cast types inline, want better linq , cast(of tresult) . attempt @ casting: dim mylist = trycast(spdivs.children.where(function(o) directcast(o, divelement).elementparent bcomm).cast(of divelement)(), list(of divelement)) the problem can't cast list(of divelement) . collection uielementcollection , not list(of t) . you build new list, though. can simplified using oftype instead of casting manually: dim mylist = spdivs.children.oftype(of divelement)() .where(function(o) o.elementparent bcomm) .tolist()

javascript - Is it possible to fix lower right corner of div to screen w.r.t scroll up/down -

i want make div vertically expand when scroll down , vertically contract when scroll such lower right corner approximately maintain same position on browser screen. #resizable { position:relative; float:left; width: 300px; height: 200px; padding: 0.7em; top:8px; left:2px; word-wrap: break-word;} div need relative , adjustable align outer text wrap around it. $(function() { $( "#resizable" ).resizable();}); http://jsfiddle.net/eyasq/1/ i able without fixed positioning using bit of javascript: http://jsfiddle.net/eyasq/5/ $(document).scroll(function() { var top = $(document).scrolltop(); $("#resizable").css("margintop", top); }); the scroll event listener update top margin of #resizable div whenever page scrolled. div appear stay in place text reflow around it. effect little unusual, seems match requirements.

c# - Microsoft SpeechSynthesizer (TTS) Voice Crackle -

when using microsoft speechsynthesizer voices crackle, fuzy... // initialize new instance of speechsynthesizer. speechsynthesizer synth = new speechsynthesizer(); // configure audio output. synth.setoutputtodefaultaudiodevice(); // speak string. synth.speak("this example demonstrates basic use of speech synthesizer"); i assume related cpu usage. happend on powerfull computer too. there best practices or workaroud ? adjust rate downwards, until crackling disappears.

visual studio 2012 - Team foundation error Could not load file or assembly Microsoft.Practices.EnterpriseLibrary.Common -

i trying edit build definition of 1 of builds on visual studio (specifically, changing password). finished , press ctrl+s following error: team foundation error could not load file or assembly 'microsoft.practices.enterpriselibrary.common, version=5.0.414.0, culture=neutral, publickeytoken=31bf2856ad364e35' or 1 of dependencies. system cannot find file specified. i have looked build, dev , production servers , can see file , correct version (5.0.414.0). idea going wrong here? this issue entirely visual studio on local machine, not tfs. apparently when edit build definition, team explorer 2010 assumes you're doing open solution. still not know why not find assembly when in bin\debug directory, there go. the solution simple closing , re-opening visual studio. able edit , save definition new parameter , promote production appropriately.

javascript - Why are these two jQuery functions both not firing on click? -

okay, have 2 jquery functions. 1 of them simple explode effect on div. other function enhances explode effect sending particles in circle around div. when click on div both functions set, fire explode effect , not function debris on site. something strange in jsfiddle debris working , not explode, on site explode effect working not debris. here jsfiddle example: jsfiddle.net/fyb98/3/ note : i'm using same jquery version both site , jsfiddle example, that's jquery-1.9.1. this code <style> .debris { display: none; position: absolute; width: 28px; height: 28px; background-color: #ff00ff; opacity: 1.0; overflow: hidden; border-radius: 8px; } #bubble { position:absolute; background-color: #ff0000; left:150px; top:150px; width:32px; height:32px; border-radius: 8px; z-index: 9; } </style> <div id="content"> <div id="bubble"></div> <div id="dummy_debris" class="d...

java - Redundant methods across several unit tests/classes -

say in main code, you've got this: myclass.java public class myclass { public list<obj1> create(list<obja> list) { return (new myclasscreator()).create(list); } // similar methods other crud operations } myclasscreator.java public class myclasscreator { obj1maker obj1maker = new obj1maker(); public list<obj1> create(list<obja> list) { list<obj1> converted = new list<obj1>(); for(obja obja : list) converted.add(obj1maker.convert(obja)); return converted; } } obj1maker.java public class obj1maker { public obj1 convert(obja obja) { obj1 obj1 = new obj1(); obj1.setprop(formatobjaproperty(obja)); return obj1; } private string formatobjaproperty(obja obja) { // obja prop , manipulation on } } assume unit test obj1maker done, , involves method makeobjamock() mocks complex object a. my questions: for unit testing ...

java ee - removing project name from j2ee web application URL -

i have web dynamic project in eclipse , index.html in webapps folder, able access : http://localhost:8080/javatest i want access application : http://localhost:8080 i tried changing context-root "/" right click on project->properties->web project settings, on http://localhost:8080/ getting requested resource not found, , application still running on http://localhost:8080/javatest . this web.xml : <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>javatest</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome...

c# - asp.net Label cannot ever be modified from code-behind -

i have panel/updatepanel contains asp.net label. seems under no circumstances whatsoever text field of control can changed. code: <asp:panel runat="server" id="panel1" width="100%"> <asp:updatepanel runat="server" id="updroutegroup" updatemode="conditional"> <triggers> <asp:postbacktrigger controlid="btndisableonhold" /> </triggers> <contenttemplate> <asp:panel id="pnlimpexcel" runat="server" > <div style="width:100%"> <table colspan="0" width="100%" cellpadding="0" cellspacing="0"> <tr> <th colspan="3"> on hold music </th> </tr> <tr style="height:10px"></tr> <tr> <td a...

oracle - How do I generate combinations based on column values in SQL? (Is this even possible?) -

i'm trying make new column in table contents based off values of existing pair of columns. if have table like(id not primary key) id | value | new column(the column want) 1 a:apple 1 b a:orange 2 apple b:apple 2 orange b:orange im novice sql, insight here helpful. btw, im using oracle if matters. additional details: im looking pair values:values based on fact id's dont match assuming want values id1 paired values id2, can cross-join table itself, filtered on id: select t1.value ||':'|| t2.value my_table t1 cross join my_table t2 t1.id = 1 , t2.id = 2; sql fiddle .

python - Getting HTML to linebreak in django admin's display -

Image
i have django display the code doing is: class purchaseorder(models.model): product = models.manytomanyfield('product', null =true) def get_products(self): return "\n".join([p.products p in self.product.all()]) class product(models.model): products = models.charfield(max_length=256, null =true) def __unicode__(self): return self.products views.py: class purchaseorderadmin(admin.modeladmin): fields = ['product'] list_display = ('get_products') so i've attempted this: from django.utils.html import format_html def get_products(self): return format_html(" <p> </p>").join([p.products p in self.product.all()]) however, it's still not returning in html. or rather, way want in image you need set field allow tags html show in admin list display: class purchaseorder(models.model): product = models.manytomanyfield('product', null =true) de...