Posts

Showing posts from February, 2012

c++ - Forwarding tuple arguments to a function in VS2012 -

i'm trying forward tuple arguments function in vs2012 (update 3). my understanding this possible in c++11 using variadic templates, unfortunately, vs2012 supports "fake" variadics. auto values = std::make_tuple(4, 8); auto add = [](int a, int b) -> int { return + b; }; auto result = forward_to_function(add, values); i'm hoping there way in vs2012 implement functionality shown above, i'm not sure, possible without true variadics? i saw mention of such "exploder" in channel 9 video. think recent "going native" (andrei?) reported having full general solution, not presented. there less complete workable solutions talked about. if can wait, current vs preview compiler has true variadics. look how boost it: implement whole bunch of args, special flag type default argument indicates missing. normally, function (not class) overload it. overloading templated functions fine, too: arguments forward_to_function must exp

java - How to check a String for multiple items in a String ArrayList -

i have arraylist , add strings i'm checking this. arraylist<string> al = new arraylist<string>(); al.add("is"); al.add("the"); then have method returns match found in string in arraylist. public static string getword(string str1, arraylist<string> list) { for(int = 0; < list.size(); i++) { if(str1.tolowercase().contains(list.get(i))) { return list.get(i); } } return false; } although when want check string has more 1 match returns fist 1 added arraylist, so al.add("is"); al.add("the"); it return "is" if add them this al.add("the"); al.add("is"); it return "the" i need way of determining how many matches there , returning them individually. try use map hold, key string in list , value count matched public static void main(string[] args) throws exception { list<string> list = new a

Regex replace for String, 3 characters from the end -

i have been able add space string in input field using following: onkeypress="this.value=this.value.replace(/^(\w{5})(?=\w)/,'$1 ')" but count start end of line, , add space after user input has stopped. i've tried onblur, not seem work in chrome. any tips? thanks just guess - onkeypress="this.value=this.value.replace(/(\w{5})(?=\w$)/,'$1 ')"

html - Express/Solve formula with Javascript -

