Posts

localdb - Cannot restore database with .mdf extension in sql server -

Image
i have back-up database localdb server .mdf file: c:\thesis - source code\sis-jen\sis\app_data\sis_db.mdf and backed-up extension of .bak : c:\thesis - source code\sis-jen\sis\app_data\sis_db.mdf.bak now, want restore back-up file new server(my pc/server), cannot restore using .bak file: c:\thesis - source code\sis-jen\sis\app_data\sis_db.mdf.bak i've got error: restore of database 'c:\thesis-source code\sis-jen\sis\app_data\sis.db.mdf' failed can me fix error? check restore statement - use [master] go restore database [sis_db] disk = n'd:\sis_db.bak' file = 1, move n'sis_db' n'd:\sis_db.mdf', move n'sis_db_log' n'd:\sis_db_log.ldf', nounload

linux - Tap interfaces and /dev/net/tun device, using ip tuntap command -

i'm using ip tuntap create tap interface, this: $ sudo ip tuntap add mode tap tap0 afterwards, set interface , address common ip commands. can see interface , addressed simple ifconfig . now, told teacher creating tap interface (named tap0 in case), find /dev/net/tap0 node, , able write in or read it. however, can't find it. "just" have /dev/net/tun . do have deal tun node, or supposed have tap0 node? it's been long time since question asked, thought idea post actual answer future reference. tap interfaces, tun interfaces, virtual interfaces provided in-kernel tun/tap device driver. interface driver provides character device /dev/net/tun mentioned in question. by issuing: $ sudo ip tuntap add mode tap tap0 we instruct ip tuntap create network interface named tap0 , accomplished using proper ioctl(2) calls on aforementioned device file /dev/net/tun talk underlying tun/tap device driver, can observe in ip tuntap 's source code ...

How to write ruby function to check for case insensitive word "error" in a file and return a property -

the function written me given below. work properly? else please correct me. def log_file( file ) parsed_data = {} read_lines( file ) {|line| if line.match(/error/i) parsed_data[:property] = "error" end } return parsed_data end the function may work properly, it's impossible tell you're using methods defined externally such read_lines . also, it's not idiomatic ruby (especially explicit return , multi-line {} block). here's possible alternative def def log_file(file) file.open(file).each_line |line| return({ property: "error" }) if line =~ /error/i end {} end also, doesn't make lot of sense me return hash, given "error" string hard-coded. return "error" or nil. def log_file(file) file.open(file).each_line |line| return "error" if line =~ /error/i end nil end or true/false def success?(file) file.open(fil...

Gtk Perl: Removing an item from a Gtk2::ComboBox by its name, rather than index -

while working perl , gtk2, have programmatically remove option drop-down (combobox). while i'm aware $combo_box->remove_text ($position) trick in 1 shot, need remove option based on name (entered user). i'm unable find method can return index of item name. out? it's bit unclear mean "name"; combo box items don't have names. if combo box textual, each item made of text, text isn't name. have same string in items instance, make unclear 1 want delete. i think you're going have implement youself, iterating on combo box's underlying tree model. it's if want delete first match, continue searching find of them.

matlab - Can I give headernames to columns in a structure field? -

i have structure multiple fields , these fields have multiple columns. give columns of these fields names instead of 1,2,3... not going reference columns names clarity. instance: structure.field1 consists of 3 columns of data , name these instance columns: 1 = time 2 = place 3 = date how can without use of tables sticking structure!! i solved problem implementing table inside structure. @dev-il suggestion

php - Why does the XMLReader stop reading this XML file? -

i reading xml file <?xml version="1.0" encoding="utf-8"?> <articlelist xml:lang="de"> <articlegroup id="bdb"> <oldarticle>no</oldarticle> <article articlenr="103154" artikelgruppennr="bdb" artikelgruppenname="instant-kameras" setartikel="0"> <name>fujifilm instax mini hello kitty set</name> <brand id="fuj">fujifilm</brand> <tecdat> <group name="ausstattung"> <proberty name="eingebautes blitzgerät">ja</proberty> </group> </tecdat> <tecdat> <group name="stromversorgung"> <proberty name="stromversorgung">2x mignon (aa)</proberty> </group> </tecdat> <tecdat> <group name="allgemein"> <proberty name="farbe">rosa</proberty> <proberty name="breite (mm)">169</proberty...

ios - supportedInterfaceOrientationsForWindow returns UIInterfaceOrientationMaskPortrait but my viewcontroller show in landscape -

i handling orientations in appdelegate.m file. supportedinterfaceorientationsforwindow returns uiinterfaceorientationmasklandscape of view controllers , uiinterfaceorientationmaskportrait 1 viewcontroller. when move landscape viewcontroller viewcontroller want portrait supportedinterfaceorientationsforwindow returns uiinterfaceorientationmaskportrait view controller appears in landscape. please me i've been stuck long time. testing on iphone 6, ios 9. let's view a 1 of landscape views of app , b intended portrait view. now, when device held in portrait on , b accessed, view doesn't change orientation portrait (since device in portrait). i'd suggest 'tell' system b in landscape while preparing segue , in viewdidload b's view controller, change orientation portrait. this way, no matter previous view's orientation, b open in portrait when loads. use following code change orientation. in case using segue use code in - (void)...