Posts

Showing posts from February, 2011

How are memory read, write, execute permissions enforced in the Linux kernel? -

how system able restrict processes being able write regions of memory set read-only? in particular, how linux kernel able enforce these permissions, assuming hardware not able job kernel? my initial guess these regions of memory not mapped process's address space, whenever process tries accessing these regions of memory, page fault generated, allows kernel take control check in order. realize degrade performance, i'm here asking understanding if there smarter method enforcing these permissions. the task of enforcing memory protection handled mmu. i'm not aware of architecture have mmu don't have hardware support memory permissions. guess talking mmu-less systems here. for long time linux required mmu work. still if want support mmu-less systems. comes uclinux project merged upstream time ago. system compiled nommu not, however, work normal linux system (a lot of applications won't work on it) , no memory protection 1 of limitations. to answer qu

matlab - How to train a neural network for the logical OR? -

so understand architecture of network. 2 input neuron, x1 , bias. give bias weight of 10 , x1 weight of -20. if x1 0 sigmoid(10) = 1. if x1 1 sigmoid(-10) = 0. i tried implement in matlab/octave not figure out how. first of keep in mind need 2 inputs , bias, can have possible options (0,0), (0,1), (1,0) , (1,1). 1 input neuron , bias can't create possible inputs. then randomly set weights , start training forwarding inputs , correcting weights using algorithm backpropagation. started recommend follow tutorial http://iamtrask.github.io/2015/07/12/basic-python-network/ , you'll learn how train simple neural nets , how work. the tutorial in python, it's simple , useful idea.

hex - 7zip CRC data of files in packed archive -

i faced next problem. need crc data of files in packed archive 7z. have found docs ( http://www.7-zip.org/recover.html ) describes how 7z works integrity of packages unfortunately didn't found answer. do have ideas how crc file's data packed 7zip archive without unpacking it? 7z l -slt archive.zip should list extended info files in archive, including crc if added @ creation time

jQuery extend nested object -

when try extend object, passing in full object, seems overwrite desired target object. however, can extend each subobject individually, , pass in , works. $(function() { window.test = {}; $.extend(window.test, { init: function(opts1, opts2) { //method 1, overwrites this.options = $.extend({}, this.settings, {opts1: opts1, opts2: opts2}); //method 2, works this.a = $.extend({}, this.settings.opts1, opts1); this.b = $.extend({}, this.settings.opts2, opts2); this.options2 = $.extend({}, this.settings, {opts1: this.a, opts2: this.b}); console.log(this.options, this.options2); }, settings: { opts1: { a: 'hello', b: 'hi', e: 'this still here?' }, opts2: { c: 'yo', d: 'wassup' } } }

python - Cannot run anything from mysql-utilities: "No module named mysql.utilities.common.tools" -

redhat 6.5. installed via rpm repos mysql-utilities 1.3.6 , mysql-connector 1.1.6 packages. mysqlrplcheck executed (though never found out if worked). realized version of suite missing need, mysqlrplsync . downloaded , installed 1.5.4 directly oracle. found out mysql-connector 1.1 old , upgraded 2.1.2 of suite. now if run any of suites programs, get: traceback (most recent call last): file "/usr/bin/mysqlrplcheck", line 24, in <module> mysql.utilities.common.tools import check_python_version importerror: no module named mysql.utilities.common.tools i think there should mysql.py/mysql.pyc in <pythonlibpath>/ directory, there none. silly packaging error on oracle's part? note: not duplicate of 19247867 wasn't answered anyway. different environment, (significantly) different versions of software. not duplicate of 24267017 nor referral because connector installed. (though might problem... see comment) update: possibly fixed in mysq

coldfusion - Pass form value to cfc -

i have cfc function returns query list of employees displayed in table. have sorting form on page, onclick of column heading data needs sorted based on column being clicked. now, had working long queries on page itself. trying move queries cfc now. sure missing basic here. can please point me how sorted results cfc onclick of column header? <script> function submitformnow(x){ if (document.form.show.value == "desc") {$('input[name=show]').val('asc');} else{ $('input[name=show]').val('desc');} $('input[name=order_by]').val(x); document.form.submit(); } </script> <cffunction name="getemps" access="public" output="false" returntype="query"> <cfargument name="emp_id" type="numeric" default="#variables.emp_id#" /> <cfargument name="order_by" default=&quo

How do I view the Bind variables from a PHP Prepared Statement on SQL Server 2012? -

i have read question oracle's bind equivalent. 4 years later, however. have looked @ sp_executesql from https://msdn.microsoft.com/en-us/library/ms188001.aspx?f=255&mspperror=-2147217396 i not using t-sql or sort of stored procedure, php prepared statement (using pdo). how can view bound value in sql server 2012? if there way me use sp_executesql, not know how use it. edit: when view, mean table in sql server. edit: trying find out value received sql server. want query view, table, run stored procedure, can see sql server received. here similar question: what sql server equivalent of oracle bind variables in dynamic sql? this in oracle 11g: http://docs.oracle.com/cd/b19306_01/server.102/b14237/dynviews_2114.htm#refrn30310 "v$sql_bind_capture displays information on bind variables used sql cursors. each row in view contains information 1 bind variable defined in cursor. includes:" edit: example, $sql = "select * employees employeeid

c# - Hot Topics in 30 days range -

i have on 10k topics in db table, , count page views each topic on session base , store one view/per topic/per user (session time 24 hrs). id-----topic----------------views 1------love------------------400 2------friends---------------203 3------birthday--------------360 now want hot topics in last 30 days, means want hot topics on bases of page views in last 30 days. need little direction, on how can achieve this. thanks you need separate topic table , topicview table if want adapt recent views. current table structure there no idea of how recent view - if have topic spike big-time in week 10 of year, may remain #1 on hot topic list long time (as 'views' column cumulative on all-time). create table topic ( [id] int not null identity(1,1) [topic] varchar(255) not null ) create table topicview ( [viewid] int not null identity(1,1), [topicid] int not null, [user] varchar(255) not null, [viewdate] datetime not null ) now can check ev

python - signal with PyQt4.8 -

i connect simple signal @ combo : def __init__(self, main_window, model): """ :type main_window: odawindow """ self.model = model self.mapper = qdatawidgetmapper(self.ui.frame_destination_body) self.ui.combo_box_info_body_otp.currentindexchanged.connect(self.mapper.setcurrentindex) self.ui.combo_box_info_body_otp.currentindexchanged.connect(self.print_hello) @pyqtslot() def print_hello(self): print("hello") the mapper.setcurrentindex ok not print_hello, know if general problem of pyqt(4.8) or if don't use correctly signal. have similar problem signal of push_button thank in advance

html - Bootstrap menudropdown show in the background -

hello everybody i'm beginner bootstrap library , in html page, when cursors on "item 2" , menu show in background. don't want use dropdown library bootstrap :) use custom menu dropdown :) don't know located problem. here source code demo one way solve surely set z-index of dropdown item

java - how to create custom reports in testng -

i have following java code: public class login { string login_status = null; string login_message = null; @test @parameters({"username","password"}) public void execute(string username, string password) throws ioexception { try { config.driver.findelement(by.linktext("log in")).click(); config.driver.findelement(by.id("user_login")).sendkeys(username); config.driver.findelement(by.id("user_pass")).sendkeys(password); config.driver.findelement(by.id("wp-submit")).click(); // perform validation here boolean expvalue = config.driver.findelement(by.xpath("//a[@rel='home']")).isdisplayed(); if (expvalue) { login_status = "pass"; login_message="login successfull user:" + username + ",password:" + password + ",\n expected: rtmedia de

android - Use Geofence transition to trigger separate array -

i have number of geofences hoping trigger samples upon entry. currently have arrays set geofences , corresponding samples. geofence setup using has come straight google location demo @ moment set create notification upon transition. have set geofence(2) triggers sample(2) currently samples in list in separate activity geofencemain class , geofence transitionsintent class know best method data geofence transition right class , love knowing data once have got in order make trigger individual item within array or list. please let me know if can provide more detail might question , , help!

java - Playing sound while tweening -

i've run issue while trying implement idea have. i have image tween alpha layer of, fading in , second later fading out. here wish play mario coin @ point of total fade in. i've tried implementing different callbacks either way sound plays either before tweening or after tweening. code snippet: tween.set(splash, spriteaccessor.alpha).target(0).start(tweenmanager); tween.to(splash, spriteaccessor.alpha, 2).target(1).repeatyoyo(1, 0.5f).setcallback(new tweencallback() { @override public void onevent(int type, basetween<?> source) { ((game) gdx.app.getapplicationlistener()).setscreen(new mainmenu()); } }).start(tweenmanager); doing: tween.set(splash, spriteaccessor.alpha).target(0).start(tweenmanager); tween.to(splash, spriteaccessor.alpha, 2).target(1).repeatyoyo(1, 0.5f).setcallback(new tweencallback() { @override public void onevent(int type, basetween<?> source) { soundmanager.playintro(); ((game) gdx.app.

c++ - From pixel to world coordinate formula explanation -

i have following (relatively easy) problem. developing ray tracer , following tutorial explained in link: http://www.scratchapixel.com/code.php?id=3&origin=/lessons/3d-basic-rendering/introduction-to-ray-tracing there formula don't though, used map pixel (i,j) world coordinates. formula following: float fov = 30, aspectratio = width / height; float angle = tan(m_pi * 0.5 * fov / 180.); float xx = (2 * ((x + 0.5) * invwidth) - 1) * angle * aspectratio; float yy = (1 - 2 * ((y + 0.5) * invheight)) * angle; in tutorial camera placed @ (0,0,0) , up/right/lookat vector not used @ all. seems in every tutorial different formula used map pixel , don't manage reason. moreover, if camera not placed @ (0,0,0) in position can decide? how formula vary? may kindly me? thanks! http://scratchapixel.com/lessons/3d-basic-rendering/3d-viewing-pinhole-camera if had made more research on website have found answer. whole point of website explain sort of technique. please

wcf - The maximum message size quota for incoming messages (65536) has been exceeded even after changing to 2147483647 -

i'm using wcf client , call method getemployeeid . in getemployeeid method, have return statement. return employeeid; when add breakpoint on employeeid - has 4984 id's. once click on continue, getting following error: failed invoke service. possible causes: service offline or inaccessible; client-side configuration not match proxy; existing proxy invalid. refer stack trace more detail. can try recover starting new proxy, restoring default configuration, or refreshing service. inner exception: maximum message size quota incoming messages (65536) has been exceeded. increase quota, use maxreceivedmessagesize property on appropriate binding element. in client , service, using: <bindings> <basichttpbinding > <binding name="mybasichttpbinding" maxbufferpoolsize="2147483647" maxbuffersize="2147483647" maxreceivedmessagesize="2147483647"> <readerquotas m

python - Allow form submission only once a day django -

i want allow users submit django form once, , once everyday. after submitting form, form wouldn't show (server-side checkings, don't want use js or client side thing; 'tamper-able') what best way in django? what have tried? i have not tried yet, however, i've considered options. trigger boolean field (where? on form user submit or his/her account?) change true, reset field false @ midnight with approach, wonder how can reset field false @ midnight too. i asked same question on django users , , couple of suggestions have come in, i'm looking well its been while, since asked question, , figured way (bad way, maybe) done. here's how #forms.py class formlastactiveform(forms.modelform): class meta: model = formlastactive fields = '__all__' # create model form mymodel model below here #models.py class formlastactive(models.model): created_by = models.foreignkey(user, blank=true, null=true) class mymod

c# - Just 'peek' at the clipboard -

is there way data clipboard not remove it, method or application can it? i have third party component can override paste method, can not change base.paste() doing. try save clipboard data before call base.paste() , after operation data. just use standard .net implementation.. why want use third party assembly? mystring = clipboard.gettext(system.windows.forms.textdataformat.text) myobject = clipboard.getdata(format); won`t remove text in clipboard. you can clipboard content , copy clipboard after third party component removed if: data = clipboard.getdata(format); //run 3rd party function clipboard.setdata(format, data);

regex - Pass a variable to a RegExp with symbol JavaScript -

i generate output mr. x born on 01-01-2000 using following code var str="%(name)s born on %(date)s", replace={name:'mr.x',date:'01-01-2000'}, subject=["name","date"]; subject.map(function(data){ var regex = new regexp("%("+data+")s", 'g'); str=str.replace(regex,replace[data]) }) console.log(str); i cant able replace dynamic variable symbol 1 me find better solution thanks. just escape ( , ) has special meaning in regex, used grouping (matches). var regex = new regexp("%\\("+data+"\\)s", 'g'); running code: var str="%(name)s born on %(date)s", replace={name:'mr.x',date:'01-01-2000'}, subject=["name","date"]; subject.map(function(data){ var regex = new regexp("%\\("+data+"\\)s", 'g'); str=str.replace(regex,replace[data]) }) docu

php - What exactly have I to do to create a child theme of a theme having more css files? -

i have create child theme implement changes wordpress theme , avoid losing these changes when theme updated. have doubt how it. i following official tutorial: https://codex.wordpress.org/child_themes i have create child theme directory (named accesspress-parallax-child because directory of original theme accesspress-parallax ) wordpress wp-content/themes/ directory of wordpress installation. have put style.css , functions.php files in new folder. i have put commented code in style.css file (as explained documentation): /* theme name: accesspress parallax child theme uri: http://example.com/twenty-fifteen-child/ description: accesspress parallax child theme author: andrea nobili author uri: http://example.com template: accesspress-parallax version: 1.0.0 license: gnu general public license v2 or later license uri: http://www.gnu.org/licenses/gpl-2.0.html tags: light, dark, two-columns, right-sidebar, responsive-layout, acce

assembly - why does movsw instruction increments the si and di registers by2 while movsb instruction increments the si and di registers by 1? -

i working movsb , movsw instruction in assembly language using flat assembler. now, noticed when movsb instruction executed si , di register incremented 1 while movsw instruction increments si , di register 2. bit confused why? can explain me reason. adding codes below both instruction comments. please me out. thanks! using movsb instruction(flat assembler) cld ;clear direction flag lea si,[val] ;the memory address of source loaded in source register lea di,[v];the memory address of destination loaded in destination register mov cx,5 ; counter executes number of characters in array rep movsb ; repeats instruction 5 times val: db 'a' db 'b' db 'c' db 'd' db 'e' v db 5 dup(?) using movsw instruction(flat assembler) cld ;clear direction flag lea si,[a];load address of in source ;register lea di,[b] ;load address of b in destination ;register mov cx,3 rep movsw ;copy each word source ;destination , in

objective c - Link UIPickerView to NSTimer iOS -

Image
i building app similar snapchat take picture or video , destructs after amount of time. i implementing uipicker within camera module , once user take picture select time how long recipient sees picture, user sends image self destructs after 1-10 seconds. how can link uipicker nstimer class? camera.h @property (strong, nonatomic) iboutlet uipickerview *timepicker; @property (nonatomic, strong) nsarray *pickerdata; picker data in camera.m file: interface // { int secs; } @end - (void)viewdidload { [super viewdidload]; self.pickerdata = @[@"1 second", @"2 seconds", @"3 seconds", @"4 seconds", @"5 seconds", @"6 seconds", @" 7 seconds", @" 8 seconds", @" 9 seconds", @" 10 seconds"]; self.timepicker.datasource = self; self.timepicker.delegate = self; } -(long)numberofcomponentsinpickerview:(uipickerview *)pickerview { return 1; } -(long)pickerview:(uipick

html - Relative link in CSS -

i need 1 situation. creat file structure : mainfolder index.html imgfolder bg.jpg cssfolder style.css i need link picture bg.jpg relative url in css style file : background-color: url('?'); i try /img/bg.jpg ../img/bg.jpg but, it's not working. :) just add lines of php in html using getcwd() sure relative path correct. btw: in unix systems: / refers root directory ./ refers current directory ../ refers directory, in current directory is

maven - Add Archtypes to Eclipse -

i new maven , restful services. have maven installed correctly , set variables. creating webservice using jersey-quickstart-webapp found did not appeared in list of archetypes. tried add using using add archetypes option. after entering details groupid: org.glassfish.jersey.archetypes artifactid: jersey-quickstart-webapp version : 2.16 // version correct?? following error please help. <b> org.eclipse.core.runtime.coreexception: not resolve artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:pom:2.16</b> i don't have ready explanation why eclipse archetype plugin giving error, since 2.16 valid version of jersey-quickstart-webapp . however, recommend try manually executing following command command prompt: mvn archetype:generate -darchetypeartifactid=jersey-quickstart-webapp -darchetypegroupid=org.glassfish.jersey.archetypes -dinteractivemode=false -dgroupid=com.example -dartifactid=simple-service-webapp -dpackage=com.exampl

php - mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 to be resource or mysqli_result, boolean given -

i trying select data mysql table, 1 of following error messages: mysql_fetch_array() expects parameter 1 resource, boolean given or mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given this code: $username = $_post['username']; $password = $_post['password']; $result = mysql_query('select * users username $username'); while($row = mysql_fetch_array($result)) { echo $row['firstname']; } the same applies code $result = mysqli_query($mysqli, 'slect ...'); // mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given while( $row=mysqli_fetch_array($result) ) { ... and $result = $mysqli->query($mysqli, 'selct ...'); // call member function fetch_assoc() on non-object while( $row=$result->fetch_assoc($result) ) { ... and $result = $pdo->query('slect ...', pdo::fetch_assoc); // invalid argument supplied foreach() foreach( $result $row ) { ... and

javascript - add a DOM object to array in jquery -

i have following code a_ajouter = $('.question'); hidden_div.push(a_ajouter); console.log(hidden_div); well, dom object should added div, however, console shows 'jquery.fn.init 1 ' last element. no idea is. here the page itself . if not clear enought (click on arrow start event) you trying add jquery array inside normal array, want add jquery object. a_ajouter = $('.question').eq(0); //first element hidden_div.push(a_ajouter); console.log(hidden_div); or dom object itself. a_ajouter = $('.question').eq(0); //first element hidden_div.push(a_ajouter[0]); //html element without jquery wrapper console.log(hidden_div);

linux - use value of wildcard in other parameter -

is there 1 line solution this? i have many files , subdirectories in directory. simplification lets have ./dir1/file1 ./dir2/file2 ./file3 i want run command each of files using wildcard (*) , use value of wildcard generate id of file in format dir_file , put parameter of command e.g., for command -file * -id <something> in case of 3 files example should called after expanding wildcard: command -file ./dir1/file1 -id dir1_file1 command -file ./dir2/file2 -id dir2_file2 command -file file3 -id file3 at least in bash not possible because: after word splitting, unless -f option has been set, bash scans each word characters *, ?, , [. if 1 of these characters appears, word regarded pattern, , replaced alphabetically sorted list of file names matching pattern. that means single * replaced list of files match pattern. try - after typing * in terminal press m-s-* (that means hold alt + shift + * together) , wildcard expanded. you can achiev

java - Setup DynamoDB Trigger using Lambda -

i'm trying create dynamodb trigger using dynamodb streams , aws lambda. researched lot couldn't find way read , process dynamodb stream event in java 8. i'm new both these technologies don't know how work this. essentially, want create record in table b whenever record created in table a. could of please point me code or post handles use case in java? thanks :) this code worked me. can use receive , process dynamodb events in lambda function - public class handler implements requesthandler<dynamodbevent, void> { @override public void handlerequest(dynamodbevent dynamodbevent, context context) { (dynamodbstreamrecord record : dynamodbevent.getrecords()) { if (record == null) { continue; } // code here // write table b using dynamodb java api } return null; } } when create lambda, add stream table event source, , you're go

Android creating file on internal storage -

i trying create .txt file in android , have tested lot of options how achieve this, think file created can't find it, should writed somehow public in public directory can access it. example: cachefile = new java.io.file(getfilesdir(), "cache.txt"); if(cachefile.exists() && !cachefile.isdirectory()) { try { writer = new filewriter(cachefile); bufferedreader br = new bufferedreader(new filereader(cachefile)); string tempo; while((tempo = br.readline()) != null){ log.i("test","reading cache "+tempo); if (tempo.contains("http")) { musicurl.add(tempo); } else { mydatalist.add(tempo); } } } catch (ioexception e) { e.printstacktrace(); } }

Download, unzip, and load Excel file in R using tempfiles only -

i trying , failing write process download .zip archive, extract particular excel file archive, , load excel file r workspace without ever writing of files (the .zip or .xls) hard drive. i have written version of process works zipped .csvs, doesn't work .xls. here's how version goes, using 1 of urls i'm targeting in current project , using readworksheetfromfile() instead of read.csv() @ appropriate moment: library(xlconnect) waed.old.link <- "http://eventdata.parusanalytics.com/data.dir/pitf.world.19950101-20121231.xls.zip" waed.old.file <- "pitf.world.19950101-20121231.xls" tmp <- tempfile() download.file(waed.old.link, tmp) tmp2 <- tempfile() tmp2 <- unz(tmp, waed.old.file) waed.old <- readworksheetfromfile(tmp2, sheet = 1, startrow = 3, startcol = 1, endcol = 73) unlink(tmp) unlink(tmp2) and here's pops after line 8, 1 tries ingest spreadsheet waed.old : error in path.expand(filename) : invalid 'path' argumen

javascript - Not able to fetch inline transform scale using jquery -

i creating functionality wherein need fetch inline transform scale value each li. below have created demo me out? html <div style="color:red;transform:scale(1);">dummy content</div> js $(function(){ $('div').click(function(){ var trans=$('div').css('transform'); console.log(trans); }); }); thanks in advance! --------------------update------------------------ i think question didnt justify problem facing please check below codepen reference. http://codepen.io/anon/pen/vozowv below code available might not able check in codepen: html <ul> <li class="image-container"> <img src="http://a3.mzstatic.com/us/r30/purple7/v4/2e/71/0f/2e710fc0-54c2-ce6a-3ce6-296cc0fe526e/icon175x175.png" alt="receipt" style="transform: scale(0.55); margin-top: -100px;"> </li> <li class="image-container"> <img src="

c# - EF 6 equivalent of NHibernate ToFuture -

my experience orms limited nhibernate @ moment. however, have started working on new project using ef6. in linq nhibernate have ability defer query execution , hydration multiple queries in single round trip this: // apples ienumerable<apple> , won't hydrated until enumerated // or query hydrated var apples = session.query<apple>().where(a => a.type = "red").tofuture(); // oranges ienumerable<orange> , won't hydrated until enumerated // or query hydrated var oranges = session.query<orange>().where(a => a.type = "small").tofuture(); // hydrate 3 queries var grapes = session.query<grape>().where(a => a.type = "red").tofuture().tolist(); someone has posted similar question regarding ef4. wondering if tofuture feature has been introduced in ef6? tofuture not in ef6 core feature. however, open source project called entityframework.extended provides additional functionality ef, futures

biztalk - Calling Restful Services Dynamically -

Image
i have existing orchestration calls services below configuration. system.diagnostics.eventlog.writeentry("abc", message_datasheets(file.receivedfilename)); varnewsearchdataloadurl = system.configuration.configurationmanager.appsettings["newsearchdataloadurl"]; varnewxmlmsg = new system.xml.xmldocument(); varnewxmlmsg.loadxml(@"<path>" + message_datasheets(file.receivedfilename) + @"</path>"); message_newunzip = varnewxmlmsg; message_newunzip(http.requesttimeout) = 3600; port_newjaxmicesearch_api(microsoft.xlangs.basetypes.address) = varnewsearchdataloadurl + "?path=" + message_datasheets(file.receivedfilename); port_newjaxmicesearch_api(microsoft.xlangs.basetypes.transporttype) = "http" here newsearchdataloadurl holds address of webservice needs called in config file.and path holds received file name.so called uri " http://new.abc.org/abcsearchwebapi/api/search/loaddatafeed?path=\share01 \biztalk\data

javascript - Marionette - Events being triggered multiple times -

i'm having troubles handling events between views , collections. in below example can find short version of webapp , how events being handled now. what happens here when switching menu1 menu2 or when going backwards, causes "app:change_city" event listener stacked up. when trigger event , calls method oncitychange() many times switched between menus. i'm not sure whether i'm using event aggregator (emgr) correctly. can please assist? emgr.js define(['backbone.wreqr'],function(wreqr){ "use strict"; return new wreqr.eventaggregator(); }) approuter.js define(['marionette'], function (marionette) { "use strict"; var approuter = marionette.approuter.extend({ approutes: { 'menu1' : 'showmenu1', 'menu1' : 'showmenu2' } }); return approuter; }); appcontroler.js define(['underscore', 'backbone', '

mysql - Running Multi Query but I have one row -

i want insert lot of data mysql query doesnt work it. result 1 row cant see more rows function addseri($seriname,$name,$piece,$price,$seri_end_date) { include 'connect.php'; $dd=explode("/",$seri_end_date); $seri_end_date=$dd['2'].'-'.$dd['1'].'-'.$dd['0']; echo $seri_end_date; ($i=1;$i<$piece;$i++) { echo $i; $veri[$price]; $ticketno= strtoupper(substr(md5(microtime()),0,10)).strtoupper(substr(md5(substr(string, start)), 0, 5)); $seriadd=mysql_query("insert tickets(ticket_no,ticket_seri,ticket_end_date,ticket_status) values ('$ticket_no', '$seriname', '$seri_end_date', 0)"); } }

android - How to change the menu according to the fragment using navigation drawer -

i'm using navigationdrawer main activity, when go fragment want modify menu, putting arrow home , hide search icon of navbar, i'm having 2 problems here, can hide search icon when change fragment, when i'm navigationmain should visible again, not happening, , if in fragment navigation bar must removed , arrow must appear can home, i've tried far: public class navigationmain extends actionbaractivity{ private drawerlayout mdrawerlayout; private listview mdrawerlist; private android.support.v7.app.actionbardrawertoggle mdrawertoggle; private charsequence mdrawertitle; private charsequence mtitle; private string[] mplanettitles; static toolbar toolbar; textview toolbartitle; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.navigation_main); mplanettitles = getresources().getstringarray(r.array.planets_array); mdrawerl

java - How do I run selenium test one after the other on multiple browser -

not sure going wrong, trying run same set of test 1 after other on multiple browser. testng.xml <suite name="selenium tests" parallel="false" thread-count="5"> <listeners> <listener class-name="ww5.listener.listener" /> </listeners> <test name="chrome" preserve-order="true"> <parameter name="browser" value="chrome"/> <classes> <class name="ww5.testcases.version.version" ></class> <class name="ww5.testcases.loginsuite.logintest" ></class> <class name="ww5.testcases.loginsuite.logouttest" ></class> </classes> </test> <test name="firefox" preserve-order="true"> <parameter name="browser" value="firefox"/> <classes> <class name="ww5.testcases.version.version&qu

ember.js - Ember {embedded: 'always' } on model Vs Serializer -

i reading through ember docs , examples on working embedded object json in ember. i came across embeddedrecordsmixin feature , saw can write code below tell embedded record. import ds 'ember-data'; export default ds.restserializer.extend(ds.embeddedrecordsmixin, { attrs: { author: { embedded: 'always' }, } }); qouting below ember page note use of { embedded: 'always' } unrelated { embedded: 'always' } defined option on ds.attr part of defining model while working activemodelserializer. nevertheless, using { embedded: 'always' } option ds.attr not valid way setup embedded records. and have seen model written this. app.child = ds.model.extend({ name: ds.attr('string'), toys: ds.hasmany('toy', {embedded: 'always'}), }); where child object has toys object embedded. going first example, can write child serailizer below? app.childserializer = ds.restserializer.extend(ds.embeddedrecordsmixin, {

In iOS image from SOAP service set as NSData is cut. Which can be the reason? -

i have soap service. use sudzc.com generated wrapper access service. during communication receive image (several different images) have expose. use nsdata field saved in .plist file store image. problem in cases image cut on right side. use aspect fit . sure image cut inside app, because have similar app on android , in app image ok. use right , right side cut. any ideas how manage situation? edit: i tried fixed image (as poojathorat suggested). fixed image shown ok. i remove constraints , widen area of image in ib still cut (even resized - sizes of parts of image bigger). set content mode of image scaletofill. imageview.contentmode = uiviewcontentmodescaleaspectfit; imageview.clipstobounds = yes;

angularjs - Why is my ng-hide / show not working with my ng-click? -

i want show elements contain displaycategory.name ng-click above it, it's not working expected. .divider-row .row-border(ng-hide="showme") .row.row-format .col-xs-12.top-label find stand %hr.profile .row.labelrow .col-xs-12 %ul %li(ng-repeat='category in service.categories') .clear.btn.category(ng-click='thiscategory(category) ; showme = true') {{category.name}} .divider-row .row-border(ng-show="showme") .row.row-format .col-sm-12.col-md-12.top-label.nopadleft think {{displaycategory.name}} i cannot run code verify, think problem binding property showme should replaced object status.showme . for example, define $scope.status = { showme: false}; outside ng-repeat (in controller maybe). please check working demonstration: http://jsfiddle.net/jx854d3y/1/ explanations: ng-repeat

c++ - How to create grouped adjustable windows with Qt? -

i using qt build ui c++. what want have many menus or working areas inside application, can moved around , adjusted in size simultaneously. what mean have workspace in matlab or visualstudio, if change size of section of program, sections neighbors adjust in size. also, these sections should movable other places on screen (so there new neighbors). i tried using mdiarea , mdisubwindows movable, cannot connect them adjust in size simultaneously or fill whole screen. so, questions are: (1) using mdiarea , mdisubwindows best widgets task? if not, should use? (2) if (1) yes, how can functionalities?

java - Unable to execute dex: method ID not in [0, 0xffff]: 65536 in Eclipse -

i'm developing application on eclipse. in need use following libraries 1) appcompact 2) google play services 3) livesdk 4) json.jar when try run project gave error. dex loader] unable execute dex: method id not in [0, 0xffff]: 65536 conversion dalvik format failed: unable execute dex: method id not in [0, 0xffff]: 65536 even have remove libraies java buid path still got error. i have used progaurd error not resolved. here progarud file project.properties proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # project target. target=android-22 android.library.reference.1=./workspace2/google-play-services_lib android.library.reference.2=./workspace2/livesdk android.library.reference.3=./android/workspace2/appcompat_v7 proguard-project.txt -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!fie

java - If i call Insert method from C i want to get output "Now in Class B", But actually i get "Now in Class C" why? how can it be solved? -

public interface d{ public abstract string joo(); public abstract string foo(); public bean tem(){ joo(); } } public abstract class a{ protected abstract string joo(); protected abstract string foo(); protected bean tem(){ joo(); } } public class b extends impliments d{ protected string joo(){ system.out.println("now in class b"); } protected string foo(){ super.tem(); } } public class c extends b{ protected string joo(){ system.out.println("now in class c"); } protected string foo(){ super.tem(); } public void insert(){ super.foo(); } } if call insert method c want output "now in class b", "now in class c" why? how can solved? when calling foo method in class c ,i want output "now in class c". you can't - @ least not without refactor. here's code cleaned clearer. note @override indicates method overrides inherited m

angularjs - UI bootstrap and angular accordian -

i building app uses angular js, bootstrap , opted try ui bootstrap (angular directives bootstrap). have accordion text areas in them, user fills them in there div gets updated i.e via expressions. worked fine bootstrap not. code is: <div class="col-lg-4"> <accordion> <accordion-group ng-repeat="group in groups" heading="{{group.title}}"> <div> <textarea class="form-control" rows="3" ng-model="what" id="input" maxlength="200"></textarea> </div> </accordion-group> </accordion> </div> then in separate div have: <div class="col-lg-8"> <div class="well well-lg note"> <p style="font-size:22px;">my text</p> <p>{{what}}</p> </div> any idea's going wrong trying bind data accordion text area separate

how to load and validate the video using paperclip-Rails -

please solve problem. using paperclip organized upload images. works. now organize video upload. changed model: model: class video < activerecord::base validates :title, presence: true validates :video, presence: true belongs_to :user has_attached_file :video, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png" validates_attachment_content_type :video, :content_type => /\avideo\/.*\z/ validates_attachment_file_name :video, :matches => [/3gp\z/, /mp4\z/, /flv\z/] validate :file_size_validation, :if => "video?" def file_size_validation errors[:video] << "should less 2mb" if video.size.to_i > 30.megabytes end end video controller: def create @video = video.new(video_params) if @video.save @video.update_attributes(user: current_user) flash