i trying create form allow variables inputted , given formula solved. stumbling on how express formula , how make first 2 variables understood exponent. here complete formula works in excel (cell labels replaced input names html): =varnk * varqr * ( 273 + vart ) / ( 273 + varto ) * varpp / varp * varkq * varkak note "varnk" , "varqr" values entered exponents - i.e. 97.53^12 edit: actual formula (link image don't have enough rep post directly)- http://mattk.net/dwformula1.png here attempted make work. wasn't sure correct way assemble final output, ideally want figure out how make single button operation. <head> <script> function docalcone() { var varnk = document.getelementbyid('varnk').value; var varqr = document.getelementbyid('varqr').value; var vart = document.getelementbyid('vart').value; var varto = document.getelementbyid('varto').value;

php - CakePHP-Ask about the logo and other affections? -

Image
sorry have make new question this, because don't know keywords ask problem. i studying cakephp. when make page query list user db , make page navigation inside. ok when add logo top of website. ok if stay on page, when click navigation page. disappear (look link of image broken). this 1 ok when don't click navigation page. and 1 broken. my question is: how fix problem. because not logo, things else have same problem too, want wil appeared on everypage or action. can me this. update: have find way solve problem. use helper make img. instead, use html tag show img. use helper in cakephp like: <?php echo $this->html->image ( 'cakeicon.jpg', array ( 'alt'=>'td-cakephp', 'height'=>'50px', 'width'=>'50px' ) ); ?> i update research situation can solved more easily.

javascript - Can Sequelize.js for Node.js define a table where the Primary Key is not named 'id'? -

i have simple mysql table named things . things table has 3 columns: column name data type =========== ============ thing_id int // auto increment primary key thing_name varchar(255) thing_size int as far can tell sequelize.js expects/requires primary key named 'id'. is there way use standard sequelize.define() call define things table? if not, there way? try var test = sequelize.define( 'things', { thing_id : {type: sequelize.integer(11), primarykey: true, autoincrement: true}, thing_name : {type: sequelize.string(255)}, thing_size : {type: sequelize.integer} },{ }); test.sync() .success(function(){ console.log('table created'); }) .error(function(error){ console.log('failed', error) })

download stock data with R -

i~m trying download stock data r these code: #load packages library(stockportfolio) library(quadprog) #get data of returns stocks <- c( "spy", "efa", "iwm", "vwo", "lqd", "hyg") returns <- getreturns(names(stocks), freq="week") but i'm getting error: it's not possible open connection: http status: '404 not found' #load packages library(stockportfolio) library(quadprog) #get data of returns stocks <- c( "spy", "efa", "iwm", "vwo", "lqd", "hyg") returns <- getreturns(stocks, freq="week") returns time scale: week average return spy efa iwm vwo lqd hyg 0.0011957600 0.0002371890 0.0012480337 0.0005973494 0.0011942381 0.0012353135

javascript - Logout and Delete Cookies [Redirect to main page] -

when user clicks logout button main page, cookies deleted , redirected window.location = url; . if user not login, instead clicks logout, still redirected window.location = url;. codes below, can't seem logout if click logout button , stay @ main page while being logged in. can tell wrong? new javascript , need regarding topic. $('.logout-btn').click(function(e){ e.preventdefault(); if(isset($_cookie['referer']) && $_cookie['referer'] != '') { window.location = url; } else { $.post(outurl, function( data ) { }).then(function(r){ $('#popup_ok, .x-close').bind( "click", function() { window.location = url; }); if(r.result == 1){ popup_msg('failed', r.msg); } else{ popup_msg('success', r.msg); settimeout(function(){ window.location = url; },2000); } }); } }); try code execute when user c

Rails validates with regex is not working? -

simple regex not working.. example first_name = "a11" works fine. why isn't format regex validating properly? validates :first_name, presence: { message: "name cannot blank." }, format: { with: /[a-z]/i, message: "name must contain letters." }, length: { minimum: 2, message: "name must @ least 2 letters." } because matches regex. you have specify begin , end of string, , add * or match 1 char. format: { with: /\a[a-z]*\z/i, message: "name must contain letters." }, also note don't use ^ , $ , in ruby, ^ , $ matches begin , end of line , not string, broken on multiline strings.

Adding an ipv6 address to "require ip" in phpmyadmin.conf in linux -

i'm trying edit phpmyadmin.conf in etc/httpd/conf.d/phpmyadmin.conf such allows ip. have works when router set allow ipv4 addresses: <ifmodule mod_authz_core.c> # apache 2.4 <requireany> require ip 111.222.333.444 require ip ::1 </requireany> </ifmodule> <ifmodule !mod_authz_core.c> # apache 2.2 order deny,allow deny allow 111.222.333.444 allow ::1 </ifmodule> i want add ipv6 address, works when add entire ipv6 address (replacing ::1). ie xxxx:xxxx:xxxx:xxxx:xxxx:b95:bdb0:9c2b however, ipv6 address changes on reboot. want add limited address. i've tried: xxxx:xxxx:xxxx? xxxx:xxxx:xxxx:* xxxx:xxxx:xxxx/48 , variants of above. but none work (in fact, phpmyadmin won't restart) is there way this? :) the supported syntaxes are, apache 2.2 , 2.4 respectively: allow 1111:2222:3333:4444::/64 require ip 1111:2222:3333:4444::/64 the syntax

bash - Possible to create burn-after-execute temp file in one line? -

i have lot of (virtual) machines initialize, wrote init script , put on web server. paste following 4 lines 1 line console, vm can initialized expected. tempfile = `mktemp` curl http://host/path/to/init.sh > $tempfile sh $tempfile \rm $tempfile how write more elegant , compact? you can directly pipe curl 's output shell: curl http://host/path/to/init.sh | sh no tempfile needed. however, potentially insecure because hacker might modify init.sh during transmission , able execute arbitrary code on system then. @ least suggest use https

iphone - iOS and Parse.com backend -

how go designing , managing data messaging application on ios using parse? i've been thinking while , i'm @ loss... how have efficient , fast access data!? know way around in sql , stuff, not sql... need advice how tie things , connect app user his/her sent messages received messages other users using parse backend. create class each user? each conversation? or through sender , receiver id in 1 class? going still fast when class have 200,000 entries? main issue... how manage part of app!! i working on app when started few month ago, didn't take consideration wanted start , not create obstacles don't know begin with. just clear things up, started learning ios same time started project... computer engineer strong c/assembly background , iphone stuff been little annoying getting used it. edit---------------------------------------------------------------------- so have code in viewwillappear in messageviewcontroller load messages in conversation. pfquery *c

scala - Play Framework automatic JSON marshalling -

i'm looking set straight on understanding of how play framework handles conversion of scala objects json , vice versa (specifically restful apis): i've read on , on again across web using play's json support nothing pleasure. coming spring have built in httpmessageconverter (specifically mappingjacksonhttpmessageconverter ) auto marshall requests , responses in controllers hardly effort. play, on other hand, (it appears) requires write read , write converters every class intend marshal. e.g. (from play docs ): implicit val locationwrites: writes[location] = ( (jspath \ "lat").write[double] , (jspath \ "long").write[double] )(unlift(location.unapply)) to me seems tedious when compared built in automatic message converting capabilities of spring. understanding play uses jackson under hood can same accomplished scala / play, or perhaps premise flawed? you can use writes macro : implicit val locationwrites = json.writes[locatio

Are there any value type collection in C#? -

are there collections value type semantics in c#? set1 equals set2 if contain same structs/primitives? maybe in same order. hashset pretty close, == doesn't compare values in collections. setequals return true if contain same values. however, order doesn't factor in. can use sequenceequal if order important. static void main(string[] args) { hashset<int> set1 = new hashset<int> { 1, 2, 3 }; hashset<int> set2 = new hashset<int> { 2, 1, 3 }; hashset<int> set3 = new hashset<int> { 1, 2, 3 }; console.writeline(set1.setequals(set2)); // true console.writeline(set1.sequenceequal<int>(set2)); // false console.writeline(set1.sequenceequal<int>(set3)); // true }

php - send a variable through url in Include -

i trying send variable "q" search page through url. error saying fatal error: require(): failed opening required 'theme/_modules/contact/search.php?q={echo $q;}' (include_path='.:/usr/lib/php:/usr/local/lib/php') here code if(isset($_post['q'])){ $q= $_post['q']; } require 'theme/header.php'; require 'theme/_modules/contact/search.php?q={echo $q;}'; require 'theme/footer.php'; can 1 tell me reason , way on come problem.. thank you.. after doing this.. require 'theme/header.php'; //require 'theme/_modules/contact/search.php?q={echo $q;}'; require "theme/_modules/contact/search.php?q=$q"; require 'theme/footer.php'; i error warning: require(theme/_modules/contact/search.php?q=saman): failed open stream: no such file or directory in /home/dr7bf45v/public_html/search.php on line 17 i think trying go on wrong way. you trying acc

vb6 - LINK : fatal error LNK1212: error opening program database; file is in use -

link : fatal error lnk1212: error opening program database; file in use while creating .exe vb project, getting above error. .exe not built successfully. maybe .exe or other output file (e.g. .pdb file) read-only

java - problems with adding action button in android tutorial -

Image
i following android tutorial , have problems adding search button action bar. i have following main_activity_actions.xml because support android version 8: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <!-- search, should appear action button --> <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/action_search" yourapp:showasaction="ifroom" /> <!-- settings, should in overflow --> <item android:id="@+id/action_settings" android:title="@string/action_settings" yourapp:showasaction="never" /> </menu> then in mainactivity class: @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu items use in action bar menuinflater

jquery - Css of div with dynamic value of id? -

i have 2 or more sections on webpage. here taking 2 photo sections example. every section have given email icon link same class name "divclasss" different ids clicki6524 , clicki6525. every section have hidden div consecutively dclicki6524 , dclicki6525. now want display these hidden div click on email icon link in particular section. able so. can these 2 section here . some time work when give static div value #dclicki624 in below code css. dont want give static value because div id comming dynamically , can 2 or more. appreciated. the jquery code using is: $('.divclasss').click(function(){ var = 'd' + this.id; $("#a").css({"display":"block", "top":"10%", "position":"fixed", "background":"#333", "border-radius":"5px", "padding":"10px",

how to inheritance multiples class through sass -

i have scenario in sass .a{ background-color: red; padding :20px; h4{ padding-bottom :20px;} } // class .b{ background-color : blue; padding : 20px h4{ padding-bottom:20px} } question: how can combine padding , h4 in sass without repeating padding , h4 properties the straight forward way use @extend . %common_properties { padding: 20px; h4 { padding-bottom: 20px; } } .a { @extend %common_properties; background-color: red; } .b { @extend %common_properties; background-color: blue; }

Are coded UI tests supported for Silverlight 5 in Visual Studio 2013? -

i know if coded ui tests supported silverlight 5 in visual studio 2013. have goggled lot fetch information issue didn't proper information. plugin silverlight 5 available microsoft.visualstudio.testtools.uitest.extension.silverlight reference not available silverlight 5 projects. unable detect silverlight controls of application.

Angularjs: How can I run my custom directive after template compiled -

i writing custom directive , want directive access child element generated id in code below <div class="my-directive" data-rawdata="user-{{user_id}}"> <div class="raw user-{{user_id}}" id="user-{{user_id}}" style='display:none'> i'm here. </div> </div> this directive: .directive('mydirective', [function(cart) { return { restrict: 'c', priority: -1000, link: function(scope, elem, attrs) { var element_id = attrs.rawdata if(element_id){ var found1 = angular.element("#" + element_id); // not found var found2 = angular.element("." + element_id); // not found var found3 = angular.element(".raw"); // found console.log( [found1.length, found2.length, found3.length] ); console.log( found3.attr('id') ); // -> still not compile = user-{{user

struts2 - Data type converter not working with embedded object in Struts 2 -

i'm creating data type converter within struts 2 framework , got problem below: in action conversion property file, need specify property this: foo.field1.field2 = coverterclassname field1 embedded object within foo , has field2 1 of fields. i have tried , couldn't make working unless put property file into same package class foo , hooks struts2 model class. has had problem before , there other solution it? because doing class wide conversion , conversion property file should in same location of classpath target bean. if target bean action bean, should in same package action class. more applying type converter bean or model . you might see this answer how apply application wide conversion field type. note, can same type conversion using annotations .

linux - extracting text from MS word files in python -

for working ms word files in python, there python win32 extensions, can used in windows. how do same in linux? there library? you make subprocess call antiword . antiword linux commandline utility dumping text out of word doc. works pretty simple documents (obviously loses formatting). it's available through apt, , rpm, or compile yourself.

Custom Dialog with align Left and Top margin in android -

i want create custom dialog left , top margins. i tried this final dialog dialog = new dialog(home.this); dialog.getwindow().getattributes().gravity = gravity.left|gravity.top; dialog.getwindow().setbackgrounddrawable(new colordrawable(android.r.color.transparent)); dialog.setcontentview(r.layout.home_menu); dialog.show(); it align left , top layout.it fine need margins or padding's them.if body know please give me advice how can achieve this.thanks in advance. try this: window window = dialog.getwindow(); windowmanager.layoutparams wlp = window.getattributes(); window.setgravity(gravity.left | gravity.top); dialog.getwindow().getattributes().verticalmargin=0.01f; dialog.getwindow().getattributes().horizontalmargin=0.01f; wlp.flags &= ~windowmanager.layoutparams.flag_dim_behind; window.setattributes(wlp); dialog.show();

iphone - iOS draw line with both arrow with start-end point while finger touch end and rotate from start or end point -

Image
i need making drawing demo. when user draws line using finger, line has directional arrows on both ends. when finger releases, draws line "?" (question-mark) in center of line. then, when user taps on "?", show new view , user can enter value, , value in line. and can add multiple lines on capture-image , can delete selected line. i don't understand how can start developing these features please give me idea or link, or suggestion start develop feature. you should use uitapgesturerecognizer , uibezierpath . have person taps @ 1 point , taps @ second point, make uibezierpath between 2 points. question mark in middle make line goes first point (half distance between point 1 , point 2 - 20pt). , same other half of line (so have space in middle of line.

javascript - How do you dynamically assign a function to an element's onclick event? -

as opposed setting individual functions each element's click event, iterate elements , assign based on id or whatever? document.getelementbyid('measure').onclick = function() { clickme(1); }; how approach this? in past i've done along these lines: var setclickonelements = function(selector) { $(selector).each(function() { $(this).click(function(event) { // behaviour on click }); }); }; ...where selector class selector, e.g. .my-class . within callback passed each can @ other properties of selected elements, e.g. id etc. if add class elements you'd set click function , call setclickonelements('.my-class'); on load, should go! edit: above uses jquery. if you're restricted pure javascript, use 1 of methods described in john resig's post on implementations of getelementbyclass : http://ejohn.org/blog/getelementsbyclassname-speed-comparison/ here's example (using dustin diaz's met

html - Aligning Div To Middle? -

hello question aligning divs. on website working on fun have div , inside div child div. need child in middle of adult div. left , right aligning in middle stuck top. if me appreciated! jsfiddle <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title></title> </head> <body> <div id="container"> <div id="logo"> </div> <div id="nav"> </div> <div id="content-background"> <div id="content"> </div> </div> <div id="faqs"> </div> <div id="footer"> <div id="footer-right"> </div> <div id="footer-l

php - htaccess redirecting not working from gmail link -

i having problem if send 1 link email. when people click on non-www link gmail redirect home page of site when click on www added link reached in correct page. here 1 example: http://www.google.com/url?q=http%3a%2f%2fgreatratedjs.com%2fcurtnw&sa=d&sntz=1&usg=afqjcnh_vlmdsssnnc-20fliz9ot7ip3ag (not working non-www) http://www.google.com/url?q=http%3a%2f%2fwww.greatratedjs.com%2fcurtnw&sa=d&sntz=1&usg=afqjcne-ld9hpvmyzmlh-ivib7insdgryq (working fine www) my .htaccess redirecting rules: rewriteengine on rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] i using joomla community builder. joomla content working fine community builder's user profile has such problem. using sh404sef extension url management. suggestion ? in advance :) it seems work me well. in rule, adding b flag should ensure weird characters $1 capture correctly re-encoded. try this: rewriteengine on rewritecond %{http_host} !^w

javascript - append value of data attribute to dom -

i extract values of date-res , data-ref jquery , append it's div. <div id="grid"> <div class="item blue" date-res="8" date-ref="13" data-groups='["all", "letters", "blue", "square"]'>d</div> <div class="item green" date-res="9" date-ref="10" data-groups='["all", "letters", "blue", "square"]'>e</div> <div class="item green" date-res="2" date-ref="7" data-groups='["all", "letters", "blue", "square"]'>f</div> </div> try use .append(val1,val2) , $('#grid div.item[data-res][data-ref]').each(function(){ var $this = $(this); $this.append($this.data('res'),$this.data('ref')); }) demo your html contains wrong attribute names instead of data- use, <di

html - How to make a Jquery mobile popup appear in full screen of device -

i have been trying hard make popup appear in full screen in jqm not able here fiddle and code html <div data-role="page" id=""> <a href="#sql" id="opendialog" data-rel="popup" class="ui-btn ui-corner-all ui-shadow ui-btn-inline" data-transition="pop">open dialog</a> <div data-role="popup" id="sql" data-dismissible="false" style="max-width:100%"> <div data-role="header" data-theme="a"> <h1>delete page?</h1> </div> <div role="main" class="ui-content"> <h3 class="ui-title">are sure want delete page?</h3> <p>this action cannot undone.</p> <a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">cancel</a&g

html - Uncaught TypeError: Cannot set property 'value' of null, JavaScript -

i keep on getting error when using code. src --> http://jsfiddle.net/myg2c/1/ js <input class="menu1" type="submit" value="total : 0.00" onclick="m.gettotal()" id="total" /> html var m = { total:0, gettotal: function () { this.total = this.total.tofixed(2); document.getelementbyid("total").value = "total : " + this.total; }, } m.total = 5; //clicking button should update text on button. two problems... getelementbyid should getelementbyid this.total = this.total.tofixed(2); work first time because total number. after becomes string , tofixed not valid method on string updated fiddle

github - Git submodules and composer clarification -

Image
i have created php project. in project under vendor/ have included using composer other 3rd party modules. think came .git folder. finally decided add code under git. have problems. of 3rd party modules came .git folder without ( idk reason ). why happen clue ? in root folder have nothing in .gitmodules. when git status get: # modified: vendor/somemodule (modified content) what should in case, what's best way handle this. want able still updated changes in libraries , keep track of modules in repository ( beanstalk ) when merged master branch upload live server. any ideas, links read helpful. don't know if submodules or not yet. an image vendor: thanks. the op marius.c confirms: when git status get: # modified: vendor/somemodule (modified content) that mean vendor/somemodule submodule (see " strange icon , entry after corrupt commit "). but root issue seems issue composer , commented op. should commit dependenci

sql server - "Violation of PRIMARY KEY constraint 'PK_Vehicle_Transactions'. Cannot insert duplicate key in object 'dbo.Vehicle_Transactions" -

there's webservice api design, each time push data cross webservice in return mov = "violation of primary key constraint 'pk_vehicle_transactions'. cannot insert duplicate key in object 'dbo.vehicle_transactions'. statement has been terminated." api doesn't know stopped , continue! kindly see source code below thanks public sub uploadvehicle_transaction() try 'do sync indacator proper upload in action dim vt new datatable vt = new statn_sync.datasettableadapters.vehicle_transactionstableadapter().getdata() each dr datarow in vt.rows dim icount integer = 0 dim mov string = comt.insertvehicle_transaction(convert.toint64(dr("transactionid")), _ convert.todatetime(dr("transaction_date")), _ convert.toint32(dr("bank"))

mysql - SQL Query Interrogation Issue -

Image
this query: select f.fieldid,fd.fieldname, p.productid,pd.productname, p.price,p.stoc, p.isactive,textvalue products_products p left outer join products_products_details pd on pd.productid = p.productid left outer join fld_chosenvalues f on f.productid = p.productid inner join fld_fields_details fd on f.fieldid = fd.fieldid pd.locale = "ro-ro" , fd.locale = "ro-ro" in image below , can see result of query : the problem want put "volum", "tip inchidere", "amabalare paiet", "ambalare bax" column , assign value "212ml"... can see in image below want : i apologize images, didnt know other ways explain that. thx this query pivot, not working : select f.fieldid,fd.fieldname, p.productid,pd.productname, p.price,p.stoc, p.isactive,textvalue products_products p left outer join products_products_details pd on pd.productid = p.productid left outer join fld_chosenvalues f on f.productid = p.productid inner jo

vba - Excel - Custom Ribbon Buttons Not Working After File Rename & Relocation -

Image
i have written macros in vba , created custom ribbon tab said buttons placed on it. i have since renamed file , relocated elsewhere; vba has copied across fine (i.e. has remained within project expected) , code runs when run vba editor (i access using alt + f11). however, buttons (see image) no longer work, instead referring previous version of file. is there simple way buttons update/"refresh" without having manually create ribbon tab once again , adding of buttons accordingly? i have imported previous version of ribbon (that had exported backup purposes) buttons still seem refer previous version of document. any ideas , suggestions appreciated. i know it's , old question maybe answer can others. had same problem , had change registry entry. go start menu-> run -> regedit.exe -> hkey_current_user -> software -> microsoft -> office -> 12.0 (if office 2007) -> excel -> entry old add-in file path , update value new location

php - My video share script doesn't show video thumbnails -

recently installed video sharing script. there 1 problem while sharing video youtube when share youtube videos thumbnail (preview image) doesn't appear think blocking in php.ini. problem not script because it's working in 1 hosting , in 1 doesn't. here working: http://www.ihsanilim.com/media , here not working: http://media.islomummati.com both hosting php 5.x , mysql 5.x linux apache can tell me should on or off in php.ini youtube video images automatically youtube server ... thanks!

buttonclick - Windows phone 8.1 button click event not working -

the click option doesn't create click events, tried mouseleftbutton nothing reacts. attach "xaml" file see wrong it. solution place object after splash screen code, , set visibility true after splash screen ends. asking better solution place object in , react @ click events. <phone:phoneapplicationpage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" xmlns:shell="clr-namespace:microsoft.phone.shell;assembly=microsoft.phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:i="clr-namespace:system.windows.interactivity;assembly=system.windows.interactivity" xmlns:ec="clr-namespace:microsoft.expression.interactivity.core;assembly=microsoft.expression.

html - IE 11 not aligning Flexbox properly -

the following works fine chrome , ff <div style="display:flex; flex-direction:column;"> <div style="flex:1"> top<br /> top<br /> top<br /> top<br /> top<br /> top<br /> top<br /> top<br /> </div> <div>bottom</div> </div> however in ie 11, bottom div overlaps top div. ways fix this? js fiddle here: http://jsfiddle.net/fwfa6/ thanks, arun flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] this shorthand flex-grow , flex-shrink , flex-basis combined. second , third parameters ( flex-shrink , flex-basis ) optional. default 0 1 auto. so change style (default giving example, can check other values well) flex:0 1 auto like <div style="display:flex; flex-direction:column; min-height:100%"> <div style=&q

retrieve actual sent time of an received sms in android -

in original sms app of android can check details of received sms , wil show me time , date sent sender , time received message. interested in time difference between these 2 i can time received sms via code. how can extend time sent? uri uri = uri.parse("content://sms"); cursor cursor = getcontentresolver().query(uri, null, null, null, null); if (cursor.movetofirst()) { (int = 0; < cursor.getcount(); i++) { string body = cursor.getstring(cursor.getcolumnindexorthrow("body")) .tostring(); string number = cursor.getstring(cursor.getcolumnindexorthrow("address")) .tostring(); string date = cursor.getstring(cursor.getcolumnindexorthrow("date")) .tostring(); date smsdaytime = new date(long.valueof(date)); string type = cursor.getstring(cursor.getcolumnindexorthrow("type")) .to

jquery - Add dynamic input type on change of select box in spring mvc -

i have box have options "input","select","check","radion". on select of option, need populate corresponding html type like if select input, populate <input type="text"/> if select select , populate <select> box if select input, populate <input type="checkbox"/> tag. all things should dynamically. how can add spring:form tag new generated html type. adding new values command object. kindly suggest how can this. thanks, rishi. try : <select id="multioptions" name="multioptions" style="width: 214px"> <option value="s" selected="selected">--select input type --</option> <option value="c">checkbox</option> <option value="r">radio</option> <option value="b">button</option> </select> <div id="radios"> <input type="radio&q

c# - How can I set Longitude and Latitude Positions by textboxes in asp.net? -

i have take longitude , latitude position textboxes have defined in body tag, , textboxes values should set in longitude , latitude variables have defined in javascript. code not set textboxes values in longitude , latitude variables in javascript. can me? my code: <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=aizasyc6v5-2uaq_wushdktm9ilcqirlptnzgek&sensor=false"></script> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script> <script type="text/javascript"> if (navigator.geolocation) { navigator.geolocation.getcurrentposition(success); } else { alert("geo location not supported on current browser!"); } **latitude** = document.getelementbyid('latitude').value; //

javascript - IE8 and jQuery - problems with trim, length and AJAX -

Image
my code looks this: function loaddata() { $.ajax({ url: "", async: true, method: 'post', datatype: "json", data: { start: $('input[name=start]').val(), stop: $('input[name=end]').val(), week: $('#weekpicker').val(), range:$('select[name=date_control]').val(), type: 'loaddata' }, beforesend: function(xhr, opts) { if (!$('input[name=start]').val() && !$('input[name=end]').val()) { bootbox.alert('select date first!'); xhr.abort(); return false; } }, success: function(dane) { ustawienia = dane.ustawienia; // code here }, error: function(dane) { $('button[name=pokaz]').removeattr('disabled'); bootbox

android - Possible to highlight hard-coded string literals and navigate between them? -

i can see idea 13 marks if string hard-coded string literal. default highlight can missed after tired of investigating long class, , found no way automatically navigate between them, work has done manually error prone time passes. is there way highlight hard-coded string literals when search files? and can navigate withing them, again can during search? main menu - analyze - inspect code wait until analyze completed. @ bottom menu "inspection" choose: android - android lint - harcoded text - double click on line

jpa - Hibernate Using Merge on concurrent Update or Delete -

is there way me know if detached entity in session cache. have following scenario. public void method (entity entityobject) { //list associated objects , process criteria criteria = session.createcriteria(groupmembers.class); criteria.add(restrictions.eq("group", group)); criteria.createcriteria("group", "group", jointype.left_outer_join); list<groupmembers> members = (list<groupmembers>) criteria.list(); ... entityobject= (entity) session.merge(entityobject); if (somecondition){ session.delete(entityobject); } } this works fine of time except in following scenario. entityobject deleted transaction. want session.delete(entityobject) fail because entityobject deleted. however, because of session.merge(entityobject) record inserted database if entity can not found in cache or db delete succeeds. updated. works doing select @ beginning... way? publi

c++ - Unpacking parameter packs in template aliases -

i run problem unpacking variadic templates template alias. the following code works clang 3.4 , gcc 4.8 fails gcc 4.9: template <typename t, typename...> using front_type = t; template <typename... ts> struct foo { using front = front_type<ts...>; }; gcc 4.9 complains: test.cc:7:37: error: pack expansion argument non-pack parameter 't' of alias template 'template<class t, class ...> using front_type = t' using front = front_type<ts...>; ^ test.cc:1:15: note: declared here template <typename t, typename...> ^ there exists filed gcc bug ( #59498 ), supposed fail? here context c++ core language issue #1430, "pack expansion fixed alias template parameter list" : originally, pack expansion not expand fixed-length template parameter list, changed in n2555. works fine templates, causes issues alias templates. in cases, alias template transpa

java - Why does my EJB interface need to extend serializable? -

i'm trying figure out going on , can't reason through why. i've got extremely simple ejb 3 implementation i've been playing (deployed standalone openejb 3.1.2 container). if setup interface/implementation looking this... userservice (interface) public interface userservice { public string dostuff(string myparam); } userservicebean (implementation) @stateless @remote({userservice.class}) public class userservicebean implements userservice { public string dostuff(string myparam) { return "did stuff!"; } } ...this works great (i.e. can deploy openejb standalone container , run quick test involving jndi lookup , service call returns expected "did stuff!" value). however, once introduce pojo created method signature, this: userservice (interface) public interface userservice { public user lookupuser(string myparam); } userservicebean (implementation) @stateless @remote({userservice.class}) public class u